diff options
author | trchen <trchen@chromium.org> | 2016-03-08 16:32:44 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-09 00:33:55 +0000 |
commit | be6997777d5f17e40a8fb4b68756624483ebd91e (patch) | |
tree | 9afd46a1a8f0a9d82b0965aca98b0924220abc1f /third_party/WebKit | |
parent | ab08537f91041bb00b4060e0ba6a770e9eab3d64 (diff) | |
download | chromium_src-be6997777d5f17e40a8fb4b68756624483ebd91e.zip chromium_src-be6997777d5f17e40a8fb4b68756624483ebd91e.tar.gz chromium_src-be6997777d5f17e40a8fb4b68756624483ebd91e.tar.bz2 |
[SPv2] Hookup overflow clip/scroll property nodes for normal flow
This CL adds scoped clip/scroll property in BoxClipper and BlockPainter.
It associates normal flow display items with the correct property nodes.
BUG=537409
Review URL: https://codereview.chromium.org/1652313003
Cr-Commit-Position: refs/heads/master@{#379995}
Diffstat (limited to 'third_party/WebKit')
6 files changed, 68 insertions, 2 deletions
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 4d23bf5..6ba0db8 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations @@ -401,7 +401,6 @@ crbug.com/580355 virtual/spv2/fast/block/basic/adding-near-anonymous-block.html crbug.com/580355 virtual/spv2/fast/block/basic/text-indent-rtl.html [ Pass ] crbug.com/580355 virtual/spv2/fast/block/basic/white-space-pre-wraps.html [ Pass ] crbug.com/580355 virtual/spv2/fast/block/float/001.html [ Pass ] -crbug.com/580355 virtual/spv2/fast/block/float/002.html [ Pass ] crbug.com/580355 virtual/spv2/fast/block/float/float-in-float-hit-testing.html [ Pass ] crbug.com/580355 virtual/spv2/fast/block/float/independent-align-positioning.html [ Pass ] crbug.com/580355 virtual/spv2/fast/block/float/intruding-painted-twice.html [ Pass ] @@ -434,6 +433,39 @@ crbug.com/580355 virtual/spv2/fast/block/margin-collapse/block-inside-inline/019 crbug.com/580355 virtual/spv2/fast/block/margin-collapse/block-inside-inline/020.html [ Pass ] crbug.com/580355 virtual/spv2/fast/block/positioning/height-change.html [ Pass ] crbug.com/580355 virtual/spv2/fast/block/positioning/relayout-on-position-change.html [ Pass ] +crbug.com/537409 virtual/spv2/fast/overflow [ Pass ] +crbug.com/589265 virtual/spv2/fast/block/float/002.html [ Failure ] +crbug.com/589265 virtual/spv2/fast/overflow/001.html [ Failure ] +crbug.com/589265 virtual/spv2/fast/overflow/border-radius-clipping.html [ Failure ] +crbug.com/589265 virtual/spv2/fast/overflow/clip-rects-fixed-ancestor.html [ Failure ] +crbug.com/589265 virtual/spv2/fast/overflow/dynamic-hidden.html [ Failure ] +crbug.com/589265 virtual/spv2/fast/overflow/overflow-focus-ring.html [ Failure ] +crbug.com/589265 virtual/spv2/fast/overflow/overflow-text-hit-testing.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/002.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/003.xml [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/005.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/007.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/008.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/childFocusRingClip.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/float-in-relpositioned.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/hit-test-overflow-controls.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/image-selection-highlight.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-auto-position-absolute.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-float-stacking.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-rtl-vertical.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-rtl.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-stacking.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-update-transform.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-with-local-background-attachment.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/overflow-x-y.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/scroll-nested-positioned-layer-in-overflow.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/scrollRevealButton.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/scrollbar-position-update.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/table-overflow-float.html [ Failure ] +crbug.com/589267 virtual/spv2/fast/overflow/unreachable-overflow-rtl-bug.html [ Failure ] +crbug.com/589279 virtual/spv2/fast/overflow/006.html [ Failure ] +crbug.com/589279 virtual/spv2/fast/overflow/position-fixed-transform-clipping.html [ Failure ] + crbug.com/537409 virtual/spv2/svg/as-image/svg-image-with-data-uri.html [ Pass ] crbug.com/587236 virtual/spv2/compositing/backface-visibility/backface-visibility-3d.html [ Pass ] crbug.com/587236 virtual/spv2/compositing/backface-visibility/backface-visibility-simple.html [ Pass ] diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index c43f70b..26555e4 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites @@ -205,6 +205,11 @@ }, { "prefix": "spv2", + "base": "fast/overflow", + "args": ["--enable-slimming-paint-v2"] + }, + { + "prefix": "spv2", "base": "paint", "args": ["--enable-slimming-paint-v2"] }, diff --git a/third_party/WebKit/LayoutTests/virtual/spv2/fast/overflow/README.txt b/third_party/WebKit/LayoutTests/virtual/spv2/fast/overflow/README.txt new file mode 100644 index 0000000..89dba61 --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/spv2/fast/overflow/README.txt @@ -0,0 +1,3 @@ +# This suite runs tests with --enable-slimming-paint-v2 +# We also have try bots running full set of layout tests for spv2: +# https://codereview.chromium.org/1283823002 diff --git a/third_party/WebKit/Source/core/paint/BlockPainter.cpp b/third_party/WebKit/Source/core/paint/BlockPainter.cpp index 189d4a9..a830546 100644 --- a/third_party/WebKit/Source/core/paint/BlockPainter.cpp +++ b/third_party/WebKit/Source/core/paint/BlockPainter.cpp @@ -18,6 +18,7 @@ #include "core/paint/InlinePainter.h" #include "core/paint/LayoutObjectDrawingRecorder.h" #include "core/paint/LineBoxListPainter.h" +#include "core/paint/ObjectPaintProperties.h" #include "core/paint/PaintInfo.h" #include "core/paint/PaintLayer.h" #include "core/paint/ScopeRecorder.h" @@ -155,9 +156,19 @@ void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffset); if (paintPhase != PaintPhaseSelfOutlineOnly) { + Optional<ScopedPaintChunkProperties> m_scopedScrollProperty; Optional<ScrollRecorder> scrollRecorder; Optional<PaintInfo> scrolledPaintInfo; - if (m_layoutBlock.hasOverflowClip()) { + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { + const auto* objectProperties = m_layoutBlock.objectPaintProperties(); + if (auto* scrollTranslation = objectProperties ? objectProperties->scrollTranslation() : nullptr) { + PaintChunkProperties properties(paintInfo.context.paintController().currentPaintChunkProperties()); + properties.transform = scrollTranslation; + m_scopedScrollProperty.emplace(paintInfo.context.paintController(), properties); + scrolledPaintInfo.emplace(paintInfo); + scrolledPaintInfo->updateCullRect(scrollTranslation->matrix().toAffineTransform()); + } + } else if (m_layoutBlock.hasOverflowClip()) { IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero()) { scrollRecorder.emplace(paintInfo.context, m_layoutBlock, paintPhase, scrollOffset); diff --git a/third_party/WebKit/Source/core/paint/BoxClipper.cpp b/third_party/WebKit/Source/core/paint/BoxClipper.cpp index 6edead0..ec86a5a 100644 --- a/third_party/WebKit/Source/core/paint/BoxClipper.cpp +++ b/third_party/WebKit/Source/core/paint/BoxClipper.cpp @@ -5,6 +5,7 @@ #include "core/paint/BoxClipper.h" #include "core/layout/LayoutBox.h" +#include "core/paint/ObjectPaintProperties.h" #include "core/paint/PaintInfo.h" #include "core/paint/PaintLayer.h" #include "platform/RuntimeEnabledFeatures.h" @@ -24,6 +25,16 @@ BoxClipper::BoxClipper(const LayoutBox& box, const PaintInfo& paintInfo, const L if (m_paintInfo.phase == PaintPhaseMask) return; + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { + const auto* objectProperties = m_box.objectPaintProperties(); + if (objectProperties && objectProperties->overflowClip()) { + PaintChunkProperties properties(paintInfo.context.paintController().currentPaintChunkProperties()); + properties.clip = objectProperties->overflowClip(); + m_scopedClipProperty.emplace(paintInfo.context.paintController(), properties); + } + return; + } + bool isControlClip = m_box.hasControlClip(); bool isOverflowOrContainmentClip = (m_box.hasOverflowClip() && !m_box.layer()->isSelfPaintingLayer()) || m_box.style()->containsPaint(); diff --git a/third_party/WebKit/Source/core/paint/BoxClipper.h b/third_party/WebKit/Source/core/paint/BoxClipper.h index 5d1efa7..ea4b255 100644 --- a/third_party/WebKit/Source/core/paint/BoxClipper.h +++ b/third_party/WebKit/Source/core/paint/BoxClipper.h @@ -7,7 +7,9 @@ #include "platform/geometry/LayoutPoint.h" #include "platform/graphics/paint/DisplayItem.h" +#include "platform/graphics/paint/ScopedPaintChunkProperties.h" #include "wtf/Allocator.h" +#include "wtf/Optional.h" namespace blink { @@ -25,6 +27,8 @@ private: const LayoutBox& m_box; const PaintInfo& m_paintInfo; DisplayItem::Type m_clipType; + + Optional<ScopedPaintChunkProperties> m_scopedClipProperty; }; } // namespace blink |