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

Changeset 269798 in webkit


Ignore:
Timestamp:
Nov 13, 2020, 2:17:34 PM (6 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r269384. rdar://problem/71381924

REGRESSION (r257839): Miscomputed style due to computed 'rem' value in matched declaration cache
https://bugs.webkit.org/show_bug.cgi?id=218561
<rdar://problem/70074191>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/dom/focus-rem-style-update.html

Call to focus() causes computed style update for the element’s ancestor chain before the the document
has otherwise been styled (using the shortcut mechanism introduced in r257839). This style, which uses ‘rem’
unit and so depends on root element font size, gets cached in MatchedDeclarationsCache. The root font size
then changes but during the resulting style update we use this cached value, failing to re-resolve ‘rem’.

  • style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement):

Invalidate matched declarations cache also when there is no existing document element style.

LayoutTests:

  • fast/dom/focus-rem-style-update-expected.html: Added.
  • fast/dom/focus-rem-style-update.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269384 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-610-branch
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610-branch/LayoutTests/ChangeLog

    r269795 r269798  
     12020-11-13  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r269384. rdar://problem/71381924
     4
     5    REGRESSION (r257839): Miscomputed style due to computed 'rem' value in matched declaration cache
     6    https://bugs.webkit.org/show_bug.cgi?id=218561
     7    <rdar://problem/70074191>
     8   
     9    Reviewed by Zalan Bujtas.
     10   
     11    Source/WebCore:
     12   
     13    Test: fast/dom/focus-rem-style-update.html
     14   
     15    Call to focus() causes computed style update for the element’s ancestor chain before the the document
     16    has otherwise been styled (using the shortcut mechanism introduced in r257839). This style, which uses ‘rem’
     17    unit and so depends on root element font size, gets cached in MatchedDeclarationsCache. The root font size
     18    then changes but during the resulting style update we use this cached value, failing to re-resolve ‘rem’.
     19   
     20    * style/StyleTreeResolver.cpp:
     21    (WebCore::Style::TreeResolver::resolveElement):
     22   
     23    Invalidate matched declarations cache also when there is no existing document element style.
     24   
     25    LayoutTests:
     26   
     27    * fast/dom/focus-rem-style-update-expected.html: Added.
     28    * fast/dom/focus-rem-style-update.html: Added.
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2020-11-04  Antti Koivisto  <antti@apple.com>
     33
     34            REGRESSION (r257839): Miscomputed style due to computed 'rem' value in matched declaration cache
     35            https://bugs.webkit.org/show_bug.cgi?id=218561
     36            <rdar://problem/70074191>
     37
     38            Reviewed by Zalan Bujtas.
     39
     40            * fast/dom/focus-rem-style-update-expected.html: Added.
     41            * fast/dom/focus-rem-style-update.html: Added.
     42
    1432020-11-13  Russell Epstein  <repstein@apple.com>
    244
  • branches/safari-610-branch/Source/WebCore/ChangeLog

    r269797 r269798  
     12020-11-13  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r269384. rdar://problem/71381924
     4
     5    REGRESSION (r257839): Miscomputed style due to computed 'rem' value in matched declaration cache
     6    https://bugs.webkit.org/show_bug.cgi?id=218561
     7    <rdar://problem/70074191>
     8   
     9    Reviewed by Zalan Bujtas.
     10   
     11    Source/WebCore:
     12   
     13    Test: fast/dom/focus-rem-style-update.html
     14   
     15    Call to focus() causes computed style update for the element’s ancestor chain before the the document
     16    has otherwise been styled (using the shortcut mechanism introduced in r257839). This style, which uses ‘rem’
     17    unit and so depends on root element font size, gets cached in MatchedDeclarationsCache. The root font size
     18    then changes but during the resulting style update we use this cached value, failing to re-resolve ‘rem’.
     19   
     20    * style/StyleTreeResolver.cpp:
     21    (WebCore::Style::TreeResolver::resolveElement):
     22   
     23    Invalidate matched declarations cache also when there is no existing document element style.
     24   
     25    LayoutTests:
     26   
     27    * fast/dom/focus-rem-style-update-expected.html: Added.
     28    * fast/dom/focus-rem-style-update.html: Added.
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2020-11-04  Antti Koivisto  <antti@apple.com>
     33
     34            REGRESSION (r257839): Miscomputed style due to computed 'rem' value in matched declaration cache
     35            https://bugs.webkit.org/show_bug.cgi?id=218561
     36            <rdar://problem/70074191>
     37
     38            Reviewed by Zalan Bujtas.
     39
     40            Test: fast/dom/focus-rem-style-update.html
     41
     42            Call to focus() causes computed style update for the element’s ancestor chain before the the document
     43            has otherwise been styled (using the shortcut mechanism introduced in r257839). This style, which uses ‘rem’
     44            unit and so depends on root element font size, gets cached in MatchedDeclarationsCache. The root font size
     45            then changes but during the resulting style update we use this cached value, failing to re-resolve ‘rem’.
     46
     47            * style/StyleTreeResolver.cpp:
     48            (WebCore::Style::TreeResolver::resolveElement):
     49
     50            Invalidate matched declarations cache also when there is no existing document element style.
     51
    1522020-11-13  Russell Epstein  <repstein@apple.com>
    253
  • branches/safari-610-branch/Source/WebCore/style/StyleTreeResolver.cpp

    r266880 r269798  
    225225        scope().resolver.setOverrideDocumentElementStyle(m_documentElementStyle.get());
    226226
    227         if (update.change != NoChange && existingStyle && existingStyle->computedFontPixelSize() != update.style->computedFontPixelSize()) {
     227        if (!existingStyle || existingStyle->computedFontPixelSize() != update.style->computedFontPixelSize()) {
    228228            // "rem" units are relative to the document element's font size so we need to recompute everything.
    229             // In practice this is rare.
    230229            scope().resolver.invalidateMatchedDeclarationsCache();
    231230            descendantsToResolve = DescendantsToResolve::All;
Note: See TracChangeset for help on using the changeset viewer.