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

Changeset 271367 in webkit


Ignore:
Timestamp:
Jan 11, 2021, 10:12:19 AM (6 years ago)
Author:
Antti Koivisto
Message:

REGRESSION (r258321): CSS rules using :first-of-type are applied to any/all siblings in a group under certain circumstances
​https://bugs.webkit.org/show_bug.cgi?id=218256
<rdar://problem/70749584>

Reviewed by Simon Fraser.

Source/WebCore:

More accurate invalidation for :hover resulted in smaller style updates that revealed a bug in the way we
mark style non-shareable. We reset style relation bits when resolving the parent but may fail to set them again if we
don't re-resolve all children.

Test case by Eben Packwood.

Test: fast/css/positional-selector-style-sharing.html

  • style/StyleRelations.cpp:

(WebCore::Style::commitRelationsToRenderStyle):

Just mark all styles affected by relations non-shareable. This is achieved via various bit tests but there
is no reason not to set the simplest no-sharing bit. Since this forces real style resolution the parent
bits will also get properly reset.

LayoutTests:

  • fast/css/positional-selector-style-sharing-expected.html: Added.
  • fast/css/positional-selector-style-sharing.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r271362 r271367  
     12021-01-11  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r258321): CSS rules using :first-of-type are applied to any/all siblings in a group under certain circumstances
     4        https://bugs.webkit.org/show_bug.cgi?id=218256
     5        <rdar://problem/70749584>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/css/positional-selector-style-sharing-expected.html: Added.
     10        * fast/css/positional-selector-style-sharing.html: Added.
     11
    1122021-01-11  Sam Weinig  <weinig@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r271364 r271367  
     12021-01-11  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r258321): CSS rules using :first-of-type are applied to any/all siblings in a group under certain circumstances
     4        https://bugs.webkit.org/show_bug.cgi?id=218256
     5        <rdar://problem/70749584>
     6
     7        Reviewed by Simon Fraser.
     8
     9        More accurate invalidation for :hover resulted in smaller style updates that revealed a bug in the way we
     10        mark style non-shareable. We reset style relation bits when resolving the parent but may fail to set them again if we
     11        don't re-resolve all children.
     12
     13        Test case by Eben Packwood.
     14
     15        Test: fast/css/positional-selector-style-sharing.html
     16
     17        * style/StyleRelations.cpp:
     18        (WebCore::Style::commitRelationsToRenderStyle):
     19
     20        Just mark all styles affected by relations non-shareable. This is achieved via various bit tests but there
     21        is no reason not to set the simplest no-sharing bit. Since this forces real style resolution the parent
     22        bits will also get properly reset.
     23
    1242021-01-11  Antti Koivisto  <antti@apple.com>
    225
  • trunk/Source/WebCore/style/StyleRelations.cpp

    r258416 r271367  
    3737std::unique_ptr<Relations> commitRelationsToRenderStyle(RenderStyle& style, const Element& element, const Relations& relations)
    3838{
     39    if (!relations.isEmpty())
     40        style.setUnique();
     41
    3942    std::unique_ptr<Relations> remainingRelations;
    4043
    … …  
    6265            break;
    6366        case Relation::Unique:
    64             style.setUnique();
    6567            break;
    6668        case Relation::AffectedByPreviousSibling:
Note: See TracChangeset for help on using the changeset viewer.