Title: [171951] trunk/Source/WebCore
Revision
171951
Author
[email protected]
Date
2014-08-01 15:39:52 -0700 (Fri, 01 Aug 2014)

Log Message

Inspector highlights clipped at the bottom on the page in WK1 views with 
contentInsets
https://bugs.webkit.org/show_bug.cgi?id=135480
-and corresponding-
<rdar://problem/17850323>

Reviewed by Simon Fraser.

unscaledTotalVisibleContentSize() was the main function on Mac that was expected 
to return the rect representing ALL visible content, including content that might 
be in an inset area and obscured by UI elements. This patch re-names that function 
to unscaledVisibleContentSizeIncludingObscuredArea(), and that patch makes that 
function return the right thing in the platformWidget() case.

Re-name.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):

Return platformVisibleContentSizeIncludingObscuredArea() for the platformWidget() 
case and re-name.
* platform/ScrollView.cpp:
(WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):

This was just wrong. It was returning the big rectangle instead of the small one 
for platformWidget().
(WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):

New platform functions.
(WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
(WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
(WebCore::ScrollView::unscaledTotalVisibleContentSize): Deleted.
* platform/ScrollView.h:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
(WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
* platform/mac/ScrollViewMac.mm:
(WebCore::ScrollView::platformVisibleContentRect):
(WebCore::ScrollView::platformVisibleContentSize):
(WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
(WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):

Re-name.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::ensureRootLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (171950 => 171951)


--- trunk/Source/WebCore/ChangeLog	2014-08-01 22:33:50 UTC (rev 171950)
+++ trunk/Source/WebCore/ChangeLog	2014-08-01 22:39:52 UTC (rev 171951)
@@ -1,3 +1,53 @@
+2014-08-01  Beth Dakin  <[email protected]>
+
+        Inspector highlights clipped at the bottom on the page in WK1 views with 
+        contentInsets
+        https://bugs.webkit.org/show_bug.cgi?id=135480
+        -and corresponding-
+        <rdar://problem/17850323>
+
+        Reviewed by Simon Fraser.
+
+        unscaledTotalVisibleContentSize() was the main function on Mac that was expected 
+        to return the rect representing ALL visible content, including content that might 
+        be in an inset area and obscured by UI elements. This patch re-names that function 
+        to unscaledVisibleContentSizeIncludingObscuredArea(), and that patch makes that 
+        function return the right thing in the platformWidget() case.
+
+        Re-name.
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::InspectorOverlay::update):
+
+        Return platformVisibleContentSizeIncludingObscuredArea() for the platformWidget() 
+        case and re-name.
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
+
+        This was just wrong. It was returning the big rectangle instead of the small one 
+        for platformWidget().
+        (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
+
+        New platform functions.
+        (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
+        (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
+        (WebCore::ScrollView::unscaledTotalVisibleContentSize): Deleted.
+        * platform/ScrollView.h:
+        * platform/ios/ScrollViewIOS.mm:
+        (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
+        (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
+        * platform/mac/ScrollViewMac.mm:
+        (WebCore::ScrollView::platformVisibleContentRect):
+        (WebCore::ScrollView::platformVisibleContentSize):
+        (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea):
+        (WebCore::ScrollView::platformVisibleContentSizeIncludingObscuredArea):
+
+        Re-name.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+        (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
+        (WebCore::RenderLayerCompositor::updateRootLayerPosition):
+        (WebCore::RenderLayerCompositor::ensureRootLayer):
+
 2014-08-01  Myles C. Maxfield  <[email protected]>
 
         SVGGlyph wastes space due to padding

Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (171950 => 171951)


--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2014-08-01 22:33:50 UTC (rev 171950)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp	2014-08-01 22:39:52 UTC (rev 171951)
@@ -344,8 +344,8 @@
         return;
 
     FrameView* overlayView = overlayPage()->mainFrame().view();
-    IntSize viewportSize = view->unscaledTotalVisibleContentSize();
-    IntSize frameViewFullSize = view->unscaledTotalVisibleContentSize(ScrollableArea::IncludeScrollbars);
+    IntSize viewportSize = view->unscaledVisibleContentSizeIncludingObscuredArea();
+    IntSize frameViewFullSize = view->unscaledVisibleContentSizeIncludingObscuredArea(ScrollableArea::IncludeScrollbars);
     overlayPage()->setPageScaleFactor(m_page.pageScaleFactor(), IntPoint());
     frameViewFullSize.scale(m_page.pageScaleFactor());
     overlayView->resize(frameViewFullSize);

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (171950 => 171951)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2014-08-01 22:33:50 UTC (rev 171950)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2014-08-01 22:39:52 UTC (rev 171951)
@@ -266,7 +266,7 @@
     return IntRect(IntPoint(m_scrollOffset), expandedIntSize(visibleContentSize));
 }
 
-IntSize ScrollView::unscaledTotalVisibleContentSize(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
+IntSize ScrollView::unscaledVisibleContentSizeIncludingObscuredArea(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
 {
     if (platformWidget())
         return platformVisibleContentSize(scrollbarInclusion == IncludeScrollbars);
@@ -291,10 +291,10 @@
     
 IntSize ScrollView::unscaledUnobscuredVisibleContentSize(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
 {
-    IntSize visibleContentSize = unscaledTotalVisibleContentSize(scrollbarInclusion);
-    
+    IntSize visibleContentSize = unscaledVisibleContentSizeIncludingObscuredArea(scrollbarInclusion);
+
     if (platformWidget())
-        return visibleContentSize;
+        return platformVisibleContentSize(scrollbarInclusion == IncludeScrollbars);
 
 #if USE(TILED_BACKING_STORE)
     if (!m_fixedVisibleContentRect.isEmpty())
@@ -1529,6 +1529,16 @@
     return IntSize();
 }
 
+IntRect ScrollView::platformVisibleContentRectIncludingObscuredArea(bool) const
+{
+    return IntRect();
+}
+
+IntSize ScrollView::platformVisibleContentSizeIncludingObscuredArea(bool) const
+{
+    return IntSize();
+}
+
 void ScrollView::platformSetContentsSize()
 {
 }

Modified: trunk/Source/WebCore/platform/ScrollView.h (171950 => 171951)


--- trunk/Source/WebCore/platform/ScrollView.h	2014-08-01 22:33:50 UTC (rev 171950)
+++ trunk/Source/WebCore/platform/ScrollView.h	2014-08-01 22:39:52 UTC (rev 171951)
@@ -206,9 +206,9 @@
     // visibleContentScaleFactor is usually 1, except when the setting delegatesPageScaling is true and the
     // ScrollView is the main frame; in that case, visibleContentScaleFactor is equal to the page's pageScaleFactor.
     // Ports that don't use pageScaleFactor can treat unscaledUnobscuredVisibleContentSize and visibleContentRect().size() as equivalent.
-    // unscaledTotalVisibleContentSize() includes areas in the content that might be obscured by UI elements.
+    // unscaledVisibleContentSizeIncludingObscuredArea() includes areas in the content that might be obscured by UI elements.
     IntSize unscaledUnobscuredVisibleContentSize(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
-    IntSize unscaledTotalVisibleContentSize(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
+    IntSize unscaledVisibleContentSizeIncludingObscuredArea(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
     virtual float visibleContentScaleFactor() const { return 1; }
 
     // Functions for getting/setting the size webkit should use to layout the contents. By default this is the same as the visible
@@ -481,6 +481,8 @@
     bool platformCanBlitOnScroll() const;
     IntRect platformVisibleContentRect(bool includeScrollbars) const;
     IntSize platformVisibleContentSize(bool includeScrollbars) const;
+    IntRect platformVisibleContentRectIncludingObscuredArea(bool includeScrollbars) const;
+    IntSize platformVisibleContentSizeIncludingObscuredArea(bool includeScrollbars) const;
     void platformSetContentsSize();
     IntRect platformContentsToScreen(const IntRect&) const;
     IntPoint platformScreenToContents(const IntPoint&) const;

Modified: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (171950 => 171951)


--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm	2014-08-01 22:33:50 UTC (rev 171950)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm	2014-08-01 22:39:52 UTC (rev 171951)
@@ -195,6 +195,16 @@
     return IntSize();
 }
 
+IntRect ScrollView::platformVisibleContentRectIncludingObscuredArea(bool includeScrollbars) const
+{
+    return platformVisibleContentRect(includeScrollbars);
+}
+
+IntSize ScrollView::platformVisibleContentSizeIncludingObscuredArea(bool includeScrollbars) const
+{
+    return platformVisibleContentSize(includeScrollbars);
+}
+
 LegacyTileCache* ScrollView::legacyTileCache()
 {
     // Make tile cache pointer available via the main frame only. Tile cache interaction should be managed by

Modified: trunk/Source/WebCore/platform/mac/ScrollViewMac.mm (171950 => 171951)


--- trunk/Source/WebCore/platform/mac/ScrollViewMac.mm	2014-08-01 22:33:50 UTC (rev 171950)
+++ trunk/Source/WebCore/platform/mac/ScrollViewMac.mm	2014-08-01 22:39:52 UTC (rev 171951)
@@ -141,30 +141,43 @@
 IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    IntRect visibleContentRect = platformVisibleContentRectIncludingObscuredArea(includeScrollbars);
 
-    IntRect visibleContentRect = enclosingIntRect([scrollView() documentVisibleRect]);
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
     visibleContentRect.move(scrollView().contentInsets.left, scrollView().contentInsets.top);
     visibleContentRect.contract(scrollView().contentInsets.left + scrollView().contentInsets.right, scrollView().contentInsets.top + scrollView().contentInsets.bottom);
 #endif
 
+    return visibleContentRect;
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return IntRect();
+}
+
+IntSize ScrollView::platformVisibleContentSize(bool includeScrollbars) const
+{
+    return platformVisibleContentRect(includeScrollbars).size();
+}
+
+IntRect ScrollView::platformVisibleContentRectIncludingObscuredArea(bool includeScrollbars) const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    IntRect visibleContentRectIncludingObscuredArea = enclosingIntRect([scrollView() documentVisibleRect]);
+
     if (includeScrollbars) {
         IntSize frameSize = IntSize([scrollView() frame].size);
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
-        frameSize.contract(scrollView().contentInsets.left + scrollView().contentInsets.right, scrollView().contentInsets.top + scrollView().contentInsets.bottom);
-#endif
-        visibleContentRect.setSize(frameSize);
+        visibleContentRectIncludingObscuredArea.setSize(frameSize);
     }
 
-    return visibleContentRect;
+    return visibleContentRectIncludingObscuredArea;
     END_BLOCK_OBJC_EXCEPTIONS;
 
     return IntRect();
 }
 
-IntSize ScrollView::platformVisibleContentSize(bool includeScrollbars) const
+IntSize ScrollView::platformVisibleContentSizeIncludingObscuredArea(bool includeScrollbars) const
 {
-    return platformVisibleContentRect(includeScrollbars).size();
+    return platformVisibleContentRectIncludingObscuredArea(includeScrollbars).size();
 }
 
 void ScrollView::platformSetContentsSize()

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (171950 => 171951)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-08-01 22:33:50 UTC (rev 171950)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-08-01 22:39:52 UTC (rev 171951)
@@ -460,7 +460,7 @@
         rootLayer->flushCompositingState(visibleRect);
 #else
         // Having a m_clipLayer indicates that we're doing scrolling via GraphicsLayers.
-        IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView.unscaledTotalVisibleContentSize()) : frameView.visibleContentRect();
+        IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView.unscaledVisibleContentSizeIncludingObscuredArea()) : frameView.visibleContentRect();
         if (!frameView.exposedRect().isInfinite())
             visibleRect.intersect(IntRect(frameView.exposedRect()));
         rootLayer->flushCompositingState(visibleRect);
@@ -1562,7 +1562,7 @@
 {
     if (m_clipLayer) {
         const FrameView& frameView = m_renderView.frameView();
-        m_clipLayer->setSize(frameView.unscaledTotalVisibleContentSize());
+        m_clipLayer->setSize(frameView.unscaledVisibleContentSizeIncludingObscuredArea());
         m_clipLayer->setPosition(positionForClipLayer());
 
         frameViewDidScroll();
@@ -1970,7 +1970,7 @@
         m_rootContentLayer->setAnchorPoint(FloatPoint3D());
     }
     if (m_clipLayer) {
-        m_clipLayer->setSize(m_renderView.frameView().unscaledTotalVisibleContentSize());
+        m_clipLayer->setSize(m_renderView.frameView().unscaledVisibleContentSizeIncludingObscuredArea());
         m_clipLayer->setPosition(positionForClipLayer());
     }
 
@@ -3267,7 +3267,7 @@
             m_clipLayer->addChild(m_scrollLayer.get());
             m_scrollLayer->addChild(m_rootContentLayer.get());
 
-            m_clipLayer->setSize(m_renderView.frameView().unscaledTotalVisibleContentSize());
+            m_clipLayer->setSize(m_renderView.frameView().unscaledVisibleContentSizeIncludingObscuredArea());
             m_clipLayer->setPosition(positionForClipLayer());
             m_clipLayer->setAnchorPoint(FloatPoint3D());
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to