mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
When a shorthand like `background` containing `var()` is used in a `::selection` rule, the shorthand was filtered out by the pseudo- element property whitelist before variable resolution could occur. This left PendingSubstitutionStyleValue longhands unresolved, causing either a crash or incorrect computed values. Allow unresolved shorthands to bypass the pseudo-element filter so variable resolution can proceed. After resolution and expansion into longhands, filter out any that the pseudo-element does not support. Fixes #8625. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
423 B
HTML
19 lines
423 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
:root {
|
|
--selection-bg: lightblue;
|
|
}
|
|
::selection {
|
|
background: var(--selection-bg);
|
|
}
|
|
</style>
|
|
<p id="target">Select me</p>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const target = document.getElementById("target");
|
|
const style = getComputedStyle(target, "::selection");
|
|
println(style.backgroundColor);
|
|
});
|
|
</script>
|