diff --git a/docs/validation/css-placeholder-pseudo-paint-237-235.md b/docs/validation/css-placeholder-pseudo-paint-237-235.md index f82060c0..e5267d67 100644 --- a/docs/validation/css-placeholder-pseudo-paint-237-235.md +++ b/docs/validation/css-placeholder-pseudo-paint-237-235.md @@ -46,8 +46,7 @@ The remaining core pseudo-element inventory is: discrete transition behavior remain open; - two functional `::highlight()` rules, which require named Highlight ranges, functional pseudo parsing, range paint, mutation, and teardown; -- two `::-webkit-details-marker` rules and six internal form-control part - rules (`::-webkit-inner-spin-button`, `::-webkit-outer-spin-button`, +- six internal form-control part rules (`::-webkit-inner-spin-button`, `::-webkit-outer-spin-button`, `::-ms-clear`, and `::-webkit-search-cancel-button`), which require bounded native control-part ownership before their declarations can have an observable effect. @@ -63,6 +62,12 @@ highlights and one `::marker`; shadow-only `::part`/`::slotted`, complete marker styling, first-line/first-letter layout, and cumulative browser/package/ performance evidence remain outside this slice. No Code OSS source changes. +The two Code OSS `::-webkit-details-marker { display:none }` rules are now a +separate bounded follow-up. They reuse the retained list marker and store one +hidden bit only when the pseudo matches; internal form-control parts remain the +only reachable vendor pseudo inventory without an observable WebScene control +part to style. + The remaining parser-recognized but runtime-unmaterialized pseudo-elements are `::first-letter`, `::first-line`, `::marker`, `::file-selector-button`, `::cue`, `::cue-region`, `::grammar-error`, `::spelling-error`, and `::target-text`. diff --git a/docs/validation/css-webkit-details-marker-783.md b/docs/validation/css-webkit-details-marker-783.md new file mode 100644 index 00000000..839b43f9 --- /dev/null +++ b/docs/validation/css-webkit-details-marker-783.md @@ -0,0 +1,28 @@ +# Hidden retained details markers + +Issues: WebScene #783, #237, and #235 + +Pinned unchanged Code OSS `645f29cc3176500b4b5762ba887cf2a7f0ffdf2c` +authors two `::-webkit-details-marker { display:none }` rules for Chat +disclosures. WebScene already represents `` as a list item and retains +one marker geometry/paint path. The selector was previously classified as an +ordinary unsupported pseudo and its declaration never reached that path. + +The selector now has a dedicated pseudo kind. Its bounded cascade accepts the +observed `display:none` value and restores the initial marker for +`initial`/`unset`/`revert`/visible display values. A hidden bit lives inside the +existing copy-on-write pseudo allocation only for a matching summary. Marker +text, geometry, intrinsic contribution, and scene paint all consume the same +existing `list_marker_text` decision; no second marker representation exists. + +Layout-style equality includes the hidden bit, so a winning-value mutation +invalidates layout once while unrelated recascades remain paint-only. A +non-summary selector match returns before allocating pseudo state. The authored +native contract covers classification, initial visibility, hiding, restoration, +and the non-summary allocation guard. The browser/native reftest compares the +pseudo-hidden result with the established `list-style:none` reference. + +No tests, builds, pixels, or performance gates were executed under the current +implementation-throughput direction. Dynamic mutation, 4,096-summary scaling, +teardown, exact Code OSS Chat pixels, and cross-platform package evidence remain +zero until run. diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_cascade_finalization.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_cascade_finalization.h index c6662e67..e85a55c5 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_cascade_finalization.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_cascade_finalization.h @@ -196,6 +196,7 @@ inline bool computed_layout_style_equal( right_table.border_spacing_vertical) && left_table.border_collapsed == right_table.border_collapsed && grid_layout_equal(left.grid(), right.grid()) + && left.details_marker_hidden() == right.details_marker_hidden() && pseudo_layout_equal(left.before_pseudo(), right.before_pseudo()) && pseudo_layout_equal(left.after_pseudo(), right.after_pseudo()); } diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_native_cascade.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_native_cascade.h index 2c7322f5..b55f1b3c 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_native_cascade.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_native_cascade.h @@ -160,6 +160,12 @@ bool apply_native_cascade(native_document& document,dom_node& node, variables,result,[](bool) {}); observe(declaration,result); } + else if(kind==10) { + property_result result; + apply_details_marker_declaration( + node,declaration,variables,result); + observe(declaration,result); + } else if(kind>=3) apply_scrollbar_declaration(node,kind,declaration,variables); else { auto& pseudo=kind==1?node.style.mutable_before_pseudo():node.style.mutable_after_pseudo(); diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h index 83c15e00..7b62bad7 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h @@ -36,6 +36,7 @@ inline int split_pseudo_element_selector(const std::string& selector, std::strin if (const auto kind = split_suffix("::-moz-placeholder", 8); kind != 0) return kind; if (const auto kind = split_suffix("::placeholder", 8); kind != 0) return kind; if (const auto kind = split_suffix("::details-content", 9); kind != 0) return kind; + if (const auto kind = split_suffix("::-webkit-details-marker", 10); kind != 0) return kind; if (const auto kind = split_suffix("::backdrop", 7); kind != 0) return kind; if (const auto kind = split_suffix("::-webkit-scrollbar-thumb", 4); kind != 0) return kind; if (const auto kind = split_suffix("::-webkit-scrollbar-track", 5); kind != 0) return kind; @@ -71,6 +72,35 @@ inline bool split_custom_highlight_selector( return true; } +template +void apply_details_marker_declaration( + dom_node& node, + const css_declaration& declaration, + const std::unordered_map& variables, + Decision& decision) +{ + decision.classification = "unsupported"; + if (node.tag != "summary" || declaration.name != "display") return; + const auto contains_variable = declaration.value.find("var(") != std::string::npos; + auto resolved_value = std::string{}; + const auto& value = contains_variable + ? (resolved_value = resolve_value(node, declaration.value, variables)) + : declaration.value; + if (value.empty() && contains_variable) { + decision.classification = "invalid-authoring"; + return; + } + const auto lower = ascii_lower(trim_value(value)); + if (lower == "none") { + node.style.mutable_details_marker_hidden() = true; + decision.classification = "supported"; + } else if (lower == "initial" || lower == "unset" || lower == "revert" + || lower == "inline" || lower == "list-item") { + node.style.mutable_details_marker_hidden() = false; + decision.classification = "supported"; + } +} + inline bool split_selection_selector( std::string_view selector, std::string& origin) diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_rule_operations.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_rule_operations.h index 09273236..800d1ba9 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_rule_operations.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_rule_operations.h @@ -310,7 +310,7 @@ void for_each_cascaded_pseudo_declaration( // kind prevents a high-priority ::before declaration from affecting // ::after while reusing the same layer/importance/rollback machinery // as the originating element. - std::array, 10> rules_by_kind; + std::array, 11> rules_by_kind; for (const auto& [kind, rule] : matched_rules) { if (kind > 0 && static_cast(kind) < rules_by_kind.size()) rules_by_kind[static_cast(kind)].push_back(rule); diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.cpp b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.cpp index 60482cdf..987a07ff 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.cpp +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.cpp @@ -73,6 +73,7 @@ std::string list_marker_text(const dom_node& node) if (node.tag != "li" && node.style.display != display_mode::list_item) { return {}; } + if (node.tag == "summary" && node.style.details_marker_hidden()) return {}; const auto type = resolved_list_style(node, false); if (type == "none") return {}; if (type != "decimal" && type != "decimal-leading-zero") { diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h index c80d3b09..f350ab25 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h @@ -617,6 +617,7 @@ struct node_style final { pseudo_element after; placeholder_element placeholder; details_content_element details_content; + bool details_marker_hidden{false}; }; const pseudo_element& before_pseudo() const noexcept @@ -667,6 +668,17 @@ struct node_style final { return pseudo_elements->details_content; } + bool details_marker_hidden() const noexcept + { + return pseudo_elements != nullptr && pseudo_elements->details_marker_hidden; + } + + bool& mutable_details_marker_hidden() + { + ensure_unique_pseudo_elements(); + return pseudo_elements->details_marker_hidden; + } + void clear_pseudo_elements() noexcept { pseudo_elements.reset(); diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc index 6b2f0076..b155841b 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_cascade.inc @@ -503,6 +503,12 @@ node,node.style.mutable_details_content_pseudo(),declaration); return; } + if (pseudo_kind == 10) { + css::property_result result; + css::apply_details_marker_declaration( + node,declaration,css_variables,result); + return; + } if (pseudo_kind >= 3 && pseudo_kind <= 6) { apply_scrollbar_css_declaration(node, pseudo_kind, declaration); return; @@ -734,6 +740,12 @@ node,node.style.mutable_details_content_pseudo(),declaration); return; } + if (pseudo_kind == 10) { + css::property_result result; + css::apply_details_marker_declaration( + node,declaration,css_variables,result); + return; + } if (pseudo_kind >= 3 && pseudo_kind <= 6) { apply_scrollbar_css_declaration(node, pseudo_kind, declaration); return; diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_parsing.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_parsing.inc index bb29d5fe..960e7b7b 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_parsing.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_css_parsing.inc @@ -863,8 +863,11 @@ if (pseudo_element) { const auto supported = name == "before" || name == "after" || name == "selection" || name == "placeholder" + || name == "-webkit-input-placeholder" + || name == "-moz-placeholder" || name == "highlight" || name == "details-content" + || name == "-webkit-details-marker" || name == "backdrop" || name == "-webkit-scrollbar" || name == "-webkit-scrollbar-thumb" || name == "-webkit-scrollbar-track" diff --git a/tests/NativeWeb/css_service.cpp b/tests/NativeWeb/css_service.cpp index 7b15f4f5..9a88e5f5 100644 --- a/tests/NativeWeb/css_service.cpp +++ b/tests/NativeWeb/css_service.cpp @@ -723,6 +723,7 @@ int main(int argc,char** argv) { {".base::backdrop",7},{".base::placeholder",8}, {".base::-webkit-input-placeholder",8},{".base::-moz-placeholder",8}, {".base::details-content",9}, + {".base::-webkit-details-marker",10}, {".base[data-label='::before']",0} }; for(const auto& [selector,kind]:classified_selectors) { @@ -1105,6 +1106,21 @@ int main(int argc,char** argv) { if(!details_content.present || !details_content.block_size_zero || details_content.opacity!=.4F || details_content.padding_inline_start.value!=12.0F) return 180; + auto& summary=ordered_document.create_element("summary"); + summary.style.display=webscene_native::display_mode::list_item; + if(webscene_native::list_marker_text(summary).empty()) return 194; + webscene_native::css::apply_details_marker_declaration( + summary,{"display","none",false},variable_root,pseudo_result); + if(!summary.style.details_marker_hidden() + || !webscene_native::list_marker_text(summary).empty()) return 195; + webscene_native::css::apply_details_marker_declaration( + summary,{"display","initial",false},variable_root,pseudo_result); + if(summary.style.details_marker_hidden() + || webscene_native::list_marker_text(summary).empty()) return 196; + auto& marker_miss=ordered_document.create_element("div"); + webscene_native::css::apply_details_marker_declaration( + marker_miss,{"display","none",false},variable_root,pseudo_result); + if(marker_miss.style.has_pseudo_elements()) return 197; webscene_native::css::apply_scrollbar_declaration(ordered_node,3,{"display","none",true},variable_root); webscene_native::css::apply_scrollbar_declaration(ordered_node,3,{"display","block",false},variable_root); if(!ordered_node.style.scrollbar_hidden || ordered_node.style.display==webscene_native::display_mode::none) return 131; diff --git a/tests/WebPlatformSubset/contracts/css-webkit-details-marker-display-ref.html b/tests/WebPlatformSubset/contracts/css-webkit-details-marker-display-ref.html new file mode 100644 index 00000000..ec579aba --- /dev/null +++ b/tests/WebPlatformSubset/contracts/css-webkit-details-marker-display-ref.html @@ -0,0 +1,12 @@ + + +Reference without a disclosure marker + +
+ Completed response +
Retained details content
+
diff --git a/tests/WebPlatformSubset/contracts/css-webkit-details-marker-display.html b/tests/WebPlatformSubset/contracts/css-webkit-details-marker-display.html new file mode 100644 index 00000000..c0de4d59 --- /dev/null +++ b/tests/WebPlatformSubset/contracts/css-webkit-details-marker-display.html @@ -0,0 +1,14 @@ + + +WebKit details marker display none hides the retained disclosure marker + + +
+ Completed response +
Retained details content
+
diff --git a/tests/WebPlatformSubset/webscene-component-profile.json b/tests/WebPlatformSubset/webscene-component-profile.json index 13a8cd5c..7c92e9ae 100644 --- a/tests/WebPlatformSubset/webscene-component-profile.json +++ b/tests/WebPlatformSubset/webscene-component-profile.json @@ -1381,6 +1381,13 @@ "evidence": ["css-pseudo-elements-4-placeholder", "native-retained-scene-contract", "vscode-oss-645f29c-placeholder-ledger"], "reason": "Implementation-first WebScene #237/#781 slice for standard and legacy placeholder selectors in unchanged Code OSS core CSS. The browser-shaped contract adds the Chromium-reachable ::-webkit-input-placeholder alias; the native companion covers both WebKit and Mozilla aliases with distinct colors/opacities, class recascade, live-value suppression, and empty-value restoration. All aliases reuse the standard retained paint path without layout, generated nodes, or frame demand. Direct browser/native profile execution remains validation debt; additional placeholder properties remain outside this bounded candidate." }, + { + "path": "contracts/css-webkit-details-marker-display.html", + "type": "reftest", + "capabilities": ["webkit-details-marker-display-none", "retained-summary-marker-suppression", "details-marker-layout-invalidation"], + "evidence": ["css-pseudo-elements-derived", "native-retained-list-marker-contract", "vscode-oss-645f29c-details-marker-ledger"], + "reason": "Implementation-first WebScene #783 slice for the two unchanged Code OSS Chat disclosure rules. The pseudo-hidden result matches the established list-style:none reference while reusing one retained marker representation. Native companion coverage requires initial visibility, hide/restore, classifier origin, layout equality, and a non-summary zero-allocation guard. Direct browser/native pixels, dynamic mutation, 4,096-summary performance/lifecycle, and package execution remain validation debt." + }, { "path": "contracts/css-checkbox-required-validity.html", "type": "testharness",