Title: [269798] branches/safari-610-branch
- Revision
- 269798
- Author
- [email protected]
- Date
- 2020-11-13 14:17:34 -0800 (Fri, 13 Nov 2020)
Log 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
Modified Paths
Added Paths
Diff
Modified: branches/safari-610-branch/LayoutTests/ChangeLog (269797 => 269798)
--- branches/safari-610-branch/LayoutTests/ChangeLog 2020-11-13 22:17:17 UTC (rev 269797)
+++ branches/safari-610-branch/LayoutTests/ChangeLog 2020-11-13 22:17:34 UTC (rev 269798)
@@ -1,5 +1,47 @@
2020-11-13 Russell Epstein <[email protected]>
+ 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
+
+ 2020-11-04 Antti Koivisto <[email protected]>
+
+ 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.
+
+ * fast/dom/focus-rem-style-update-expected.html: Added.
+ * fast/dom/focus-rem-style-update.html: Added.
+
+2020-11-13 Russell Epstein <[email protected]>
+
Cherry-pick r269121. rdar://problem/71381839
[MSE] Handle trackId changing across Initialization Segments
Added: branches/safari-610-branch/LayoutTests/fast/dom/focus-rem-style-update-expected.html (0 => 269798)
--- branches/safari-610-branch/LayoutTests/fast/dom/focus-rem-style-update-expected.html (rev 0)
+++ branches/safari-610-branch/LayoutTests/fast/dom/focus-rem-style-update-expected.html 2020-11-13 22:17:34 UTC (rev 269798)
@@ -0,0 +1,7 @@
+<html>
+<style>
+div { width:100px; height:100px; background: green; }
+</style>
+<body>
+<div>
+</div>
Added: branches/safari-610-branch/LayoutTests/fast/dom/focus-rem-style-update.html (0 => 269798)
--- branches/safari-610-branch/LayoutTests/fast/dom/focus-rem-style-update.html (rev 0)
+++ branches/safari-610-branch/LayoutTests/fast/dom/focus-rem-style-update.html 2020-11-13 22:17:34 UTC (rev 269798)
@@ -0,0 +1,14 @@
+<html>
+<style>
+body { font-size: 1px; }
+div { width: 5rem; height:100px; background: green; }
+</style>
+<body>
+<div>
+<span></span>
+</div>
+<script>
+document.querySelector('div').isContentEditable;
+document.querySelector('span').focus();
+document.querySelector('html').style.fontSize = '20px';
+</script>
Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (269797 => 269798)
--- branches/safari-610-branch/Source/WebCore/ChangeLog 2020-11-13 22:17:17 UTC (rev 269797)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog 2020-11-13 22:17:34 UTC (rev 269798)
@@ -1,5 +1,56 @@
2020-11-13 Russell Epstein <[email protected]>
+ 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
+
+ 2020-11-04 Antti Koivisto <[email protected]>
+
+ 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.
+
+ 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.
+
+2020-11-13 Russell Epstein <[email protected]>
+
Cherry-pick r269321. rdar://problem/71083861
Protect against HTMLMediaElement being destroyed during disptachEvent().
Modified: branches/safari-610-branch/Source/WebCore/style/StyleTreeResolver.cpp (269797 => 269798)
--- branches/safari-610-branch/Source/WebCore/style/StyleTreeResolver.cpp 2020-11-13 22:17:17 UTC (rev 269797)
+++ branches/safari-610-branch/Source/WebCore/style/StyleTreeResolver.cpp 2020-11-13 22:17:34 UTC (rev 269798)
@@ -224,9 +224,8 @@
m_documentElementStyle = RenderStyle::clonePtr(*update.style);
scope().resolver.setOverrideDocumentElementStyle(m_documentElementStyle.get());
- if (update.change != NoChange && existingStyle && existingStyle->computedFontPixelSize() != update.style->computedFontPixelSize()) {
+ if (!existingStyle || existingStyle->computedFontPixelSize() != update.style->computedFontPixelSize()) {
// "rem" units are relative to the document element's font size so we need to recompute everything.
- // In practice this is rare.
scope().resolver.invalidateMatchedDeclarationsCache();
descendantsToResolve = DescendantsToResolve::All;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes