Commit 2b9f74d8 authored by szager's avatar szager Committed by Commit bot

Fix overflow:overlay scrollbar width for paint.

Re-landing this change:

https://codereview.chromium.org/2730343003/

... along with the missing test expectations.

TBR=tzik@chromium.org
BUG=697751
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2757533002
Cr-Commit-Position: refs/heads/master@{#457353}
parent 0ea824c6
...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600 ...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600 layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow {BODY} at (8,8) size 784x584
layer at (0,42) size 800x558 scrollY 284.00 scrollHeight 842 layer at (0,42) size 800x558 clip at (0,42) size 785x558 scrollY 284.00 scrollHeight 842
LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558 LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558
layer at (0,-242) size 559x842 backgroundClip at (0,42) size 800x558 clip at (0,42) size 800x558 layer at (0,-242) size 559x842 backgroundClip at (0,42) size 785x558 clip at (0,42) size 785x558
LayoutBlockFlow (positioned) {DIV} at (0,0) size 558.97x842 LayoutBlockFlow (positioned) {DIV} at (0,0) size 558.97x842
LayoutBlockFlow (anonymous) at (0,0) size 558.97x20 LayoutBlockFlow (anonymous) at (0,0) size 558.97x20
LayoutText {#text} at (0,0) size 559x19 LayoutText {#text} at (0,0) size 559x19
......
...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600 ...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600 layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow {BODY} at (8,8) size 784x584
layer at (0,42) size 800x558 scrollY 278.00 scrollHeight 836 layer at (0,42) size 800x558 clip at (0,42) size 785x558 scrollY 278.00 scrollHeight 836
LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558 LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558
layer at (0,-236) size 570x836 backgroundClip at (0,42) size 800x558 clip at (0,42) size 800x558 layer at (0,-236) size 570x836 backgroundClip at (0,42) size 785x558 clip at (0,42) size 785x558
LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836 LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836
LayoutBlockFlow (anonymous) at (0,0) size 570.41x18 LayoutBlockFlow (anonymous) at (0,0) size 570.41x18
LayoutText {#text} at (0,0) size 571x18 LayoutText {#text} at (0,0) size 571x18
......
...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600 ...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600 layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow {BODY} at (8,8) size 784x584
layer at (0,42) size 800x558 scrollY 278.00 scrollHeight 836 layer at (0,42) size 800x558 clip at (0,42) size 785x558 scrollY 278.00 scrollHeight 836
LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558 LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558
layer at (0,-236) size 570x836 backgroundClip at (0,42) size 800x558 clip at (0,42) size 800x558 layer at (0,-236) size 570x836 backgroundClip at (0,42) size 785x558 clip at (0,42) size 785x558
LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836 LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836
LayoutBlockFlow (anonymous) at (0,0) size 570.41x18 LayoutBlockFlow (anonymous) at (0,0) size 570.41x18
LayoutText {#text} at (0,0) size 571x18 LayoutText {#text} at (0,0) size 571x18
......
...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600 ...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600 layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow {BODY} at (8,8) size 784x584
layer at (0,42) size 800x558 scrollY 278.00 scrollHeight 836 layer at (0,42) size 800x558 clip at (0,42) size 785x558 scrollY 278.00 scrollHeight 836
LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558 LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558
layer at (0,-236) size 570x836 backgroundClip at (0,42) size 800x558 clip at (0,42) size 800x558 layer at (0,-236) size 570x836 backgroundClip at (0,42) size 785x558 clip at (0,42) size 785x558
LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836 LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836
LayoutBlockFlow (anonymous) at (0,0) size 570.41x18 LayoutBlockFlow (anonymous) at (0,0) size 570.41x18
LayoutText {#text} at (0,0) size 571x18 LayoutText {#text} at (0,0) size 571x18
......
...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600 ...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600 layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow {BODY} at (8,8) size 784x584
layer at (0,42) size 800x558 scrollY 278.00 scrollHeight 836 layer at (0,42) size 800x558 clip at (0,42) size 785x558 scrollY 278.00 scrollHeight 836
LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558 LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558
layer at (0,-236) size 570x836 backgroundClip at (0,42) size 800x558 clip at (0,42) size 800x558 layer at (0,-236) size 570x836 backgroundClip at (0,42) size 785x558 clip at (0,42) size 785x558
LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836 LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836
LayoutBlockFlow (anonymous) at (0,0) size 570.41x18 LayoutBlockFlow (anonymous) at (0,0) size 570.41x18
LayoutText {#text} at (0,0) size 571x18 LayoutText {#text} at (0,0) size 571x18
......
...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600 ...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600 layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow {BODY} at (8,8) size 784x584
layer at (0,42) size 800x558 scrollY 278.00 scrollHeight 836 layer at (0,42) size 800x558 clip at (0,42) size 785x558 scrollY 278.00 scrollHeight 836
LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558 LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558
layer at (0,-236) size 570x836 backgroundClip at (0,42) size 800x558 clip at (0,42) size 800x558 layer at (0,-236) size 570x836 backgroundClip at (0,42) size 785x558 clip at (0,42) size 785x558
LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836 LayoutBlockFlow (positioned) {DIV} at (0,0) size 570.41x836
LayoutBlockFlow (anonymous) at (0,0) size 570.41x18 LayoutBlockFlow (anonymous) at (0,0) size 570.41x18
LayoutText {#text} at (0,0) size 571x18 LayoutText {#text} at (0,0) size 571x18
......
...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600 ...@@ -3,9 +3,9 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600 layer at (0,0) size 800x600
LayoutBlockFlow {HTML} at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
LayoutBlockFlow {BODY} at (8,8) size 784x584 LayoutBlockFlow {BODY} at (8,8) size 784x584
layer at (0,42) size 800x558 scrollY 282.00 scrollHeight 840 layer at (0,42) size 800x558 clip at (0,42) size 785x558 scrollY 282.00 scrollHeight 840
LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558 LayoutBlockFlow (positioned) {DIV} at (0,42) size 800x558
layer at (0,-240) size 571x840 backgroundClip at (0,42) size 800x558 clip at (0,42) size 800x558 layer at (0,-240) size 571x840 backgroundClip at (0,42) size 785x558 clip at (0,42) size 785x558
LayoutBlockFlow (positioned) {DIV} at (0,0) size 571.28x840 LayoutBlockFlow (positioned) {DIV} at (0,0) size 571.28x840
LayoutBlockFlow (anonymous) at (0,0) size 571.28x18 LayoutBlockFlow (anonymous) at (0,0) size 571.28x18
LayoutText {#text} at (0,0) size 572x17 LayoutText {#text} at (0,0) size 572x17
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
}, },
{ {
"name": "Scrolling Layer", "name": "Scrolling Layer",
"bounds": [300, 300], "bounds": [285, 285],
"shouldFlattenTransform": false "shouldFlattenTransform": false
}, },
{ {
......
...@@ -86,9 +86,11 @@ class CORE_EXPORT RootFrameViewport final ...@@ -86,9 +86,11 @@ class CORE_EXPORT RootFrameViewport final
GraphicsLayer* layerForVerticalScrollbar() const override; GraphicsLayer* layerForVerticalScrollbar() const override;
GraphicsLayer* layerForScrollCorner() const override; GraphicsLayer* layerForScrollCorner() const override;
int horizontalScrollbarHeight( int horizontalScrollbarHeight(
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const override; OverlayScrollbarClipBehavior =
IgnorePlatformOverlayScrollbarSize) const override;
int verticalScrollbarWidth( int verticalScrollbarWidth(
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const override; OverlayScrollbarClipBehavior =
IgnorePlatformOverlayScrollbarSize) const override;
ScrollResult userScroll(ScrollGranularity, const FloatSize&) override; ScrollResult userScroll(ScrollGranularity, const FloatSize&) override;
bool scrollAnimatorEnabled() const override; bool scrollAnimatorEnabled() const override;
HostWindow* getHostWindow() const override; HostWindow* getHostWindow() const override;
......
...@@ -1088,7 +1088,7 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject { ...@@ -1088,7 +1088,7 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
// Returns the intersection of all overflow clips which apply. // Returns the intersection of all overflow clips which apply.
virtual LayoutRect overflowClipRect( virtual LayoutRect overflowClipRect(
const LayoutPoint& location, const LayoutPoint& location,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const; OverlayScrollbarClipBehavior = IgnorePlatformOverlayScrollbarSize) const;
LayoutRect clipRect(const LayoutPoint& location) const; LayoutRect clipRect(const LayoutPoint& location) const;
// Returns the combination of overflow clip, contain: paint clip and CSS clip // Returns the combination of overflow clip, contain: paint clip and CSS clip
...@@ -1445,7 +1445,7 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject { ...@@ -1445,7 +1445,7 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
void excludeScrollbars( void excludeScrollbars(
LayoutRect&, LayoutRect&,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const; OverlayScrollbarClipBehavior = IgnorePlatformOverlayScrollbarSize) const;
LayoutUnit containingBlockLogicalWidthForPositioned( LayoutUnit containingBlockLogicalWidthForPositioned(
const LayoutBoxModelObject* containingBlock, const LayoutBoxModelObject* containingBlock,
......
...@@ -508,7 +508,8 @@ class CORE_EXPORT LayoutTable final : public LayoutBlock { ...@@ -508,7 +508,8 @@ class CORE_EXPORT LayoutTable final : public LayoutBlock {
LayoutRect overflowClipRect( LayoutRect overflowClipRect(
const LayoutPoint& location, const LayoutPoint& location,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const override; OverlayScrollbarClipBehavior =
IgnorePlatformOverlayScrollbarSize) const override;
void addOverflowFromChildren() override; void addOverflowFromChildren() override;
......
...@@ -173,7 +173,8 @@ class CORE_EXPORT LayoutView final : public LayoutBlockFlow { ...@@ -173,7 +173,8 @@ class CORE_EXPORT LayoutView final : public LayoutBlockFlow {
LayoutRect viewRect() const override; LayoutRect viewRect() const override;
LayoutRect overflowClipRect( LayoutRect overflowClipRect(
const LayoutPoint& location, const LayoutPoint& location,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const override; OverlayScrollbarClipBehavior =
IgnorePlatformOverlayScrollbarSize) const override;
LayoutState* layoutState() const { return m_layoutState; } LayoutState* layoutState() const { return m_layoutState; }
......
...@@ -49,7 +49,7 @@ class LayoutBoxItem : public LayoutBoxModel { ...@@ -49,7 +49,7 @@ class LayoutBoxItem : public LayoutBoxModel {
LayoutRect overflowClipRect(const LayoutPoint& location, LayoutRect overflowClipRect(const LayoutPoint& location,
OverlayScrollbarClipBehavior behavior = OverlayScrollbarClipBehavior behavior =
IgnoreOverlayScrollbarSize) const { IgnorePlatformOverlayScrollbarSize) const {
return toBox()->overflowClipRect(location, behavior); return toBox()->overflowClipRect(location, behavior);
} }
......
...@@ -550,7 +550,7 @@ void CompositedLayerMapping:: ...@@ -550,7 +550,7 @@ void CompositedLayerMapping::
// FIXME: this should use cached clip rects, but this sometimes give // FIXME: this should use cached clip rects, but this sometimes give
// inaccurate results (and trips the ASSERTS in PaintLayerClipper). // inaccurate results (and trips the ASSERTS in PaintLayerClipper).
ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects, ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects,
IgnoreOverlayScrollbarSize); IgnorePlatformOverlayScrollbarSize);
clipRectsContext.setIgnoreOverflowClip(); clipRectsContext.setIgnoreOverflowClip();
ClipRect clipRect; ClipRect clipRect;
...@@ -1162,7 +1162,7 @@ void CompositedLayerMapping::updateAncestorClippingLayerGeometry( ...@@ -1162,7 +1162,7 @@ void CompositedLayerMapping::updateAncestorClippingLayerGeometry(
ClipRectsContext clipRectsContext(compositingContainer, ClipRectsContext clipRectsContext(compositingContainer,
PaintingClipRectsIgnoringOverflowClip, PaintingClipRectsIgnoringOverflowClip,
IgnoreOverlayScrollbarSize); IgnorePlatformOverlayScrollbarSize);
ClipRect parentClipRect; ClipRect parentClipRect;
m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper) m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
......
...@@ -230,8 +230,8 @@ LayoutRect LayoutSVGRoot::visualOverflowRect() const { ...@@ -230,8 +230,8 @@ LayoutRect LayoutSVGRoot::visualOverflowRect() const {
LayoutRect LayoutSVGRoot::overflowClipRect(const LayoutPoint& location, LayoutRect LayoutSVGRoot::overflowClipRect(const LayoutPoint& location,
OverlayScrollbarClipBehavior) const { OverlayScrollbarClipBehavior) const {
return LayoutRect(pixelSnappedIntRect( return LayoutRect(pixelSnappedIntRect(LayoutReplaced::overflowClipRect(
LayoutReplaced::overflowClipRect(location, IgnoreOverlayScrollbarSize))); location, IgnorePlatformOverlayScrollbarSize)));
} }
void LayoutSVGRoot::paintReplaced(const PaintInfo& paintInfo, void LayoutSVGRoot::paintReplaced(const PaintInfo& paintInfo,
......
...@@ -90,7 +90,8 @@ class CORE_EXPORT LayoutSVGRoot final : public LayoutReplaced { ...@@ -90,7 +90,8 @@ class CORE_EXPORT LayoutSVGRoot final : public LayoutReplaced {
LayoutRect visualOverflowRect() const override; LayoutRect visualOverflowRect() const override;
LayoutRect overflowClipRect( LayoutRect overflowClipRect(
const LayoutPoint& location, const LayoutPoint& location,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const override; OverlayScrollbarClipBehavior =
IgnorePlatformOverlayScrollbarSize) const override;
bool hasNonIsolatedBlendingDescendants() const final; bool hasNonIsolatedBlendingDescendants() const final;
......
...@@ -41,7 +41,7 @@ class ClipRectsCache { ...@@ -41,7 +41,7 @@ class ClipRectsCache {
: root(nullptr) : root(nullptr)
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
, ,
overlayScrollbarClipBehavior(IgnoreOverlayScrollbarSize) overlayScrollbarClipBehavior(IgnorePlatformOverlayScrollbarSize)
#endif #endif
{ {
} }
......
...@@ -845,7 +845,7 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient { ...@@ -845,7 +845,7 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient {
const LayoutRect& dirtyRect, const LayoutRect& dirtyRect,
ClipRectsCacheSlot, ClipRectsCacheSlot,
GeometryMapperOption, GeometryMapperOption,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize, OverlayScrollbarClipBehavior = IgnorePlatformOverlayScrollbarSize,
ShouldRespectOverflowClipType = RespectOverflowClip, ShouldRespectOverflowClipType = RespectOverflowClip,
const LayoutPoint* offsetFromRoot = 0, const LayoutPoint* offsetFromRoot = 0,
const LayoutSize& subPixelAccumulation = LayoutSize()); const LayoutSize& subPixelAccumulation = LayoutSize());
...@@ -855,7 +855,7 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient { ...@@ -855,7 +855,7 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient {
const LayoutRect& dirtyRect, const LayoutRect& dirtyRect,
ClipRectsCacheSlot, ClipRectsCacheSlot,
GeometryMapperOption, GeometryMapperOption,
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize, OverlayScrollbarClipBehavior = IgnorePlatformOverlayScrollbarSize,
ShouldRespectOverflowClipType = RespectOverflowClip, ShouldRespectOverflowClipType = RespectOverflowClip,
const LayoutPoint* offsetFromRoot = 0, const LayoutPoint* offsetFromRoot = 0,
const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutSize& subPixelAccumulation = LayoutSize(),
......
...@@ -588,7 +588,8 @@ ClipRects& PaintLayerClipper::paintingClipRects( ...@@ -588,7 +588,8 @@ ClipRects& PaintLayerClipper::paintingClipRects(
const LayoutSize& subpixelAccumulation) const { const LayoutSize& subpixelAccumulation) const {
DCHECK(!m_geometryMapper); DCHECK(!m_geometryMapper);
ClipRectsContext context(rootLayer, PaintingClipRects, ClipRectsContext context(rootLayer, PaintingClipRects,
IgnoreOverlayScrollbarSize, subpixelAccumulation); IgnorePlatformOverlayScrollbarSize,
subpixelAccumulation);
if (respectOverflowClip == IgnoreOverflowClip) if (respectOverflowClip == IgnoreOverflowClip)
context.setIgnoreOverflowClip(); context.setIgnoreOverflowClip();
return getClipRects(context); return getClipRects(context);
......
...@@ -66,7 +66,7 @@ class ClipRectsContext { ...@@ -66,7 +66,7 @@ class ClipRectsContext {
ClipRectsContext(const PaintLayer* root, ClipRectsContext(const PaintLayer* root,
ClipRectsCacheSlot slot, ClipRectsCacheSlot slot,
OverlayScrollbarClipBehavior overlayScrollbarClipBehavior = OverlayScrollbarClipBehavior overlayScrollbarClipBehavior =
IgnoreOverlayScrollbarSize, IgnorePlatformOverlayScrollbarSize,
const LayoutSize& accumulation = LayoutSize()) const LayoutSize& accumulation = LayoutSize())
: rootLayer(root), : rootLayer(root),
overlayScrollbarClipBehavior(overlayScrollbarClipBehavior), overlayScrollbarClipBehavior(overlayScrollbarClipBehavior),
......
...@@ -48,7 +48,7 @@ TEST_P(PaintLayerClipperTest, LayoutSVGRoot) { ...@@ -48,7 +48,7 @@ TEST_P(PaintLayerClipperTest, LayoutSVGRoot) {
PaintLayer* targetPaintLayer = PaintLayer* targetPaintLayer =
toLayoutBoxModelObject(target->layoutObject())->layer(); toLayoutBoxModelObject(target->layoutObject())->layer();
ClipRectsContext context(document().layoutView()->layer(), UncachedClipRects, ClipRectsContext context(document().layoutView()->layer(), UncachedClipRects,
IgnoreOverlayScrollbarSize, IgnorePlatformOverlayScrollbarSize,
LayoutSize(FloatSize(0.25, 0.35))); LayoutSize(FloatSize(0.25, 0.35)));
// When RLS is enabled, the LayoutView will have a composited scrolling layer, // When RLS is enabled, the LayoutView will have a composited scrolling layer,
// so don't apply an overflow clip. // so don't apply an overflow clip.
......
...@@ -450,23 +450,23 @@ PaintResult PaintLayerPainter::paintLayerContents( ...@@ -450,23 +450,23 @@ PaintResult PaintLayerPainter::paintLayerContents(
paintLayerForFragments->appendSingleFragmentIgnoringPagination( paintLayerForFragments->appendSingleFragmentIgnoringPagination(
layerFragments, localPaintingInfo.rootLayer, layerFragments, localPaintingInfo.rootLayer,
localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption, localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption,
IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot, IgnorePlatformOverlayScrollbarSize, respectOverflowClip,
localPaintingInfo.subPixelAccumulation); &offsetFromRoot, localPaintingInfo.subPixelAccumulation);
} else if (isFixedPositionObjectInPagedMedia()) { } else if (isFixedPositionObjectInPagedMedia()) {
PaintLayerFragments singleFragment; PaintLayerFragments singleFragment;
paintLayerForFragments->appendSingleFragmentIgnoringPagination( paintLayerForFragments->appendSingleFragmentIgnoringPagination(
singleFragment, localPaintingInfo.rootLayer, singleFragment, localPaintingInfo.rootLayer,
localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption, localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption,
IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot, IgnorePlatformOverlayScrollbarSize, respectOverflowClip,
localPaintingInfo.subPixelAccumulation); &offsetFromRoot, localPaintingInfo.subPixelAccumulation);
repeatFixedPositionObjectInPages(singleFragment[0], paintingInfo, repeatFixedPositionObjectInPages(singleFragment[0], paintingInfo,
layerFragments); layerFragments);
} else { } else {
paintLayerForFragments->collectFragments( paintLayerForFragments->collectFragments(
layerFragments, localPaintingInfo.rootLayer, layerFragments, localPaintingInfo.rootLayer,
localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption, localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption,
IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot, IgnorePlatformOverlayScrollbarSize, respectOverflowClip,
localPaintingInfo.subPixelAccumulation); &offsetFromRoot, localPaintingInfo.subPixelAccumulation);
} }
if (paintFlags & PaintLayerPaintingAncestorClippingMaskPhase) { if (paintFlags & PaintLayerPaintingAncestorClippingMaskPhase) {
...@@ -729,7 +729,7 @@ PaintResult PaintLayerPainter::paintLayerWithTransform( ...@@ -729,7 +729,7 @@ PaintResult PaintLayerPainter::paintLayerWithTransform(
// here. // here.
paginationLayer->collectFragments( paginationLayer->collectFragments(
layerFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, layerFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect,
cacheSlot, geometryMapperOption, IgnoreOverlayScrollbarSize, cacheSlot, geometryMapperOption, IgnorePlatformOverlayScrollbarSize,
respectOverflowClip, nullptr, paintingInfo.subPixelAccumulation, respectOverflowClip, nullptr, paintingInfo.subPixelAccumulation,
&transformedExtent); &transformedExtent);
} }
...@@ -746,7 +746,7 @@ PaintResult PaintLayerPainter::paintLayerWithTransform( ...@@ -746,7 +746,7 @@ PaintResult PaintLayerPainter::paintLayerWithTransform(
paintingInfo.rootLayer, paintingInfo.rootLayer,
(paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects
: PaintingClipRects, : PaintingClipRects,
IgnoreOverlayScrollbarSize); IgnorePlatformOverlayScrollbarSize);
if (shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()) == if (shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()) ==
IgnoreOverflowClip) IgnoreOverflowClip)
clipRectsContext.setIgnoreOverflowClip(); clipRectsContext.setIgnoreOverflowClip();
......
...@@ -506,7 +506,10 @@ IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const { ...@@ -506,7 +506,10 @@ IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const {
IntSize contentSize = contentsSize(); IntSize contentSize = contentsSize();
IntSize visibleSize = IntSize visibleSize =
pixelSnappedIntRect(box().overflowClipRect(box().location())).size(); pixelSnappedIntRect(
box().overflowClipRect(box().location(),
IgnorePlatformAndCSSOverlayScrollbarSize))
.size();
Page* page = layoutBox()->document().page(); Page* page = layoutBox()->document().page();
DCHECK(page); DCHECK(page);
...@@ -1300,10 +1303,16 @@ int PaintLayerScrollableArea::verticalScrollbarWidth( ...@@ -1300,10 +1303,16 @@ int PaintLayerScrollableArea::verticalScrollbarWidth(
OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const {
if (!hasVerticalScrollbar()) if (!hasVerticalScrollbar())
return 0; return 0;
if ((verticalScrollbar()->isOverlayScrollbar() || if (overlayScrollbarClipBehavior ==
box().style()->overflowY() == EOverflow::kOverlay) && IgnorePlatformAndCSSOverlayScrollbarSize &&
(overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || box().style()->overflowY() == EOverflow::kOverlay) {
!verticalScrollbar()->shouldParticipateInHitTesting())) { return 0;
}
if ((overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize ||
overlayScrollbarClipBehavior ==
IgnorePlatformAndCSSOverlayScrollbarSize ||
!verticalScrollbar()->shouldParticipateInHitTesting()) &&
verticalScrollbar()->isOverlayScrollbar()) {
return 0; return 0;
} }
return verticalScrollbar()->scrollbarThickness(); return verticalScrollbar()->scrollbarThickness();
...@@ -1313,10 +1322,16 @@ int PaintLayerScrollableArea::horizontalScrollbarHeight( ...@@ -1313,10 +1322,16 @@ int PaintLayerScrollableArea::horizontalScrollbarHeight(
OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const {
if (!hasHorizontalScrollbar()) if (!hasHorizontalScrollbar())
return 0; return 0;
if ((horizontalScrollbar()->isOverlayScrollbar() || if (overlayScrollbarClipBehavior ==
box().style()->overflowX() == EOverflow::kOverlay) && IgnorePlatformAndCSSOverlayScrollbarSize &&
(overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || box().style()->overflowX() == EOverflow::kOverlay) {
!horizontalScrollbar()->shouldParticipateInHitTesting())) { return 0;
}
if ((overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize ||
overlayScrollbarClipBehavior ==
IgnorePlatformAndCSSOverlayScrollbarSize ||
!horizontalScrollbar()->shouldParticipateInHitTesting()) &&
horizontalScrollbar()->isOverlayScrollbar()) {
return 0; return 0;
} }
return horizontalScrollbar()->scrollbarThickness(); return horizontalScrollbar()->scrollbarThickness();
......
...@@ -356,9 +356,11 @@ class CORE_EXPORT PaintLayerScrollableArea final ...@@ -356,9 +356,11 @@ class CORE_EXPORT PaintLayerScrollableArea final
int pixelSnappedScrollHeight() const; int pixelSnappedScrollHeight() const;
int verticalScrollbarWidth( int verticalScrollbarWidth(
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const override; OverlayScrollbarClipBehavior =
IgnorePlatformOverlayScrollbarSize) const override;
int horizontalScrollbarHeight( int horizontalScrollbarHeight(
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const override; OverlayScrollbarClipBehavior =
IgnorePlatformOverlayScrollbarSize) const override;
DoubleSize adjustedScrollOffset() const { DoubleSize adjustedScrollOffset() const {
return toDoubleSize(DoublePoint(scrollOrigin()) + m_scrollOffset); return toDoubleSize(DoublePoint(scrollOrigin()) + m_scrollOffset);
......
...@@ -43,8 +43,12 @@ inline ScrollOffset toScrollOffset(const FloatPoint& p) { ...@@ -43,8 +43,12 @@ inline ScrollOffset toScrollOffset(const FloatPoint& p) {
return ScrollOffset(p.x(), p.y()); return ScrollOffset(p.x(), p.y());
} }
// Platform overlay scrollbars are controlled and painted by the operating
// system (e.g., OSX and Android). CSS overlay scrollbars are created by
// setting overflow:overlay, and they are painted by chromium.
enum OverlayScrollbarClipBehavior { enum OverlayScrollbarClipBehavior {
IgnoreOverlayScrollbarSize, IgnorePlatformOverlayScrollbarSize,
IgnorePlatformAndCSSOverlayScrollbarSize,
ExcludeOverlayScrollbarSizeForHitTesting ExcludeOverlayScrollbarSizeForHitTesting
}; };
......
...@@ -635,7 +635,7 @@ float ScrollableArea::pixelStep(ScrollbarOrientation) const { ...@@ -635,7 +635,7 @@ float ScrollableArea::pixelStep(ScrollbarOrientation) const {
int ScrollableArea::verticalScrollbarWidth( int ScrollableArea::verticalScrollbarWidth(
OverlayScrollbarClipBehavior behavior) const { OverlayScrollbarClipBehavior behavior) const {
DCHECK_EQ(behavior, IgnoreOverlayScrollbarSize); DCHECK_EQ(behavior, IgnorePlatformOverlayScrollbarSize);
if (Scrollbar* verticalBar = verticalScrollbar()) if (Scrollbar* verticalBar = verticalScrollbar())
return !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0; return !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
return 0; return 0;
...@@ -643,7 +643,7 @@ int ScrollableArea::verticalScrollbarWidth( ...@@ -643,7 +643,7 @@ int ScrollableArea::verticalScrollbarWidth(
int ScrollableArea::horizontalScrollbarHeight( int ScrollableArea::horizontalScrollbarHeight(
OverlayScrollbarClipBehavior behavior) const { OverlayScrollbarClipBehavior behavior) const {
DCHECK_EQ(behavior, IgnoreOverlayScrollbarSize); DCHECK_EQ(behavior, IgnorePlatformOverlayScrollbarSize);
if (Scrollbar* horizontalBar = horizontalScrollbar()) if (Scrollbar* horizontalBar = horizontalScrollbar())
return !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0; return !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
return 0; return 0;
......
...@@ -335,9 +335,9 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin, ...@@ -335,9 +335,9 @@ class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin,
IntSize excludeScrollbars(const IntSize&) const; IntSize excludeScrollbars(const IntSize&) const;
virtual int verticalScrollbarWidth( virtual int verticalScrollbarWidth(
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const; OverlayScrollbarClipBehavior = IgnorePlatformOverlayScrollbarSize) const;
virtual int horizontalScrollbarHeight( virtual int horizontalScrollbarHeight(
OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const; OverlayScrollbarClipBehavior = IgnorePlatformOverlayScrollbarSize) const;
// Returns the widget associated with this ScrollableArea. // Returns the widget associated with this ScrollableArea.
virtual FrameViewBase* getFrameViewBase() { return nullptr; } virtual FrameViewBase* getFrameViewBase() { return nullptr; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment