mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-04 08:01:51 +00:00
Before this change, we were cascading custom properties for each layer, and then replacing any previously cascaded properties for the element with only the set from this latest layer. The patch fixes the issue by making each pass of the custom property cascade add to the same set, and then finally assigning that set of properties to the element.
23 lines
616 B
HTML
23 lines
616 B
HTML
<style>
|
|
:root { --top: 1px; }
|
|
@layer foo { :root { --left: 2px; } }
|
|
@layer bar { :root { --bottom: 3px; } }
|
|
@layer baz { :root { --right: 4px; } }
|
|
#testDiv {
|
|
padding-top: var(--top, 0);
|
|
padding-left: var(--left, 0);
|
|
padding-bottom: var(--bottom, 0);
|
|
padding-right: var(--right, 0);
|
|
}
|
|
</style><div id="testDiv"></div>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const s = getComputedStyle(testDiv);
|
|
println(s.paddingTop);
|
|
println(s.paddingLeft);
|
|
println(s.paddingBottom);
|
|
println(s.paddingRight);
|
|
testDiv.remove();
|
|
});
|
|
</script>
|