Changeset 211387 in webkit


Ignore:
Timestamp:
Jan 30, 2017 2:51:52 PM (7 years ago)
Author:
Simon Fraser
Message:

[iOS] position:fixed inside touch-scrollable overflow is mispositioned
https://bugs.webkit.org/show_bug.cgi?id=167604
Source/WebCore:

rdar://problem/29500273

Reviewed by Zalan Bujtas.

For layers inside touch-scrollable overflow, RenderLayerBacking::computeParentGraphicsLayerRect() needs
to account for the offset from the ancestor compositing layer's origin, to handle scrollable elements with
box-shadow, for example.

Also make the compositing log output a little easier to read.

Test: compositing/scrolling/fixed-inside-scroll.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::logLayerInfo):

Source/WebKit2:

rdar://problem/29500273

Reviewed by Zalan Bujtas.

Make sure we tell m_webPageProxy.computeCustomFixedPositionRect() when visual viewports are enabled.

  • UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:

(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):

LayoutTests:

Reviewed by Zalan Bujtas.

  • compositing/scrolling/fixed-inside-scroll-expected.html: Added.
  • compositing/scrolling/fixed-inside-scroll.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r211385 r211387  
     12017-01-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS] position:fixed inside touch-scrollable overflow is mispositioned
     4        https://bugs.webkit.org/show_bug.cgi?id=167604
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * compositing/scrolling/fixed-inside-scroll-expected.html: Added.
     9        * compositing/scrolling/fixed-inside-scroll.html: Added.
     10
    1112017-01-30  Matt Baker  <mattbaker@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r211386 r211387  
     12017-01-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS] position:fixed inside touch-scrollable overflow is mispositioned
     4        https://bugs.webkit.org/show_bug.cgi?id=167604
     5        rdar://problem/29500273
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        For layers inside touch-scrollable overflow, RenderLayerBacking::computeParentGraphicsLayerRect() needs
     10        to account for the offset from the ancestor compositing layer's origin, to handle scrollable elements with
     11        box-shadow, for example.
     12       
     13        Also make the compositing log output a little easier to read.
     14
     15        Test: compositing/scrolling/fixed-inside-scroll.html
     16
     17        * rendering/RenderLayerBacking.cpp:
     18        (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
     19        * rendering/RenderLayerCompositor.cpp:
     20        (WebCore::RenderLayerCompositor::logLayerInfo):
     21
    1222017-01-30  Jer Noble  <jer.noble@apple.com>
    223
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r211084 r211387  
    814814#if PLATFORM(IOS)
    815815    if (compositedAncestor->hasTouchScrollableOverflow()) {
     816        LayoutRect ancestorCompositedBounds = ancestorBackingLayer->compositedBounds();
    816817        auto& renderBox = downcast<RenderBox>(compositedAncestor->renderer());
    817         LayoutRect paddingBox(renderBox.borderLeft(), renderBox.borderTop(),
    818             renderBox.width() - renderBox.borderLeft() - renderBox.borderRight(),
    819             renderBox.height() - renderBox.borderTop() - renderBox.borderBottom());
     818        LayoutRect paddingBox(renderBox.borderLeft(), renderBox.borderTop(), renderBox.width() - renderBox.borderLeft() - renderBox.borderRight(), renderBox.height() - renderBox.borderTop() - renderBox.borderBottom());
    820819        ScrollOffset scrollOffset = compositedAncestor->scrollOffset();
    821         parentGraphicsLayerRect = LayoutRect((paddingBox.location() - toLayoutSize(scrollOffset)), paddingBox.size());
     820        parentGraphicsLayerRect = LayoutRect((paddingBox.location() - toLayoutSize(ancestorCompositedBounds.location()) - toLayoutSize(scrollOffset)), paddingBox.size());
    822821    }
    823822#else
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r211141 r211387  
    810810   
    811811    StringBuilder logString;
    812     logString.append(String::format("%*p (%.6f,%.6f-%.6f,%.6f) %.2fKB", 12 + depth * 2, &layer,
     812    logString.append(String::format("%*p (%.3f,%.3f-%.3f,%.3f) %.2fKB", 12 + depth * 2, &layer,
    813813        absoluteBounds.x().toFloat(), absoluteBounds.y().toFloat(), absoluteBounds.maxX().toFloat(), absoluteBounds.maxY().toFloat(),
    814814        backing->backingStoreMemoryEstimate() / 1024));
  • trunk/Source/WebKit2/ChangeLog

    r211379 r211387  
     12017-01-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS] position:fixed inside touch-scrollable overflow is mispositioned
     4        https://bugs.webkit.org/show_bug.cgi?id=167604
     5        rdar://problem/29500273
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Make sure we tell m_webPageProxy.computeCustomFixedPositionRect() when visual viewports are enabled.
     10
     11        * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
     12        (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
     13
    1142017-01-30  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm

    r210560 r211387  
    9696FloatRect RemoteScrollingCoordinatorProxy::customFixedPositionRect() const
    9797{
    98     return m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(), m_webPageProxy.displayedContentScale());
     98    return m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(),
     99        m_webPageProxy.displayedContentScale(), WebPageProxy::UnobscuredRectConstraint::Unconstrained, visualViewportEnabled());
    99100}
    100101
Note: See TracChangeset for help on using the changeset viewer.