⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245664 in webkit


Ignore:
Timestamp:
May 22, 2019, 5:43:09 PM (7 years ago)
Author:
Antti Koivisto
Message:

Subselectors not searched when determining property whitelist for selector
https://bugs.webkit.org/show_bug.cgi?id=198147
<rdar://problem/50405208>

Reviewed by Zalan Bujtas.

Source/WebCore:

This can cause marker elements get style they shouldn't.

Test: fast/lists/marker-style-subselector-whitelist.html

  • css/RuleSet.cpp:

(WebCore::determinePropertyWhitelistType):

Check subselectors too.

LayoutTests:

  • fast/lists/marker-style-subselector-whitelist-expected.txt: Added.
  • fast/lists/marker-style-subselector-whitelist.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245663 r245664  
     12019-05-22  Antti Koivisto  <antti@apple.com>
     2
     3        Subselectors not searched when determining property whitelist for selector
     4        https://bugs.webkit.org/show_bug.cgi?id=198147
     5        <rdar://problem/50405208>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * fast/lists/marker-style-subselector-whitelist-expected.txt: Added.
     10        * fast/lists/marker-style-subselector-whitelist.html: Added.
     11
    1122019-05-22  Wenson Hsieh  <wenson_hsieh@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r245662 r245664  
     12019-05-22  Antti Koivisto  <antti@apple.com>
     2
     3        Subselectors not searched when determining property whitelist for selector
     4        https://bugs.webkit.org/show_bug.cgi?id=198147
     5        <rdar://problem/50405208>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        This can cause marker elements get style they shouldn't.
     10
     11        Test: fast/lists/marker-style-subselector-whitelist.html
     12
     13        * css/RuleSet.cpp:
     14        (WebCore::determinePropertyWhitelistType):
     15
     16        Check subselectors too.
     17
    1182019-05-22  Saam barati  <sbarati@apple.com>
    219
  • trunk/Source/WebCore/css/RuleSet.cpp

    r235652 r245664  
    145145        if (component->match() == CSSSelector::PseudoElement && component->pseudoElementType() == CSSSelector::PseudoElementMarker)
    146146            return PropertyWhitelistMarker;
     147
     148        if (const auto* selectorList = selector->selectorList()) {
     149            for (const auto* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
     150                auto whitelistType = determinePropertyWhitelistType(subSelector);
     151                if (whitelistType != PropertyWhitelistNone)
     152                    return whitelistType;
     153            }
     154        }
    147155    }
    148156    return PropertyWhitelistNone;
Note: See TracChangeset for help on using the changeset viewer.