Title: [225345] branches/safari-604-branch
- Revision
- 225345
- Author
- [email protected]
- Date
- 2017-11-30 13:35:47 -0800 (Thu, 30 Nov 2017)
Log Message
Cherry-pick r225141. rdar://problem/35732184
Modified Paths
Added Paths
Diff
Modified: branches/safari-604-branch/LayoutTests/ChangeLog (225344 => 225345)
--- branches/safari-604-branch/LayoutTests/ChangeLog 2017-11-30 21:16:22 UTC (rev 225344)
+++ branches/safari-604-branch/LayoutTests/ChangeLog 2017-11-30 21:35:47 UTC (rev 225345)
@@ -1,3 +1,18 @@
+2017-11-30 Jason Marcell <[email protected]>
+
+ Cherry-pick r225141. rdar://problem/35732184
+
+ 2017-11-24 Antti Koivisto <[email protected]>
+
+ Style resolution spin due to calc() values always comparing inequal (seen on arstechnica.com)
+ https://bugs.webkit.org/show_bug.cgi?id=179982
+ <rdar://problem/35677991>
+
+ Reviewed by Darin Adler.
+
+ * transitions/transition-with-calc-spin-expected.txt: Added.
+ * transitions/transition-with-calc-spin.html: Added.
+
2017-11-03 Jason Marcell <[email protected]>
Cherry-pick r224405. rdar://problem/35339758
Added: branches/safari-604-branch/LayoutTests/transitions/transition-with-calc-spin-expected.txt (0 => 225345)
--- branches/safari-604-branch/LayoutTests/transitions/transition-with-calc-spin-expected.txt (rev 0)
+++ branches/safari-604-branch/LayoutTests/transitions/transition-with-calc-spin-expected.txt 2017-11-30 21:35:47 UTC (rev 225345)
@@ -0,0 +1,3 @@
+Test that calc values in transitions don't lead to a style resolution spin.
+PASS
+
Added: branches/safari-604-branch/LayoutTests/transitions/transition-with-calc-spin.html (0 => 225345)
--- branches/safari-604-branch/LayoutTests/transitions/transition-with-calc-spin.html (rev 0)
+++ branches/safari-604-branch/LayoutTests/transitions/transition-with-calc-spin.html 2017-11-30 21:35:47 UTC (rev 225345)
@@ -0,0 +1,39 @@
+<style>
+#testdiv {
+ background-color: inherit; /* needed to dodge the matched properties cache */
+}
+.test {
+ transition: 1s;
+ width: calc(100% - 10px); /* calc compares inequal with the same exact calc value */
+}
+</style>
+<body _onload_="test()">
+Test that calc values in transitions don't lead to a style resolution spin.
+<div id=log></div>
+<div id=testdiv></div>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function test() {
+ document.body.offsetWidth;
+
+ const startStyleRecalcCount = window.internals ? internals.styleRecalcCount() : 0;
+
+ testdiv.classList.add('test');
+
+ if (!window.internals)
+ return;
+ setTimeout(() => {
+ const styleRecalcCount = internals.styleRecalcCount() - startStyleRecalcCount;
+ if (styleRecalcCount <= 3)
+ log.innerHTML = "PASS"
+ else
+ log.innerHTML = `FAIL: styleRecalcCount: ${ internals.styleRecalcCount() - startStyleRecalcCount}`;
+ testRunner.notifyDone();
+ }, 10);
+}
+</script>
+</div>
Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (225344 => 225345)
--- branches/safari-604-branch/Source/WebCore/ChangeLog 2017-11-30 21:16:22 UTC (rev 225344)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog 2017-11-30 21:35:47 UTC (rev 225345)
@@ -1,3 +1,27 @@
+2017-11-30 Jason Marcell <[email protected]>
+
+ Cherry-pick r225141. rdar://problem/35732184
+
+ 2017-11-24 Antti Koivisto <[email protected]>
+
+ Style resolution spin due to calc() values always comparing inequal (seen on arstechnica.com)
+ https://bugs.webkit.org/show_bug.cgi?id=179982
+ <rdar://problem/35677991>
+
+ Reviewed by Darin Adler.
+
+ Test: transitions/transition-with-calc-spin.html
+
+ Something like calc(100% - 10px) would compare inequal to itself. This causes the implicit animation engine think that
+ there is a new target value after style resolution and restart the transition. Starting the transition triggers another style
+ resolution on zero duration timer and so on.
+
+ * platform/CalculationValue.cpp:
+ (WebCore::operator==):
+ * platform/CalculationValue.h:
+
+ Deep compare the child vectors.
+
2017-11-03 Jason Marcell <[email protected]>
Cherry-pick r224405. rdar://problem/35339758
Modified: branches/safari-604-branch/Source/WebCore/platform/CalculationValue.cpp (225344 => 225345)
--- branches/safari-604-branch/Source/WebCore/platform/CalculationValue.cpp 2017-11-30 21:16:22 UTC (rev 225344)
+++ branches/safari-604-branch/Source/WebCore/platform/CalculationValue.cpp 2017-11-30 21:35:47 UTC (rev 225345)
@@ -123,6 +123,20 @@
return other.type() == CalcExpressionNodeOperation && *this == toCalcExpressionOperation(other);
}
+bool operator==(const CalcExpressionOperation& a, const CalcExpressionOperation& b)
+{
+ if (a.getOperator() != b.getOperator())
+ return false;
+ // Maybe Vectors of unique_ptrs should always do deep compare?
+ if (a.children().size() != b.children().size())
+ return false;
+ for (unsigned i = 0; i < a.children().size(); ++i) {
+ if (!(*a.children()[i] == *b.children()[i]))
+ return false;
+ }
+ return true;
+}
+
void CalcExpressionOperation::dump(TextStream& ts) const
{
if (m_operator == CalcMin || m_operator == CalcMax) {
Modified: branches/safari-604-branch/Source/WebCore/platform/CalculationValue.h (225344 => 225345)
--- branches/safari-604-branch/Source/WebCore/platform/CalculationValue.h 2017-11-30 21:16:22 UTC (rev 225344)
+++ branches/safari-604-branch/Source/WebCore/platform/CalculationValue.h 2017-11-30 21:35:47 UTC (rev 225345)
@@ -209,10 +209,7 @@
{
}
-inline bool operator==(const CalcExpressionOperation& a, const CalcExpressionOperation& b)
-{
- return a.getOperator() == b.getOperator() && a.children() == b.children();
-}
+bool operator==(const CalcExpressionOperation&, const CalcExpressionOperation&);
inline const CalcExpressionOperation& toCalcExpressionOperation(const CalcExpressionNode& value)
{
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes