Bug 157789 - Cascading order for !important properties in ::slotted and ::host rules is incorrect
Summary: Cascading order for !important properties in ::slotted and ::host rules is in...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 148695
  Show dependency treegraph
 
Reported: 2016-05-17 02:58 PDT by Antti Koivisto
Modified: 2016-05-18 02:00 PDT (History)
3 users (show)

See Also:


Attachments
patch (32.36 KB, patch)
2016-05-17 03:22 PDT, Antti Koivisto
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (1.19 MB, application/zip)
2016-05-17 04:26 PDT, Build Bot
no flags Details
patch (34.07 KB, patch)
2016-05-17 07:13 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (34.09 KB, patch)
2016-05-17 07:47 PDT, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2016-05-17 02:58:23 PDT
https://drafts.csswg.org/css-scoping-1/#shadow-cascading

"When comparing two declarations that have different tree contexts, then for normal rules the declaration earlier in the shadow-including tree order wins, and for important rules the declaration coming later in the shadow-including tree order wins."
Comment 1 Radar WebKit Bug Importer 2016-05-17 02:59:04 PDT
<rdar://problem/26318781>
Comment 2 Antti Koivisto 2016-05-17 03:22:14 PDT
Created attachment 279109 [details]
patch
Comment 3 Build Bot 2016-05-17 04:26:49 PDT
Comment on attachment 279109 [details]
patch

Attachment 279109 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1335960

Number of test failures exceeded the failure limit.
Comment 4 Build Bot 2016-05-17 04:26:52 PDT
Created attachment 279111 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Antti Koivisto 2016-05-17 07:13:23 PDT
Created attachment 279118 [details]
patch
Comment 6 Antti Koivisto 2016-05-17 07:47:31 PDT
Created attachment 279122 [details]
patch
Comment 7 Andreas Kling 2016-05-17 12:31:32 PDT
Comment on attachment 279122 [details]
patch

r=me
Comment 8 Ryosuke Niwa 2016-05-17 12:32:49 PDT
Comment on attachment 279122 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=279122&action=review

> Source/WebCore/css/StyleResolver.cpp:2414
> +static bool hasImportantProperties(const StyleProperties& properties)
> +{
> +    for (unsigned i = 0, count = properties.propertyCount(); i < count; ++i) {
> +        if (properties.propertyAt(i).isImportant())
> +            return true;
> +    }
> +    return false;
> +}

It seems a bit inefficient to call propertyAt just to find an important property.
Can we add a new helper method on StyleProperty instead?
Comment 9 Antti Koivisto 2016-05-18 02:00:39 PDT
https://trac.webkit.org/r201073