diff --git a/docs/validation/css-details-content-static-237-235.md b/docs/validation/css-details-content-static-237-235.md new file mode 100644 index 00000000..1a3ce8e7 --- /dev/null +++ b/docs/validation/css-details-content-static-237-235.md @@ -0,0 +1,67 @@ +# Bounded details-content pseudo-element layout + +Issues: WebScene #237, parent #235 + +Base: `8a58690f8a4059affa4b3caa0ba0e4340e4c9c52` + +Unchanged Code OSS: `645f29cc3176500b4b5762ba887cf2a7f0ffdf2c` + +## Selected inventory gap + +The pinned unchanged Code OSS core CSS has ten `::details-content` selector +occurrences in the chat workbench. They style two disclosure components. The +two base selectors author `block-size: 0`, `overflow: hidden`, `opacity: 0`, +and transitions. Their `[open]` selectors author `block-size: auto` and +`opacity: 1`. One base selector also authors `box-sizing: border-box`, inline +start margin and padding, a one-pixel inline-start border, and a border-image +gradient. The remaining six selectors disable transitions for reduced motion. + +This slice gives `::details-content` an independent compiled pseudo kind and a +compact record in the existing lazy pseudo allocation. It retains the observed +static zero/auto block-size, overflow, opacity, inline-start margin/padding, +and solid border components. The observed `box-sizing: border-box` value is +recognized, but has no separate static geometry effect because closed content +is suppressed and open content uses automatic block size. Closed `
` +elements expose only their first `` element. Open content participates +in ordinary bounded retained layout with one inline inset and one retained +group bound for border and opacity paint. Inherited `dir` resolves that inset +and border at the logical inline start, including the right edge for RTL. No +anonymous DOM node or visual-tree node is added. + +Code OSS assigns `HTMLDetailsElement.open` directly. WebScene previously +exposed that reflection only for dialogs, so this slice adds the generated +details interface mirror and routes the property through the existing bounded +boolean-attribute recascade. Cancelable summary clicks toggle only when the +clicked summary is the first summary child, publish one noncancelable `toggle` +event, and synchronously invalidate the affected details subtree. +Interactive descendants such as buttons and links retain their nearer native +activation and do not also toggle the disclosure; inert descendants still +delegate activation to the first summary. + +## Lifecycle and performance + +Closing clears retained geometry, text fragments, and scroll extents only for +the disclosure content subtree. Opening reuses normal layout and compiled +`[open]` selector invalidation. Detach and navigation use existing node and +pseudo-state teardown. Static closed, open, and filled states request no idle +frames; paint performs no parsing, selector matching, cascade, polling, or DOM +mutation. + +The source contract checks pseudo classification and bounded values. The V8 +scene contract checks closed suppression, `open` reflection, inline geometry, +inherited RTL logical geometry, solid border paint, interactive-descendant +activation isolation, inert-descendant first-summary activation, exactly-once +toggle dispatch, and cleanup. The browser candidate mirrors these disclosure +semantics. + +## Explicit remainder + +This implementation does not claim interpolation between zero and the `auto` +keyword, transition timing, discrete `content-visibility` transitions, or the +`interpolate-size: allow-keywords` host property. Those require a retained +details-content animation track and deadline integration. The Code OSS +border-image linear gradient remains deferred; this slice paints the authored +solid border color underneath it. General details name-group exclusivity, +programmatic-open toggle-event task coalescing, an implicit summary when none +is authored, and non-Code pseudo properties also remain outside this bounded +slice. No Code OSS source changes. diff --git a/docs/validation/css-placeholder-pseudo-paint-237-235.md b/docs/validation/css-placeholder-pseudo-paint-237-235.md index 55667690..328d0b1f 100644 --- a/docs/validation/css-placeholder-pseudo-paint-237-235.md +++ b/docs/validation/css-placeholder-pseudo-paint-237-235.md @@ -41,8 +41,9 @@ The unchanged Code OSS core pseudo-class forms in its authored CSS are already covered by the compiled matcher; `:visited` remains deliberately privacy-closed. The remaining core pseudo-element inventory is: -- ten `::details-content` rules, which require a disclosure-content pseudo box, - open-state layout and discrete/auto-size transition behavior; +- ten `::details-content` rules. The bounded static disclosure layout is now + implemented by the follow-up details-content candidate; keyword-size and + 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 @@ -60,7 +61,7 @@ performance evidence remain outside this slice. No Code OSS source changes. 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`. -Functional `::highlight()`, `::details-content`, `::part()`, and `::slotted()` -also still require parser and ownership work. The inventory diagnostics now +Functional `::highlight()`, `::part()`, and `::slotted()` also still require +parser and ownership work. The inventory diagnostics now report the already implemented selection, backdrop, and WebKit scrollbar kinds as supported instead of grouping them with those remaining gaps. diff --git a/experiments/WebScene.NativeEngine.Probe/native/generated/webscene_dom_bindings.inc b/experiments/WebScene.NativeEngine.Probe/native/generated/webscene_dom_bindings.inc index 1021e612..81ad8228 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/generated/webscene_dom_bindings.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/generated/webscene_dom_bindings.inc @@ -1,5 +1,5 @@ // Generated by tools/webidl-v8-bindings/generate.mjs. Do not edit. -// Exposure manifest SHA-256: 2c3530c4eb08cd1b07208459fc96e105a4f770c99db794b459438af2b575602f +// Exposure manifest SHA-256: 1204c7318ba1facf6e719bab2f041278a40fa214c67205458425e0e7e2eeccd6 // Inputs: @webref/idl 3.82.1, webidl2 24.5.0. enum class generated_dom_interface : uint8_t { @@ -20,6 +20,7 @@ enum class generated_dom_interface : uint8_t { HTMLIFrameElement, HTMLTableCellElement, HTMLDialogElement, + HTMLDetailsElement, HTMLButtonElement, HTMLInputElement, HTMLTextAreaElement, @@ -128,6 +129,9 @@ static bool generated_dom_receiver_is( case generated_dom_interface::HTMLDialogElement: return !self->html_dialog_element_template.IsEmpty() && self->html_dialog_element_template.Get(isolate)->HasInstance(receiver); + case generated_dom_interface::HTMLDetailsElement: + return !self->html_details_element_template.IsEmpty() + && self->html_details_element_template.Get(isolate)->HasInstance(receiver); case generated_dom_interface::HTMLButtonElement: return !self->html_button_element_template.IsEmpty() && self->html_button_element_template.Get(isolate)->HasInstance(receiver); @@ -2271,6 +2275,29 @@ static void generated_HTMLDialogElement_returnValue_set( set_dialog_return_value(info.Data().As(), value, info); } +static void generated_HTMLDetailsElement_open_get( + v8::Local, + const v8::PropertyCallbackInfo& info) +{ + if (!generated_dom_receiver_is(info.GetIsolate(), info.Holder(), generated_dom_interface::HTMLDetailsElement)) { + throw_generated_illegal_invocation(info.GetIsolate()); + return; + } + get_dialog_open(info.Data().As(), info); +} + +static void generated_HTMLDetailsElement_open_set( + v8::Local, + v8::Local value, + const v8::PropertyCallbackInfo& info) +{ + if (!generated_dom_receiver_is(info.GetIsolate(), info.Holder(), generated_dom_interface::HTMLDetailsElement)) { + throw_generated_illegal_invocation(info.GetIsolate()); + return; + } + set_dialog_open(info.Data().As(), value, info); +} + static void generated_HTMLButtonElement_labels_get( v8::Local, const v8::PropertyCallbackInfo& info) @@ -5280,6 +5307,33 @@ void install_generated_dom_templates(v8::Local) v8::ConstructorBehavior::kThrow)); html_dialog_element_template.Reset(isolate, generated_HTMLDialogElement_template); + auto generated_HTMLDetailsElement_template = v8::FunctionTemplate::New(isolate, illegal_dom_constructor); + generated_HTMLDetailsElement_template->SetClassName(js_string(isolate, "HTMLDetailsElement")); + generated_HTMLDetailsElement_template->SetInterfaceName(js_string(isolate, "HTMLDetailsElement")); + generated_HTMLDetailsElement_template->PrototypeTemplate()->Set( + v8::Symbol::GetToStringTag(isolate), js_string(isolate, "HTMLDetailsElement"), + static_cast(v8::ReadOnly | v8::DontEnum)); + generated_HTMLDetailsElement_template->Inherit(generated_HTMLElement_template); + generated_HTMLDetailsElement_template->InstanceTemplate()->SetInternalFieldCount(2); + auto generated_HTMLDetailsElement_signature = + v8::Signature::New(isolate, generated_HTMLDetailsElement_template); + auto generated_HTMLDetailsElement_open_symbol = v8::Symbol::New( + isolate, js_string(isolate, "WebScene.HTMLDetailsElement.open")); + generated_HTMLDetailsElement_template->InstanceTemplate()->SetNativeDataProperty( + generated_HTMLDetailsElement_open_symbol, + generated_HTMLDetailsElement_open_get, + generated_HTMLDetailsElement_open_set, + js_string(isolate, "open"), + v8::PropertyAttribute::None); + generated_HTMLDetailsElement_template->PrototypeTemplate()->SetAccessorProperty( + js_string(isolate, "open"), + v8::FunctionTemplate::New( + isolate, generated_dom_prototype_attribute_get, generated_HTMLDetailsElement_open_symbol, + generated_HTMLDetailsElement_signature, 0), + v8::FunctionTemplate::New(isolate, generated_dom_prototype_attribute_set, generated_HTMLDetailsElement_open_symbol, generated_HTMLDetailsElement_signature, 1), + v8::PropertyAttribute::None); + html_details_element_template.Reset(isolate, generated_HTMLDetailsElement_template); + auto generated_HTMLButtonElement_template = v8::FunctionTemplate::New(isolate, illegal_dom_constructor); generated_HTMLButtonElement_template->SetClassName(js_string(isolate, "HTMLButtonElement")); generated_HTMLButtonElement_template->SetInterfaceName(js_string(isolate, "HTMLButtonElement")); @@ -6167,6 +6221,10 @@ void install_generated_dom_constructors( ->GetFunction(local_context).ToLocalChecked(); global->Set(local_context, js_string(isolate, "HTMLDialogElement"), generated_HTMLDialogElement_constructor).Check(); + auto generated_HTMLDetailsElement_constructor = html_details_element_template.Get(isolate) + ->GetFunction(local_context).ToLocalChecked(); + global->Set(local_context, js_string(isolate, "HTMLDetailsElement"), + generated_HTMLDetailsElement_constructor).Check(); auto generated_HTMLButtonElement_constructor = html_button_element_template.Get(isolate) ->GetFunction(local_context).ToLocalChecked(); global->Set(local_context, js_string(isolate, "HTMLButtonElement"), 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 1c99355b..9ef8f49d 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_native_cascade.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_native_cascade.h @@ -75,6 +75,13 @@ bool apply_native_cascade(native_document& document,dom_node& node, variables,result,[](bool) {}); observe(declaration,result); } + else if(kind==9) { + property_result result; + apply_details_content_declaration( + node,node.style.mutable_details_content_pseudo(),declaration, + variables,result,[](bool) {}); + 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 ea4edab4..0329c6a2 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h @@ -29,6 +29,7 @@ inline int split_pseudo_element_selector(const std::string& selector, std::strin if (const auto kind = split_suffix("::before", 1); kind != 0) return kind; if (const auto kind = split_suffix("::after", 2); 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("::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; @@ -38,6 +39,84 @@ inline int split_pseudo_element_selector(const std::string& selector, std::strin return split_suffix(":after", 2); } +template +void apply_details_content_declaration( + dom_node& node, + node_style::pseudo_element_pair::details_content_element& details_content, + const css_declaration& declaration, + const std::unordered_map& variables, + Decision& decision, + Resolved&& on_resolved) +{ + decision.classification = "unsupported"; + 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"; + decision.semantic_slice = "unresolved custom property at computed-value time"; + return; + } + on_resolved(contains_variable); + const auto lower = ascii_lower(trim_value(value)); + details_content.present = true; + if (declaration.name == "block-size") { + if (lower == "auto") { + details_content.block_size_zero = false; + decision.classification = "supported"; + } else if (lower == "0") { + details_content.block_size_zero = true; + decision.classification = "supported"; + } else { + decision.classification = "unsupported"; + decision.semantic_slice = "authored zero or auto block-size"; + } + } else if (declaration.name == "overflow") { + if (lower == "hidden") { + details_content.overflow_hidden = true; + decision.classification = "supported"; + } + } else if (declaration.name == "opacity") { + char* end = nullptr; + const auto parsed = std::strtof(lower.c_str(), &end); + if (end != lower.c_str() && end == lower.c_str() + lower.size() + && std::isfinite(parsed)) { + details_content.opacity = std::clamp(parsed, 0.0F, 1.0F); + decision.classification = "supported"; + } else { + decision.classification = "invalid-authoring"; + } + } else if (declaration.name == "margin-inline-start") { + details_content.margin_inline_start = native_document::parse_length(value); + decision.classification = "supported"; + } else if (declaration.name == "padding-inline-start") { + details_content.padding_inline_start = native_document::parse_length(value); + decision.classification = "supported"; + } else if (declaration.name == "box-sizing") { + decision.classification = lower == "border-box" || lower == "content-box" + ? "supported" : "invalid-authoring"; + decision.semantic_slice = "recognized compatibility value; collapsed static size is unchanged"; + } else if (declaration.name == "border-inline-start") { + node_style border_style{}; + border_style.foreground_rgba = node.style.foreground_rgba; + if (apply_border_declaration(border_style, "border-left", value)) { + details_content.border_inline_start_width = border_style.border_left_width; + details_content.border_inline_start_rgba = border_style.border_left_rgba; + details_content.border_inline_start_current_color = + border_style.border_left_current_color; + decision.classification = "supported"; + } else { + decision.classification = "invalid-authoring"; + } + } else if (declaration.name == "transition" + || declaration.name == "content-visibility" + || declaration.name == "border-image") { + decision.semantic_slice = "static details-content paint and layout"; + } +} + template void apply_placeholder_declaration( dom_node& node, 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 cd1cc0fe..09273236 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, 9> rules_by_kind; + std::array, 10> 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.h b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h index ddba0284..fc9595d4 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -578,9 +579,23 @@ struct node_style final { bool foreground_specified{false}; }; + struct details_content_element final { + css_length margin_inline_start{}; + css_length padding_inline_start{}; + css_length border_inline_start_width{}; + layout_rect layout{}; + float opacity{1}; + uint32_t border_inline_start_rgba{0}; + bool present{false}; + bool block_size_zero{false}; + bool overflow_hidden{false}; + bool border_inline_start_current_color{true}; + }; + pseudo_element before; pseudo_element after; placeholder_element placeholder; + details_content_element details_content; }; const pseudo_element& before_pseudo() const noexcept @@ -619,6 +634,18 @@ struct node_style final { return pseudo_elements->placeholder; } + const pseudo_element_pair::details_content_element& details_content_pseudo() const noexcept + { + static const pseudo_element_pair::details_content_element empty; + return pseudo_elements == nullptr ? empty : pseudo_elements->details_content; + } + + pseudo_element_pair::details_content_element& mutable_details_content_pseudo() + { + ensure_unique_pseudo_elements(); + return pseudo_elements->details_content; + } + void clear_pseudo_elements() noexcept { pseudo_elements.reset(); @@ -2024,6 +2051,46 @@ display_mode blockified_display(const dom_node& node) noexcept; const dom_node& css_document_element(const dom_node& node) noexcept; float document_root_font_size(const dom_node& node) noexcept; +inline const dom_node* first_details_summary(const dom_node& details) noexcept +{ + if (details.tag != "details") return nullptr; + for (const auto* child : details.children) { + if (child != nullptr && child->kind == dom_node_kind::element + && child->tag == "summary") return child; + } + return nullptr; +} + +inline bool is_details_content_child( + const dom_node& details, + const dom_node& child) noexcept +{ + return details.tag == "details" && &child != first_details_summary(details); +} + +inline bool details_content_is_suppressed(const dom_node& details) noexcept +{ + if (details.tag != "details") return false; + if (!details.attributes.contains("open")) return true; + const auto& content = details.style.details_content_pseudo(); + return content.present && content.block_size_zero && content.overflow_hidden; +} + +inline bool resolved_right_to_left(const dom_node& node) noexcept +{ + for (auto* current = &node; current != nullptr; current = current->parent) { + const auto direction = current->attributes.find("dir"); + if (direction == current->attributes.end()) continue; + auto value = direction->second; + std::transform(value.begin(), value.end(), value.begin(), [](unsigned char character) { + return static_cast(std::tolower(character)); + }); + if (value == "rtl") return true; + if (value == "ltr") return false; + } + return false; +} + class native_document final { public: // Shadow DOM state is kept entirely outside dom_node. A light-DOM-only diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_layout.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_layout.inc index 89c1b72d..8c3faa48 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_layout.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_layout.inc @@ -152,6 +152,9 @@ void native_document::layout(float viewport_width, float viewport_height) if (node.style.after_pseudo().generated) { node.style.mutable_after_pseudo().layout = {}; } + if (node.style.details_content_pseudo().present) { + node.style.mutable_details_content_pseudo().layout = {}; + } node.list_marker_layout = {}; if (const auto* state = shadow_dom(node); state != nullptr && state->root != nullptr) { @@ -203,6 +206,11 @@ void native_document::layout(float viewport_width, float viewport_height) for (auto* pseudo : {&node.style.mutable_before_pseudo(), &node.style.mutable_after_pseudo()}) { if (pseudo->generated) { pseudo->layout.x += dx; pseudo->layout.y += dy; } } + auto& details_content = node.style.mutable_details_content_pseudo(); + if (details_content.present) { + details_content.layout.x += dx; + details_content.layout.y += dy; + } } node.list_marker_layout.x += dx; node.list_marker_layout.y += dy; @@ -354,6 +362,7 @@ void native_document::layout_children(dom_node& parent) if (parent.style.has_pseudo_elements()) { parent.style.mutable_before_pseudo().layout = {}; parent.style.mutable_after_pseudo().layout = {}; + parent.style.mutable_details_content_pseudo().layout = {}; } parent.list_marker_layout = {}; if (parent.style.content_visibility_hidden) { @@ -2764,6 +2773,23 @@ void native_document::layout_children(dom_node& parent) layout_items.push_back(&*before_item); } const auto append_layout_item = [&](const auto& self, dom_node* child) -> void { + if (child != nullptr && is_details_content_child(parent, *child) + && details_content_is_suppressed(parent)) { + const auto clear_suppressed_details_content = + [&](const auto& clear, dom_node& suppressed) -> void { + suppressed.visible = false; + suppressed.layout = {}; + suppressed.text_layout_fragments.clear(); + suppressed.scroll_content_width = 0; + suppressed.scroll_content_height = 0; + for (auto* descendant : composed_children(suppressed)) { + clear(clear, *descendant); + } + }; + clear_suppressed_details_content( + clear_suppressed_details_content, *child); + return; + } if (flex_container && child != nullptr && child->style.display == display_mode::contents @@ -3721,6 +3747,33 @@ void native_document::layout_children(dom_node& parent) } } } + if (is_details_content_child(parent, *child)) { + const auto& details_content = parent.style.details_content_pseudo(); + if (details_content.present) { + const auto margin = resolve_length( + parent, + details_content.margin_inline_start, + content.width, + 0); + const auto border = resolve_length( + parent, + details_content.border_inline_start_width, + content.width, + 0); + const auto padding = resolve_length( + parent, + details_content.padding_inline_start, + content.width, + 0); + const auto inset = std::max(0.0F, margin + border + padding); + if (!resolved_right_to_left(parent)) { + assigned.x += inset; + positioned.x += inset; + } + assigned.width = std::max(0.0F, assigned.width - inset); + positioned.width = std::max(0.0F, positioned.width - inset); + } + } positioned.x -= parent.scroll_left; positioned.y -= parent.scroll_top; layout_child( @@ -3817,6 +3870,30 @@ void native_document::layout_children(dom_node& parent) } ++placed_flow_count; } + if (parent.tag == "details" && parent.style.details_content_pseudo().present) { + auto& details_content = parent.style.mutable_details_content_pseudo(); + if (!details_content_is_suppressed(parent)) { + auto content_top = std::numeric_limits::infinity(); + auto content_bottom = -std::numeric_limits::infinity(); + for (const auto* child : composed_children(parent)) { + if (child == nullptr || !child->visible + || !is_details_content_child(parent, *child)) continue; + content_top = std::min(content_top, child->layout.y); + content_bottom = std::max( + content_bottom, child->layout.y + child->layout.height); + } + if (std::isfinite(content_top) && std::isfinite(content_bottom)) { + const auto margin = resolve_length( + parent, details_content.margin_inline_start, content.width, 0); + const auto rtl = resolved_right_to_left(parent); + details_content.layout = { + content.x + (rtl ? 0.0F : margin), + content_top, + std::max(0.0F, content.width - margin), + std::max(0.0F, content_bottom - content_top)}; + } + } + } // Cross-axis alignment moves an already laid-out subtree. Generated boxes // are stored on their originating element rather than in composed_children, // so they must follow the same translation explicitly. Leaving them behind @@ -3831,6 +3908,8 @@ void native_document::layout_children(dom_node& parent) auto& after = node.style.mutable_after_pseudo(); if (before.generated) before.layout.y += offset; if (after.generated) after.layout.y += offset; + auto& details_content = node.style.mutable_details_content_pseudo(); + if (details_content.present) details_content.layout.y += offset; } if (node.list_marker_layout.width > 0 || node.list_marker_layout.height > 0) { node.list_marker_layout.y += offset; @@ -4870,7 +4949,7 @@ float native_document::compute_intrinsic_size( }; #if !defined(WEBSCENE_NATIVE_ENGINE_INTRINSIC_ITEM_COPY_CONTROL) - if (!has_inside_marker && !has_before && !has_after) { + if (!has_inside_marker && !has_before && !has_after && node.tag != "details") { #if defined(WEBSCENE_NATIVE_ENGINE_INTRINSIC_SIZE_BRANCH_BENCHMARK) ++intrinsic_size_branch_counts_for_benchmark[15]; intrinsic_size_branch_counts_for_benchmark[16] += composed_children(node).size(); @@ -4896,10 +4975,12 @@ float native_document::compute_intrinsic_size( before_item.emplace(make_pseudo_layout_node(node, node.style.before_pseudo())); intrinsic_items.push_back(&*before_item); } - intrinsic_items.insert( - intrinsic_items.end(), - composed_children(node).begin(), - composed_children(node).end()); + for (const auto* child : composed_children(node)) { + if (child == nullptr) continue; + if (is_details_content_child(node, *child) + && details_content_is_suppressed(node)) continue; + intrinsic_items.push_back(child); + } if (has_after) { after_item.emplace(make_pseudo_layout_node(node, node.style.after_pseudo())); intrinsic_items.push_back(&*after_item); diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_scene.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_scene.inc index 81dd883f..3c8d0041 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_scene.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_native_dom_scene.inc @@ -3175,6 +3175,41 @@ void native_document::append_scene( || (left.z_index == right.z_index && left.source_order < right.source_order); }); + const auto& details_content = node.style.details_content_pseudo(); + const auto paints_details_content = node.tag == "details" + && details_content.present + && !details_content_is_suppressed(node) + && details_content.layout.width > 0 + && details_content.layout.height > 0; + if (paints_details_content) { + const auto border_width = resolve_length( + node, + details_content.border_inline_start_width, + details_content.layout.width, + 0); + if (border_width > 0.0F && details_content.opacity > 0.001F) { + auto border_color = details_content.border_inline_start_current_color + ? resolved_foreground(node) + : details_content.border_inline_start_rgba; + const auto alpha = static_cast(std::clamp( + std::lround(static_cast(border_color & 0xFFU) + * details_content.opacity), + 0L, + 255L)); + border_color = (border_color & 0xFFFFFF00U) | alpha; + commands.push_back(webscene_scene_command{ + 2U, + 0U, + resolved_right_to_left(node) + ? details_content.layout.x + details_content.layout.width - border_width + : details_content.layout.x, + details_content.layout.y, + border_width, + details_content.layout.height, + with_opacity(border_color), + node.id}); + } + } for (const auto& entry : ordered_paint) { if (entry.child != nullptr) { if (pseudo_only) continue; @@ -3193,6 +3228,25 @@ void native_document::append_scene( // repainting the z-index:auto ancestors' own content. continue; } + const auto details_content_child = paints_details_content + && is_details_content_child(node, *entry.child); + if (details_content_child && details_content.opacity <= 0.001F) continue; + const auto details_opacity_group = details_content_child + && details_content.opacity < 0.999F; + if (details_opacity_group) { + commands.push_back(webscene_scene_command{ + 30U, + 0U, + entry.child->layout.x, + entry.child->layout.y, + entry.child->layout.width, + entry.child->layout.height, + static_cast(std::clamp( + std::lround(details_content.opacity * 255.0F), + 0L, + 255L)), + node.id}); + } append_scene( *entry.child, commands, @@ -3203,6 +3257,16 @@ void native_document::append_scene( true, paint_target, paint_pseudo_target, ordered_canvas, false, capture_gpu_outputs); + if (details_opacity_group) { + commands.push_back(webscene_scene_command{ + 31U, 0U, + entry.child->layout.x, + entry.child->layout.y, + entry.child->layout.width, + entry.child->layout.height, + 0U, + node.id}); + } } else if (entry.pseudo != nullptr) { if (!pseudo_only && entry.z_index > 0) continue; append_pseudo(*entry.pseudo); 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 1891e7d8..39a61118 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 @@ -55,6 +55,24 @@ }); } + void apply_details_content_css_declaration( + dom_node& node, + node_style::pseudo_element_pair::details_content_element& details_content, + const css_declaration& declaration) + { + feature_decision decision( + *this, + "css", + "details-content-property:" + declaration.name, + "pseudo-style-application"); + css::apply_details_content_declaration( + node,details_content,declaration,css_variables,decision, + [&](bool contains_variable) { + if(contains_variable && is_paint_property(declaration.name)) + record_composition("css-custom-property-to-paint",node.id); + }); + } + static std::optional first_css_url(const std::string& value) { return css::first_css_url(value); } @@ -411,6 +429,11 @@ node,node.style.mutable_placeholder_pseudo(),declaration); return; } + if (pseudo_kind == 9) { + apply_details_content_css_declaration( + node,node.style.mutable_details_content_pseudo(),declaration); + return; + } if (pseudo_kind >= 3 && pseudo_kind <= 6) { apply_scrollbar_css_declaration(node, pseudo_kind, declaration); return; @@ -631,6 +654,11 @@ node,node.style.mutable_placeholder_pseudo(),declaration); return; } + if (pseudo_kind == 9) { + apply_details_content_css_declaration( + node,node.style.mutable_details_content_pseudo(),declaration); + 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 d39e3b99..6fbb7b48 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 @@ -848,6 +848,7 @@ if (pseudo_element) { const auto supported = name == "before" || name == "after" || name == "selection" || name == "placeholder" + || name == "details-content" || name == "backdrop" || name == "-webkit-scrollbar" || name == "-webkit-scrollbar-thumb" || name == "-webkit-scrollbar-track" diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_dom_core.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_dom_core.inc index 7e37c26c..f40e10b4 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_dom_core.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_dom_core.inc @@ -2254,6 +2254,8 @@ ? html_iframe_element_template.Get(isolate) : node.tag == "dialog" ? html_dialog_element_template.Get(isolate) + : node.tag == "details" + ? html_details_element_template.Get(isolate) : node.tag == "button" ? html_button_element_template.Get(isolate) : node.tag == "input" @@ -6015,6 +6017,8 @@ static_cast(self->dispatch_form_submit( synthetic,*form,node)); } else if (!default_prevented) { + static_cast(self->apply_details_summary_click_default( + *node, synthetic)); self->queue_external_navigation(*node); } if (form_control_changed && self->is_connected(*node)) { diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_lifecycle.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_lifecycle.inc index 56f9e212..484c3eb5 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_lifecycle.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_lifecycle.inc @@ -425,6 +425,7 @@ html_iframe_element_template.Reset(); html_table_cell_element_template.Reset(); html_dialog_element_template.Reset(); + html_details_element_template.Reset(); html_button_element_template.Reset(); html_input_element_template.Reset(); html_text_area_element_template.Reset(); diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_semantics.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_semantics.inc index 4b507951..c3647a9f 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_semantics.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_semantics.inc @@ -55,6 +55,8 @@ if (node.kind == dom_node_kind::text) return "staticText"; if (document_root) return "document"; if (node.tag == "button") return "button"; + if (node.tag == "summary" && node.parent != nullptr + && first_details_summary(*node.parent) == &node) return "button"; if (node.tag == "textarea") return "textbox"; if (node.tag == "select") return semantic_attribute(node, "multiple").empty() ? "combobox" : "listbox"; @@ -900,6 +902,12 @@ const auto expanded = state("aria-expanded"); if (expanded == "true") view.states |= WEBSCENE_SEMANTIC_NODE_EXPANDED_V1; if (expanded == "false") view.states |= WEBSCENE_SEMANTIC_NODE_COLLAPSED_V1; + if (expanded.empty() && node.tag == "summary" && node.parent != nullptr + && first_details_summary(*node.parent) == &node) { + view.states |= node.parent->attributes.contains("open") + ? WEBSCENE_SEMANTIC_NODE_EXPANDED_V1 + : WEBSCENE_SEMANTIC_NODE_COLLAPSED_V1; + } if (&node == active_element && document_focused) { view.states |= WEBSCENE_SEMANTIC_NODE_FOCUSED_V1; result->focused_node_index = index; @@ -1011,6 +1019,7 @@ if(auto* form=form_owner(node);form!=nullptr && !dispatch_form_submit(synthetic,*form,&node)) return false; } else if (!default_prevented) { + if (!apply_details_summary_click_default(node, synthetic)) return false; queue_external_navigation(node); } if (form_control_changed && is_connected(node)) { diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_state.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_state.inc index 1b1cf0a3..a691a0b9 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_state.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_state.inc @@ -97,6 +97,7 @@ v8::Global html_iframe_element_template; v8::Global html_table_cell_element_template; v8::Global html_dialog_element_template; + v8::Global html_details_element_template; v8::Global html_button_element_template; v8::Global html_input_element_template; v8::Global html_text_area_element_template; diff --git a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_tasks.inc b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_tasks.inc index 4989677f..80e94d3b 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_tasks.inc +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_v8_runtime_tasks.inc @@ -1812,6 +1812,7 @@ event->Set(local_context, js_string(isolate, name), v8::Number::New(isolate, value)).Check(); }; const auto bubbles = type_view != "beforetoggle" + && type_view != "toggle" && type_view != "close" && type_view != "cancel" && type_view != "blur" @@ -1822,6 +1823,7 @@ && type_view != "pointerleave" && type_view != "scroll"; const auto cancelable = type_view != "close" + && type_view != "toggle" && type_view != "blur" && type_view != "focus" && type_view != "focusin" @@ -2443,6 +2445,8 @@ if (node->tag == "button" || node->tag == "select" || node->tag == "textarea") { return true; } + if (node->tag == "summary" && node->parent != nullptr + && first_details_summary(*node->parent) == node) return true; if (node->tag == "a") return node->attributes.contains("href"); if (node->tag != "input") return false; const auto type = node->attributes.find("type"); @@ -3501,6 +3505,45 @@ return false; } + bool apply_details_summary_click_default( + dom_node& target, + const webscene_input_event& input) + { + auto* summary = ⌖ + while (summary != nullptr && summary->tag != "summary") { + const auto owns_activation = summary->tag == "button" + || summary->tag == "input" + || summary->tag == "select" + || summary->tag == "textarea" + || summary->tag == "label" + || summary->tag == "option" + || ((summary->tag == "a" || summary->tag == "area") + && summary->attributes.contains("href")) + || ((summary->tag == "audio" || summary->tag == "video") + && summary->attributes.contains("controls")); + if (owns_activation) return true; + summary = summary->parent; + } + if (summary == nullptr || summary->parent == nullptr + || summary->parent->tag != "details" + || first_details_summary(*summary->parent) != summary) return true; + auto& details = *summary->parent; + if (!is_connected(details)) return true; + const auto old_value = details.attributes.contains("open") + ? std::optional{details.attributes.at("open")} + : std::optional{}; + if (old_value.has_value()) details.attributes.erase("open"); + else details.attributes["open"] = {}; + const auto new_value = details.attributes.contains("open") + ? std::optional{details.attributes.at("open")} + : std::optional{}; + recascade_attribute_selector_transition( + details, "open", old_value, new_value); + document.mark_dirty(); + return dispatch_input_event_type( + input, "toggle", details, nullptr, nullptr, false); + } + dom_node* label_control_for_click(dom_node& target) { if (is_labelable_control(target)) return ⌖ @@ -4233,6 +4276,11 @@ return false; } } + if (!click_default_prevented + && !apply_details_summary_click_default(*click_target, input)) { + last_error = "Native details summary activation failed"; + return false; + } auto activation_flags = uint32_t{0U}; const auto new_context_modifier = (input.flags & (WEBSCENE_INPUT_POINTER_MODIFIER_CONTROL diff --git a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_css_layout_tests.inc b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_css_layout_tests.inc index e92ad6d0..a49631b9 100644 --- a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_css_layout_tests.inc +++ b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_css_layout_tests.inc @@ -91,6 +91,92 @@ void test_placeholder_pseudo_color_and_opacity_reach_scene(webscene_engine* engi execute(engine,"document.body.innerHTML='';","placeholder-pseudo-cleanup.js"); } +void test_details_content_pseudo_static_open_close_layout(webscene_engine* engine) +{ + resize(engine,420,220,1); + execute(engine,R"JS( + document.body.innerHTML=` + +
+
+ + Completed response + + +
Retained details content
+
+
`; + globalThis.detailsDirection=document.getElementById('details-direction'); + globalThis.detailsProbe=document.getElementById('details-probe'); + globalThis.detailsSummary=document.getElementById('details-summary'); + globalThis.detailsSummaryLabel=document.getElementById('details-summary-label'); + globalThis.detailsSummaryAction=document.getElementById('details-summary-action'); + globalThis.detailsBody=document.getElementById('details-body'); + if (!(detailsProbe instanceof HTMLDetailsElement)) + throw new Error('details wrapper type missing'); + if (detailsProbe.open || detailsBody.getBoundingClientRect().height !== 0) + throw new Error('closed details content remained laid out'); + detailsProbe.open=true; + const host=detailsProbe.getBoundingClientRect(); + const body=detailsBody.getBoundingClientRect(); + if (!detailsProbe.hasAttribute('open') || body.height !== 30 + || Math.abs(body.x-host.x-19)>0.01) + throw new Error('open details content did not use retained pseudo inset'); + globalThis.detailsToggleCount=0; + detailsProbe.addEventListener('toggle',()=>++detailsToggleCount); + detailsSummaryAction.click(); + if (!detailsProbe.open || detailsToggleCount !== 0) + throw new Error('interactive summary descendant did not retain activation'); + detailsDirection.setAttribute('dir','rtl'); + const rtlHost=detailsProbe.getBoundingClientRect(); + const rtlBody=detailsBody.getBoundingClientRect(); + if (Math.abs((rtlHost.x+rtlHost.width) + -(rtlBody.x+rtlBody.width)-19)>0.01) + throw new Error('rtl details content did not use logical inline-start inset'); + detailsSummaryLabel.click(); + if (detailsProbe.open || detailsToggleCount !== 1 + || detailsBody.getBoundingClientRect().height !== 0) + throw new Error('inert summary descendant did not close details exactly once'); + detailsProbe.open=true; + )JS","details-content-static.js"); + webscene_engine_request_scene_checkpoint(engine); + bool found_border=false; + for(int attempt=0;attempt<100 && !found_border;++attempt) { + const auto* scene=webscene_engine_acquire_latest_scene(engine); + if(scene) { + for(uint32_t i=0;iheader.command_count;++i) { + const auto& command=scene->commands[i]; + if(command.kind==2U && command.rgba==0x2468ACFFU + && std::abs(command.width-1.0F)<0.01F + && command.x>200.0F) { + found_border=true; + break; + } + } + webscene_scene_acknowledge(scene);webscene_scene_release(scene); + } + if(!found_border)std::this_thread::sleep_for(std::chrono::milliseconds(2)); + } + if(!found_border)fail("details-content retained border paint missing"); + execute(engine,"document.body.innerHTML='';","details-content-cleanup.js"); +} + void test_responsive_positioned_sizing(webscene_engine* engine) { resize(engine, 1280, 720, 1); diff --git a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp index 570c75b1..f9fe48e8 100644 --- a/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp +++ b/experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_tests.cpp @@ -376,6 +376,12 @@ int main() test_placeholder_pseudo_color_and_opacity_reach_scene(focused_engine); webscene_engine_destroy(focused_engine);return 0; } + if(selected=="details-content-pseudo") { + auto* focused_engine=webscene_engine_create(0); + require(focused_engine!=nullptr,"details-content pseudo engine creation failed"); + test_details_content_pseudo_static_open_close_layout(focused_engine); + webscene_engine_destroy(focused_engine);return 0; + } if (selected == "fragment-attach") { auto* focused_engine = webscene_engine_create(0); require(focused_engine != nullptr, "fragment attach engine creation failed"); @@ -1368,6 +1374,7 @@ int main() test_geometry_variable_positions(engine); test_modal_backdrop_scene(engine); test_placeholder_pseudo_color_and_opacity_reach_scene(engine); + test_details_content_pseudo_static_open_close_layout(engine); test_responsive_positioned_sizing(engine); test_compact_go_to_fixed_grid_tracks_preserve_trailing_space(engine); test_named_grid_template_areas_layout_cssom_and_mutation(engine); diff --git a/tests/NativeWeb/css_service.cpp b/tests/NativeWeb/css_service.cpp index 1e42084e..ad14ed27 100644 --- a/tests/NativeWeb/css_service.cpp +++ b/tests/NativeWeb/css_service.cpp @@ -715,6 +715,7 @@ int main(int argc,char** argv) { {".base::-webkit-scrollbar",3},{".base::-webkit-scrollbar-thumb",4}, {".base::-webkit-scrollbar-track",5},{".base::-webkit-scrollbar-corner",6}, {".base::backdrop",7},{".base::placeholder",8}, + {".base::details-content",9}, {".base[data-label='::before']",0} }; for(const auto& [selector,kind]:classified_selectors) { @@ -1083,6 +1084,20 @@ int main(int argc,char** argv) { if(!placeholder.foreground_specified || placeholder.foreground_rgba!=0xFF0000FF || placeholder.opacity!=.5F) return 179; + auto& details_content=ordered_node.style.mutable_details_content_pseudo(); + webscene_native::css::apply_details_content_declaration( + ordered_node,details_content,{"block-size","0",false}, + variable_root,pseudo_result,[](bool) {}); + webscene_native::css::apply_details_content_declaration( + ordered_node,details_content,{"opacity",".4",false}, + variable_root,pseudo_result,[](bool) {}); + webscene_native::css::apply_details_content_declaration( + ordered_node,details_content,{"padding-inline-start","var(--space)",false}, + std::unordered_map{{"--space","12px"}}, + pseudo_result,[](bool) {}); + if(!details_content.present || !details_content.block_size_zero + || details_content.opacity!=.4F + || details_content.padding_inline_start.value!=12.0F) return 180; 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/capabilities.json b/tests/WebPlatformSubset/capabilities.json index 4cb9cb4c..f0eb8265 100644 --- a/tests/WebPlatformSubset/capabilities.json +++ b/tests/WebPlatformSubset/capabilities.json @@ -232,6 +232,14 @@ "coverage": ["contracts/css-placeholder-pseudo-paint.html", "test_placeholder_pseudo_color_and_opacity_reach_scene", "V8-free shared CSS pseudo classification/application contract"], "gap": "Implementation-first candidate for WebScene #237. The standard pseudo stores only the color and opacity used by the twelve unchanged Code OSS core rules in lazy copy-on-write pseudo state, resolves custom properties during cascade, and changes retained placeholder text paint without generating a box, changing layout, scanning, polling, or requesting frames. Direct browser/native profile execution, additional placeholder properties, legacy vendor aliases, internal form-control parts, and broader pseudo-element qualification remain open." }, + { + "family": "details-content-static-layout", + "required": [], + "candidate": ["::details-content classification", "closed-content suppression", "HTMLDetailsElement.open reflection", "first-summary activation with interactive-descendant isolation", "static zero/auto block-size", "opacity", "inherited-direction inline-start inset and border"], + "productEvidence": ["unchanged Code OSS completed-response disclosure", "unchanged Code OSS checkpoint file-changes disclosure"], + "coverage": ["contracts/css-details-content-static.html", "test_details_content_pseudo_static_open_close_layout", "V8-free shared CSS pseudo classification/application contract"], + "gap": "Implementation-first candidate for WebScene #237. The ten unchanged Code OSS selectors reduce to static closed/open layout and paint plus reduced-motion transition overrides. The candidate retains only the observed static components and details activation lifecycle without anonymous DOM nodes, scans, polling, or idle frames. Keyword-size interpolation, transition timing, discrete content-visibility transitions, the border-image gradient, implicit summaries, name-group exclusivity, and programmatic-open toggle task coalescing remain open." + }, { "family": "list-formatting", "required": ["list-item marker paint", "ordered counters", "outside marker geometry", "inside marker first-line participation", "marker-before-block-child anonymous line"], diff --git a/tests/WebPlatformSubset/contracts/css-details-content-static.html b/tests/WebPlatformSubset/contracts/css-details-content-static.html new file mode 100644 index 00000000..3cadef14 --- /dev/null +++ b/tests/WebPlatformSubset/contracts/css-details-content-static.html @@ -0,0 +1,75 @@ + + +Details content pseudo-element retains bounded static disclosure layout + + + +
+
+ + Completed response + + +
Retained details content
+
+
+ diff --git a/tests/WebPlatformSubset/webscene-component-profile.json b/tests/WebPlatformSubset/webscene-component-profile.json index b7a013de..a5e28b06 100644 --- a/tests/WebPlatformSubset/webscene-component-profile.json +++ b/tests/WebPlatformSubset/webscene-component-profile.json @@ -1310,6 +1310,13 @@ } ], "candidate": [ + { + "path": "contracts/css-details-content-static.html", + "type": "testharness", + "capabilities": ["details-content-pseudo-classification", "details-closed-content-suppression", "details-open-reflection", "details-summary-activation-isolation", "details-content-logical-static-inset-paint"], + "evidence": ["css-pseudo-elements-4-details-content", "html-details-disclosure-state", "native-retained-layout-scene-contract", "vscode-oss-645f29c-details-content-ledger"], + "reason": "Implementation-first WebScene #237 slice for the ten ::details-content selectors in unchanged Code OSS core CSS. Native companion coverage requires closed content suppression, open-property reflection, first-summary activation with interactive-descendant isolation, static zero/auto layout, inherited-direction logical inline-start geometry, opacity and border paint, and cleanup without transition or idle frame demand. Direct browser/native profile execution remains validation debt; keyword-size transitions, discrete content visibility, and border-image gradient paint remain outside this candidate." + }, { "path": "contracts/css-placeholder-pseudo-paint.html", "type": "testharness", diff --git a/tools/webidl-v8-bindings/dom-exposure.json b/tools/webidl-v8-bindings/dom-exposure.json index 1808ca5c..1e5e5ef2 100644 --- a/tools/webidl-v8-bindings/dom-exposure.json +++ b/tools/webidl-v8-bindings/dom-exposure.json @@ -402,6 +402,17 @@ ], "constants": [] }, + { + "name": "HTMLDetailsElement", + "template": "html_details_element_template", + "constructor": "illegal_dom_constructor", + "parent": "HTMLElement", + "attributes": [ + { "name": "open", "getter": "get_dialog_open", "setter": "set_dialog_open" } + ], + "methods": [], + "constants": [] + }, { "name": "HTMLButtonElement", "template": "html_button_element_template",