Changeset 288303 in webkit


Ignore:
Timestamp:
Jan 20, 2022 10:09:17 AM (6 months ago)
Author:
Antti Koivisto
Message:

[:has pseudo-class] Support :has(:not(foo))
https://bugs.webkit.org/show_bug.cgi?id=235399

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

  • web-platform-tests/css/selectors/invalidation/has-with-not-expected.txt: Added.
  • web-platform-tests/css/selectors/invalidation/has-with-not.html: Added.

Source/WebCore:

This already works except for a filter bug.

Test: imported/w3c/web-platform-tests/css/selectors/invalidation/has-with-not.html

  • style/HasSelectorFilter.h:

(WebCore::Style::HasSelectorFilter::reject const):

We shouldn't reject a selector if we have a null key.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r288264 r288303  
     12022-01-20  Antti Koivisto  <antti@apple.com>
     2
     3        [:has pseudo-class] Support :has(:not(foo))
     4        https://bugs.webkit.org/show_bug.cgi?id=235399
     5
     6        Reviewed by Darin Adler.
     7
     8        * web-platform-tests/css/selectors/invalidation/has-with-not-expected.txt: Added.
     9        * web-platform-tests/css/selectors/invalidation/has-with-not.html: Added.
     10
    1112022-01-19  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r288302 r288303  
     12022-01-20  Antti Koivisto  <antti@apple.com>
     2
     3        [:has pseudo-class] Support :has(:not(foo))
     4        https://bugs.webkit.org/show_bug.cgi?id=235399
     5
     6        Reviewed by Darin Adler.
     7
     8        This already works except for a filter bug.
     9
     10        Test: imported/w3c/web-platform-tests/css/selectors/invalidation/has-with-not.html
     11
     12        * style/HasSelectorFilter.h:
     13        (WebCore::Style::HasSelectorFilter::reject const):
     14
     15        We shouldn't reject a selector if we have a null key.
     16
    1172022-01-20  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/style/HasSelectorFilter.h

    r287153 r288303  
    4949
    5050    bool reject(const CSSSelector& hasSelector) const { return reject(makeKey(hasSelector)); }
    51     bool reject(Key key) const { return !m_filter.mayContain(key); }
    52 
     51    bool reject(Key key) const { return key && !m_filter.mayContain(key); }
    5352
    5453private:
Note: See TracChangeset for help on using the changeset viewer.