Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/validation/css-placeholder-aliases-781.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 7 additions & 2 deletions docs/validation/css-placeholder-pseudo-paint-237-235.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
</style>
<input id="placeholder-probe" placeholder="Search workspace">
`;
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions tests/NativeWeb/css_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@
color: rgb(17, 34, 51);
opacity: 1;
}
#webkit-probe::-webkit-input-placeholder {
color: rgb(136, 68, 34);
opacity: .75;
}
</style>
<input id="probe" placeholder="Search workspace">
<textarea id="webkit-probe" placeholder="Describe the task"></textarea>
<script>
const probe = document.getElementById('probe');
const webkitProbe = document.getElementById('webkit-probe');
const placeholderStyle = () => getComputedStyle(probe, '::placeholder');

test(() => {
Expand All @@ -38,4 +44,10 @@
probe.value = '';
assert_equals(placeholderStyle().opacity, '0.5');
}, 'live values suppress placeholder paint without destroying its computed style');

test(() => {
const style = getComputedStyle(webkitProbe, '::placeholder');
assert_equals(style.color, 'rgb(136, 68, 34)');
assert_equals(style.opacity, '0.75');
}, 'the legacy WebKit input placeholder selector shares standard computed placeholder paint');
</script>
4 changes: 2 additions & 2 deletions tests/WebPlatformSubset/webscene-component-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading