- Revision
- 246950
- Author
- [email protected]
- Date
- 2019-06-29 14:01:40 -0700 (Sat, 29 Jun 2019)
Log Message
Remove a PLATFORM(IOS_FAMILY) related to repaint offsets in composited scrolling layers
https://bugs.webkit.org/show_bug.cgi?id=199342
Reviewed by Zalan Bujtas.
Source/WebCore:
Code in RenderObject::shouldApplyCompositedContainerScrollsForRepaint() adds VisibleRectContextOption::ApplyCompositedContainerScrolls
only for iOS, and RenderLayerBacking::setContentsNeedDisplayInRect() subtracts out scroll position for only iOS,
so remove this iOS-specific code.
Blame for this code mentions touch event regions, so I tested these but they use absoluteBoundingBoxRect()
which doesn't hit this code. Still, I added a layout test for touch regions inside scrolled overflow.
Existing tests exist for repaint inside scrolled overflow.
Test: fast/events/touch/ios/touch-event-regions/scrolled-overflow.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint): Deleted.
(WebCore::RenderObject::visibleRectContextForRepaint): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::visibleRectContextForRepaint):
LayoutTests:
* fast/events/touch/ios/touch-event-regions/scrolled-overflow-expected.txt: Added.
* fast/events/touch/ios/touch-event-regions/scrolled-overflow.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (246949 => 246950)
--- trunk/LayoutTests/ChangeLog 2019-06-29 05:09:49 UTC (rev 246949)
+++ trunk/LayoutTests/ChangeLog 2019-06-29 21:01:40 UTC (rev 246950)
@@ -1,3 +1,13 @@
+2019-06-29 Simon Fraser <[email protected]>
+
+ Remove a PLATFORM(IOS_FAMILY) related to repaint offsets in composited scrolling layers
+ https://bugs.webkit.org/show_bug.cgi?id=199342
+
+ Reviewed by Zalan Bujtas.
+
+ * fast/events/touch/ios/touch-event-regions/scrolled-overflow-expected.txt: Added.
+ * fast/events/touch/ios/touch-event-regions/scrolled-overflow.html: Added.
+
2019-06-28 Zalan Bujtas <[email protected]>
[Text autosizing][iPadOS] bing.com is hard to read even with boosted text because of the line height
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/scrolled-overflow-expected.txt (0 => 246950)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/scrolled-overflow-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/scrolled-overflow-expected.txt 2019-06-29 21:01:40 UTC (rev 246950)
@@ -0,0 +1,11 @@
+touchstart inside overflow
+touchstart
+58, 50 - 260, 252
+touchstart
+58, 50 - 260, 252
+touchend
+58, 50 - 260, 252
+touchforcechange
+58, 50 - 260, 252
+passive
+
Added: trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/scrolled-overflow.html (0 => 246950)
--- trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/scrolled-overflow.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/touch-event-regions/scrolled-overflow.html 2019-06-29 21:01:40 UTC (rev 246950)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ #scroller {
+ height: 200px;
+ width: 200px;
+ border: 1px solid black;
+ margin: 50px;
+ overflow: scroll;
+ }
+ .box {
+ position: relative;
+ height: 100px;
+ width: 120px;
+ border: 1px solid black;
+ margin: 250px 10px;
+ }
+ </style>
+ <script src=""
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', () => {
+ scroller.scrollTo(0, 200);
+ dumpRegions();
+ }, false);
+ </script>
+</head>
+<body>
+ <div id="scroller">
+ <div class="box" _ontouchstart_="(void)0">touchstart inside overflow</div>
+ </div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (246949 => 246950)
--- trunk/Source/WebCore/ChangeLog 2019-06-29 05:09:49 UTC (rev 246949)
+++ trunk/Source/WebCore/ChangeLog 2019-06-29 21:01:40 UTC (rev 246950)
@@ -1,3 +1,29 @@
+2019-06-29 Simon Fraser <[email protected]>
+
+ Remove a PLATFORM(IOS_FAMILY) related to repaint offsets in composited scrolling layers
+ https://bugs.webkit.org/show_bug.cgi?id=199342
+
+ Reviewed by Zalan Bujtas.
+
+ Code in RenderObject::shouldApplyCompositedContainerScrollsForRepaint() adds VisibleRectContextOption::ApplyCompositedContainerScrolls
+ only for iOS, and RenderLayerBacking::setContentsNeedDisplayInRect() subtracts out scroll position for only iOS,
+ so remove this iOS-specific code.
+
+ Blame for this code mentions touch event regions, so I tested these but they use absoluteBoundingBoxRect()
+ which doesn't hit this code. Still, I added a layout test for touch regions inside scrolled overflow.
+
+ Existing tests exist for repaint inside scrolled overflow.
+
+ Test: fast/events/touch/ios/touch-event-regions/scrolled-overflow.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint): Deleted.
+ (WebCore::RenderObject::visibleRectContextForRepaint): Deleted.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::visibleRectContextForRepaint):
+
2019-06-28 Tim Horton <[email protected]>
iOS WebKit2 find-in-page indicator doesn't move with 'overflow: scroll'
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (246949 => 246950)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2019-06-29 05:09:49 UTC (rev 246949)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2019-06-29 21:01:40 UTC (rev 246950)
@@ -2713,11 +2713,6 @@
if (m_scrolledContentsLayer && m_scrolledContentsLayer->drawsContent()) {
FloatRect layerDirtyRect = pixelSnappedRectForPainting;
layerDirtyRect.move(-m_scrolledContentsLayer->offsetFromRenderer() + toLayoutSize(m_scrolledContentsLayer->scrollOffset()) - m_subpixelOffsetFromRenderer);
-#if PLATFORM(IOS_FAMILY)
- // Account for the fact that RenderLayerBacking::updateGeometry() bakes scrollOffset into offsetFromRenderer on iOS,
- // but the repaint rect is computed without taking the scroll position into account (see shouldApplyClipAndScrollPositionForRepaint()).
- layerDirtyRect.moveBy(-m_owningLayer.scrollPosition());
-#endif
m_scrolledContentsLayer->setNeedsDisplayInRect(layerDirtyRect, shouldClip);
}
}
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (246949 => 246950)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2019-06-29 05:09:49 UTC (rev 246949)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2019-06-29 21:01:40 UTC (rev 246950)
@@ -975,23 +975,6 @@
return LayoutRect();
}
-bool RenderObject::shouldApplyCompositedContainerScrollsForRepaint()
-{
-#if PLATFORM(IOS_FAMILY)
- return false;
-#else
- return true;
-#endif
-}
-
-RenderObject::VisibleRectContext RenderObject::visibleRectContextForRepaint()
-{
- VisibleRectContext context(false, false, { VisibleRectContextOption::ApplyContainerClip });
- if (shouldApplyCompositedContainerScrollsForRepaint())
- context.m_options.add(VisibleRectContextOption::ApplyCompositedContainerScrolls);
- return context;
-}
-
LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer) const
{
return *computeVisibleRectInContainer(rect, repaintContainer, visibleRectContextForRepaint());
Modified: trunk/Source/WebCore/rendering/RenderObject.h (246949 => 246950)
--- trunk/Source/WebCore/rendering/RenderObject.h 2019-06-29 05:09:49 UTC (rev 246949)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2019-06-29 21:01:40 UTC (rev 246950)
@@ -802,7 +802,10 @@
static bool shouldApplyCompositedContainerScrollsForRepaint();
- static VisibleRectContext visibleRectContextForRepaint();
+ static VisibleRectContext visibleRectContextForRepaint()
+ {
+ return VisibleRectContext(false, false, { VisibleRectContextOption::ApplyContainerClip, VisibleRectContextOption::ApplyCompositedContainerScrolls });
+ }
private:
#ifndef NDEBUG