Title: [271516] trunk
Revision
271516
Author
[email protected]
Date
2021-01-15 04:39:41 -0800 (Fri, 15 Jan 2021)

Log Message

[LFC][Integration] REGRESSION (r270123) facebook.com birthday dropdown do not work when creating new account
https://bugs.webkit.org/show_bug.cgi?id=220638
<rdar://problem/73175259>

Reviewed by Simon Fraser.

Source/WebCore:

This patch fixes incorrect hittest results when the hittest target
1. participates in the modern line layout and
2. prior to the hittesting its style changes in a way that it does not trigger layout.
e.g.
<div><div id=inner style="display: inline-block; visibility: hidden"><div></div>
<script>inner.style.visibility = "visible"</script>

Any subsequent hittest will miss the inner <div> as the loop in LineLayout::hitTest() early returns due to stale style information.
The reason why we end up with stale style is because we only update the layout box's style when the style diff >= StyleDifference::Layout () in RenderBox::styleDidChange.

Test: fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):

LayoutTests:

* fast/inline-block/hittest-fails-on-inline-block-with-visibility-change-expected.txt: Added.
* fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271515 => 271516)


--- trunk/LayoutTests/ChangeLog	2021-01-15 11:23:31 UTC (rev 271515)
+++ trunk/LayoutTests/ChangeLog	2021-01-15 12:39:41 UTC (rev 271516)
@@ -1,3 +1,14 @@
+2021-01-15  Zalan Bujtas  <[email protected]>
+
+        [LFC][Integration] REGRESSION (r270123) facebook.com birthday dropdown do not work when creating new account
+        https://bugs.webkit.org/show_bug.cgi?id=220638
+        <rdar://problem/73175259>
+
+        Reviewed by Simon Fraser.
+
+        * fast/inline-block/hittest-fails-on-inline-block-with-visibility-change-expected.txt: Added.
+        * fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html: Added.
+
 2021-01-15  Rob Buis  <[email protected]>
 
         Use event loop to set title

Added: trunk/LayoutTests/fast/inline-block/hittest-fails-on-inline-block-with-visibility-change-expected.txt (0 => 271516)


--- trunk/LayoutTests/fast/inline-block/hittest-fails-on-inline-block-with-visibility-change-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/inline-block/hittest-fails-on-inline-block-with-visibility-change-expected.txt	2021-01-15 12:39:41 UTC (rev 271516)
@@ -0,0 +1,2 @@
+click me
+clicked - PASSED

Added: trunk/LayoutTests/fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html (0 => 271516)


--- trunk/LayoutTests/fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html	2021-01-15 12:39:41 UTC (rev 271516)
@@ -0,0 +1,33 @@
+<script src=""
+<style>
+#container {
+  visibility: hidden;
+}
+
+#click_me {
+  display: inline-block;
+  width: 100px;
+  height: 100px;
+  background-color: green;
+}
+</style>
+<div id=container><div id=click_me>click me</div></div>
+<pre id=result></pre>
+<script>
+document.body.offsetHeight;
+
+click_me.addEventListener("click", function() {
+  result.innerText = "clicked - PASSED";
+  if (window.testRunner)
+    testRunner.notifyDone();
+  }, false);
+
+container.style.visibility = "visible";
+document.body.offsetHeight;
+
+if (window.testRunner) {
+  testRunner.dumpAsText();
+  testRunner.waitUntilDone();
+  UIHelper.activateElement(click_me);
+}
+</script>

Modified: trunk/Source/WebCore/ChangeLog (271515 => 271516)


--- trunk/Source/WebCore/ChangeLog	2021-01-15 11:23:31 UTC (rev 271515)
+++ trunk/Source/WebCore/ChangeLog	2021-01-15 12:39:41 UTC (rev 271516)
@@ -1,3 +1,26 @@
+2021-01-15  Zalan Bujtas  <[email protected]>
+
+        [LFC][Integration] REGRESSION (r270123) facebook.com birthday dropdown do not work when creating new account
+        https://bugs.webkit.org/show_bug.cgi?id=220638
+        <rdar://problem/73175259>
+
+        Reviewed by Simon Fraser.
+
+        This patch fixes incorrect hittest results when the hittest target
+        1. participates in the modern line layout and
+        2. prior to the hittesting its style changes in a way that it does not trigger layout.
+        e.g.
+        <div><div id=inner style="display: inline-block; visibility: hidden"><div></div>
+        <script>inner.style.visibility = "visible"</script>
+
+        Any subsequent hittest will miss the inner <div> as the loop in LineLayout::hitTest() early returns due to stale style information.
+        The reason why we end up with stale style is because we only update the layout box's style when the style diff >= StyleDifference::Layout () in RenderBox::styleDidChange.
+
+        Test: fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::styleDidChange):
+
 2021-01-15  Antoine Quint  <[email protected]>
 
         REGRESSION(r269813): PLT5 regressed by 0.5%

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (271515 => 271516)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2021-01-15 11:23:31 UTC (rev 271515)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2021-01-15 12:39:41 UTC (rev 271516)
@@ -412,7 +412,7 @@
         clearOverridingContentSize();
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-    if (diff == StyleDifference::Layout) {
+    if (diff >= StyleDifference::Repaint) {
         if (auto* lineLayout = LayoutIntegration::LineLayout::containing(*this))
             lineLayout->updateStyle(*this);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to