[Webkit-unassigned] [Bug 238874] New: [cssom] "set a CSS declaration" is broken for deferred properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 6 10:14:39 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=238874

            Bug ID: 238874
           Summary: [cssom] "set a CSS declaration" is broken for deferred
                    properties
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: obrufau at igalia.com
        Depends on: 238350

Created attachment 456830

  --> https://bugs.webkit.org/attachment.cgi?id=456830&action=review

testcase

Run this testcase:

    <!DOCTYPE html>
    <div id="target"></div>
    <script>
    var cs = getComputedStyle(target);

    target.style.boxShadow = "0 0 0 100px blue";
    console.log(target.style.cssText); // box-shadow: blue 0px 0px 0px 100px;
    console.log(cs.boxShadow); // rgb(0, 0, 255) 0px 0px 0px 100px

    target.style.webkitBoxShadow = "0 0 0 100px red";
    console.log(target.style.cssText); // box-shadow: blue 0px 0px 0px 100px; -webkit-box-shadow: red 0px 0px 0px 100px;
    console.log(cs.boxShadow); // rgb(255, 0, 0) 0px 0px 0px 100px

    target.style.boxShadow = "0 0 0 100px green";
    console.log(target.style.cssText); // box-shadow: green 0px 0px 0px 100px; -webkit-box-shadow: red 0px 0px 0px 100px;
    console.log(cs.boxShadow); // rgb(0, 128, 0) 0px 0px 0px 100px
    </script>

Expected: green shadow.
Actual: red shadow.

box-shadow and -webkit-box-shadow are implemented as longhands that share a computed value.
During the CSS cascade, they are deferred and applied in parse order, so that the last one wins.
But CSSOM is broken, as seen above.
When you set boxShadow="0 0 0 100px green", it just updates the old value in place, without taking into account that it will be overridden by -webkit-box-shadow that appears later.

This needs the same fix that bug 226461 did for properties in a logical property group.


Referenced Bugs:

https://bugs.webkit.org/show_bug.cgi?id=238350
[Bug 238350] [css-cascade] Merge getRelatedPropertyId() and shouldApplyPropertyInParseOrder()
-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220406/334fd364/attachment.htm>


More information about the webkit-unassigned mailing list