REGRESSION(r224460): Text fields sometimes get "messed up"
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jan 2018 10:57:02 +0000 (10:57 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jan 2018 10:57:02 +0000 (10:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181115

Reviewed by Zalan Bujtas.

Add the scroll position to paint offset before computing the clip rectangle. Before r224460, scroll position was
substracted after the clip rectangle was computed.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::computeClipRect):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/LayoutState.cpp

index 31c1bb0..5c31497 100644 (file)
@@ -1,3 +1,16 @@
+2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        REGRESSION(r224460): Text fields sometimes get "messed up"
+        https://bugs.webkit.org/show_bug.cgi?id=181115
+
+        Reviewed by Zalan Bujtas.
+
+        Add the scroll position to paint offset before computing the clip rectangle. Before r224460, scroll position was
+        substracted after the clip rectangle was computed.
+
+        * rendering/LayoutState.cpp:
+        (WebCore::LayoutState::computeClipRect):
+
 2018-01-09  Ali Juma  <ajuma@chromium.org>
 
         Implement VisualViewport API events
index d7b3955..c74e72d 100644 (file)
@@ -123,7 +123,8 @@ void LayoutState::computeClipRect(const LayoutState& ancestor, RenderBox& render
     if (!renderer.hasOverflowClip())
         return;
 
-    LayoutRect clipRect(toLayoutPoint(m_paintOffset) + renderer.view().frameView().layoutContext().layoutDelta(), renderer.cachedSizeForOverflowClip());
+    auto paintOffsetForClipRect = toLayoutPoint(m_paintOffset + toLayoutSize(renderer.scrollPosition()));
+    LayoutRect clipRect(paintOffsetForClipRect + renderer.view().frameView().layoutContext().layoutDelta(), renderer.cachedSizeForOverflowClip());
     if (m_clipped)
         m_clipRect.intersect(clipRect);
     else