diff --git a/docs/validation/css-placeholder-aliases-781.md b/docs/validation/css-placeholder-aliases-781.md new file mode 100644 index 00000000..0da0ebd3 --- /dev/null +++ b/docs/validation/css-placeholder-aliases-781.md @@ -0,0 +1,29 @@ +# Legacy placeholder selector aliases + +Issues: WebScene #781, #237, and #235 + +Pinned unchanged Code OSS `645f29cc3176500b4b5762ba887cf2a7f0ffdf2c` +authors two `::-webkit-input-placeholder` selectors and two +`::-moz-placeholder` selectors in addition to its standard `::placeholder` +rules. WebScene previously compiled those full selectors as ordinary element +selectors and therefore dropped their declarations before pseudo cascade. + +Both legacy suffixes now classify as the existing placeholder pseudo kind. +Their origin is compiled once through the normal selector cache and uses the +same dependency invalidation plan as `::placeholder`. Matching declarations +flow through the existing bounded color/opacity cascade and copy-on-write +placeholder record. Paint still occurs only for an eligible empty input or +textarea that already produces placeholder text. + +The shared CSS source contract covers classification, origin compilation, and +interned payload identity for both aliases. The native V8 source contract +switches one retained input between standard, WebKit, and Mozilla rules, checks +their distinct premultiplied colors, suppresses paint for a nonempty live +value, restores the standard rule, and tears the document down. + +This change adds no generated box, visual-tree node, layout branch, timer, +animation-frame demand, document scan, or persistent state field. The aliases +reuse the standard placeholder hot path. The authored tests were not executed +under the current implementation-throughput direction; browser pixels, +high-count allocation/performance evidence, and exact-package Code OSS +qualification remain zero until run. diff --git a/docs/validation/css-placeholder-pseudo-paint-237-235.md b/docs/validation/css-placeholder-pseudo-paint-237-235.md index 328d0b1f..f82060c0 100644 --- a/docs/validation/css-placeholder-pseudo-paint-237-235.md +++ b/docs/validation/css-placeholder-pseudo-paint-237-235.md @@ -52,8 +52,13 @@ The remaining core pseudo-element inventory is: native control-part ownership before their declarations can have an observable effect. -The two legacy WebKit/Mozilla placeholder aliases duplicate adjacent standard -rules and remain unclaimed. Extension-bundled CSS additionally uses named +The two legacy WebKit/Mozilla placeholder aliases now classify to the same +bounded pseudo kind and reuse the standard placeholder cascade, retained state, +invalidation, and paint path. The shared classifier contract covers both +aliases, while the native V8 scene contract covers their distinct color and +opacity declarations, live-value suppression, and restoration. They add no +generated box, visual-tree node, frame demand, or per-node state beyond the +existing placeholder record. Extension-bundled CSS additionally uses named 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. 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 691d0075..83c15e00 100644 --- a/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h +++ b/experiments/WebScene.NativeEngine.Probe/native/webscene_css_pseudo_application.h @@ -28,6 +28,12 @@ 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; + // Preserve the legacy aliases still authored by unchanged desktop web + // applications. They intentionally share the standard placeholder + // kind so cascade, invalidation, retained state and paint stay on one + // implementation path. + if (const auto kind = split_suffix("::-webkit-input-placeholder", 8); kind != 0) return kind; + 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("::backdrop", 7); kind != 0) return kind; 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 35db4601..565c6b36 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 @@ -51,6 +51,14 @@ void test_placeholder_pseudo_color_and_opacity_reach_scene(webscene_engine* engi color:#112233; opacity:1; } + #placeholder-probe.webkit::-webkit-input-placeholder { + color:#884422; + opacity:.75; + } + #placeholder-probe.mozilla::-moz-placeholder { + color:#226644; + opacity:.25; + } `; @@ -82,8 +90,12 @@ void test_placeholder_pseudo_color_and_opacity_reach_scene(webscene_engine* engi expect_color(0x2468AC80U,true); execute(engine,"placeholderProbe.className='alternate';","placeholder-pseudo-class.js"); expect_color(0x112233FFU,true); + execute(engine,"placeholderProbe.className='webkit';","placeholder-pseudo-webkit-alias.js"); + expect_color(0x884422BFU,true); + execute(engine,"placeholderProbe.className='mozilla';","placeholder-pseudo-mozilla-alias.js"); + expect_color(0x22664440U,true); execute(engine,"placeholderProbe.value='typed';","placeholder-pseudo-value.js"); - expect_color(0x112233FFU,false); + expect_color(0x22664440U,false); execute(engine, "placeholderProbe.value='';placeholderProbe.className='';", "placeholder-pseudo-restore.js"); diff --git a/tests/NativeWeb/css_service.cpp b/tests/NativeWeb/css_service.cpp index bb68ef6e..7b15f4f5 100644 --- a/tests/NativeWeb/css_service.cpp +++ b/tests/NativeWeb/css_service.cpp @@ -721,6 +721,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::-webkit-input-placeholder",8},{".base::-moz-placeholder",8}, {".base::details-content",9}, {".base[data-label='::before']",0} }; diff --git a/tests/WebPlatformSubset/contracts/css-placeholder-pseudo-paint.html b/tests/WebPlatformSubset/contracts/css-placeholder-pseudo-paint.html index 0a3f469d..39452384 100644 --- a/tests/WebPlatformSubset/contracts/css-placeholder-pseudo-paint.html +++ b/tests/WebPlatformSubset/contracts/css-placeholder-pseudo-paint.html @@ -13,10 +13,16 @@ color: rgb(17, 34, 51); opacity: 1; } + #webkit-probe::-webkit-input-placeholder { + color: rgb(136, 68, 34); + opacity: .75; + } + diff --git a/tests/WebPlatformSubset/webscene-component-profile.json b/tests/WebPlatformSubset/webscene-component-profile.json index 9c7dacbe..13a8cd5c 100644 --- a/tests/WebPlatformSubset/webscene-component-profile.json +++ b/tests/WebPlatformSubset/webscene-component-profile.json @@ -1377,9 +1377,9 @@ { "path": "contracts/css-placeholder-pseudo-paint.html", "type": "testharness", - "capabilities": ["placeholder-pseudo-color", "placeholder-pseudo-opacity", "placeholder-pseudo-mutation", "placeholder-value-suppression"], + "capabilities": ["placeholder-pseudo-color", "placeholder-pseudo-opacity", "placeholder-pseudo-mutation", "placeholder-value-suppression", "webkit-input-placeholder-alias", "moz-placeholder-alias"], "evidence": ["css-pseudo-elements-4-placeholder", "native-retained-scene-contract", "vscode-oss-645f29c-placeholder-ledger"], - "reason": "Implementation-first WebScene #237 slice for the twelve standard ::placeholder selectors in unchanged Code OSS core CSS. Native companion coverage requires custom-property color and fractional opacity to reach retained text paint, class mutation to recascade, live values to suppress placeholder paint, and empty-value restoration without layout or frame demand. Direct browser/native profile execution remains validation debt; additional placeholder properties and vendor aliases remain outside this bounded candidate." + "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-checkbox-required-validity.html",