Commit 6b253b35 authored by chaopeng's avatar chaopeng Committed by Commit Bot

[blink-gen-property-trees] Always add scroll node for layout view

The layout test crash because:

1. We always create scrollbar layers even the outer viewport does not scrollable
2. Outer viewport does not scrollable then we don't create scroll node in
   NeedsScrollNode.
3. cc gen property trees alway create scroll node because it is scrollable in
   cc side (RequiresCompositingForRootScroller).

In this patch, we always add scroll node for layout view. After this CL, some
tests in virtual/android/fullscreen still failure but not crash, devtools mobile
emulator still other crash.

Bug: 865560
Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I21a54cf7739055832b4634e28b850bf63543d9ed
Reviewed-on: https://chromium-review.googlesource.com/1156002
Commit-Queue: Jianpeng Chao <chaopeng@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584169}
parent 9208ac4b
......@@ -195,96 +195,27 @@ Bug(none) external/wpt/visual-viewport [ Pass ]
Bug(none) rootscroller/ [ Pass ]
Bug(none) virtual/android/ [ Pass ]
crbug.com/836912 virtual/android/frame-size/intersection-observer-root-uses-frame-size.html [ Crash ]
# Missing property tree nodes for scrollbars.
crbug.com/836890 virtual/android/fullscreen/anonymous-block-merge-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/api/document-exit-fullscreen-vs-request.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/api/element-request-fullscreen-two-elements.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/api/element-request-fullscreen-two-iframes.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/api/element-request-fullscreen-vs-exit.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/enter-exit-full-screen-hover.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/exit-full-screen-iframe.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-ancestor-shadow.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-api.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-cancel-nested.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-cancel.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-child-not-allowed-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-crash-offsetLeft.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-css.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-element-stack.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-exit-when-popup.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-fixed-pos-parent.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-allowed-nested.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-allowed-video.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-allowed.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-not-allowed.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-ua-style.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-zIndex.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-inline-split-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-keyboard-enabled.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-line-boxes-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-min-max-width-height-iframe.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-min-max-width-height-video.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-no-style-sharing.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-not-enabled-when-unsupported.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-orientation-change.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-placeholder.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-prefixed-and-unprefixed.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-remove-ancestor-after.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-remove-ancestor.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-remove-children.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-remove-sibling.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-remove.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-render-inline.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-request-not-supported.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-request-rejected.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-request-removed.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-request.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-restrictions.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-stacking-context.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-twice-newapi.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-twice.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-unprefixed-and-prefixed.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-will-change.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-with-flex-item.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-zIndex-after.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-zIndex.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/keyboard-focus.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/model/fully-exit-fullscreen-nested-iframe.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/model/fully-exit-fullscreen-nested.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/model/fully-exit-fullscreen-single.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/non-ancestor-iframe.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/orthogonal-writing-mode-full-screen-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/orthogonal-writing-mode-full-screen-reattach-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/parent-flow-inline-with-block-child.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/video-controls-override.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/video-controls-timeline.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/video-fail-to-enter-full-screen.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/video-fixed-at-top-left.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/video-fixed-background.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/video-scrolled-iframe.html [ Crash Failure ]
crbug.com/836890 virtual/android/fullscreen/video-specified-size.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/video-transform.html [ Crash ]
crbug.com/836890 virtual/android/rootscroller/nested-rootscroller-browser-controls-bounds-hidden.html [ Crash ]
crbug.com/836890 virtual/android/rootscroller/nested-rootscroller-browser-controls-bounds-shown.html [ Crash ]
crbug.com/836890 virtual/android/rootscroller/position-fixed-in-unscrollable-document-iframe.html [ Crash ]
crbug.com/836890 virtual/android/rootscroller/position-fixed-in-unscrollable-document.html [ Crash ]
crbug.com/836890 virtual/android/rootscroller/root-scroller-apply-filter-to-parent.html [ Crash ]
crbug.com/836890 virtual/android/rootscroller/rootscroller-during-fullscreen.html [ Crash ]
crbug.com/836890 virtual/android/rootscroller/set-rootscroller-before-load.html [ Crash ]
crbug.com/836890 virtual/android/url-bar/bottom-fixed-adjusted-when-showing-url-bar.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/compositor-touch-hit-rects-fullscreen-video-controls.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/empty-anonymous-block-continuation-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-contentEditable-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-is-in-top-layer.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-table-section.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-with-css-reference-filter.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/notify-paint-crash.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/rendering/backdrop-iframe.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/rendering/backdrop-video.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/rendering/backdrop.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/rendering/overflow-root.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/rendering/overflow.html [ Crash ]
crbug.com/836890 virtual/android/fullscreen/full-screen-fixed-pos-parent.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-allowed-video.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-not-allowed.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-is-in-top-layer.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-restrictions.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-stacking-context.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-will-change.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-zIndex.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/video-controls-timeline.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/video-fail-to-enter-full-screen.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/video-scrolled-iframe.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/video-specified-size.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/video-transform.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/rendering/backdrop-iframe.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/rendering/backdrop-object.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/rendering/backdrop-video.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/rendering/backdrop.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-remove-ancestor-after.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/video-fixed-background.html [ Failure ]
crbug.com/836890 virtual/android/fullscreen/full-screen-iframe-zIndex.html [ Failure ]
# Reflection / mask ordering issue
crbug.com/767318 compositing/reflections/nested-reflection-mask-change.html [ Failure ]
......@@ -350,8 +281,15 @@ crbug.com/874672 images/cross-fade-invalidation.html [ Failure ]
# Something wrong with vertical-rl scrollbars
crbug.com/853945 fast/block/positioning/vertical-rl/002.html [ Failure ]
crbug.com/853945 fast/block/positioning/vertical-rl/fixed-positioning.html [ Failure ]
crbug.com/853945 fast/block/positioning/rtl-fixed-positioning.html [ Failure ]
# Composited multicolumn paints differently.
crbug.com/854192 fast/multicol/composited-layer-nested.html [ Failure ]
crbug.com/854192 fast/multicol/vertical-rl/composited-relpos-overlapping-will-change.html [ Failure ]
crbug.com/854192 paint/pagination/composited-paginated-outlined-box.html [ Failure ]
Bug(none) fast/dom/scroll-reveal-left-overflow.html [ Failure ]
Bug(none) fast/dom/scroll-reveal-top-overflow.html [ Failure ]
Bug(none) virtual/android/rootscroller/nested-rootscroller-browser-controls-bounds-hidden.html [ Failure ]
Bug(none) virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gesture-touchpad.html [ Failure ]
......@@ -4978,3 +4978,5 @@ crbug.com/869726 [ Mac ] virtual/scroll_customization/fast/events/touch/touch-la
# Test frequently times out on Mac CQ bots.
crbug.com/874703 [ Mac ] http/tests/devtools/extensions/extensions-panel.js [ Timeout Pass ]
# This won't pass until the bug fixed.
crbug.com/875287 fast/frames/crash-frameset-CSS-content-property.html [ Crash ]
\ No newline at end of file
......@@ -256,7 +256,11 @@ bool CompositingReasonFinder::RequiresCompositingForRootScroller(
const PaintLayer& layer) {
// The root scroller needs composited scrolling layers even if it doesn't
// actually have scrolling since CC has these assumptions baked in for the
// viewport.
// viewport. Because this is only needed for CC, we can skip it if compositing
// is not enabled.
const auto& settings = *layer.GetLayoutObject().GetDocument().GetSettings();
if (!settings.GetAcceleratedCompositingEnabled())
return false;
return RootScrollerUtil::IsGlobal(layer);
}
......
......@@ -98,7 +98,12 @@ TEST_P(PaintControllerPaintTest, ChunkIdClientCacheFlag) {
// Verify that the background does not scroll.
const PaintChunk& background_chunk = RootPaintController().PaintChunks()[0];
auto* transform = background_chunk.properties.Transform();
EXPECT_EQ(nullptr, transform->ScrollNode());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
EXPECT_FALSE(transform->ScrollNode());
else
EXPECT_TRUE(transform->ScrollNode());
const EffectPaintPropertyNode* effect_node =
div.FirstFragment().PaintProperties()->Effect();
......
......@@ -187,23 +187,39 @@ class FragmentPaintPropertyTreeBuilder {
bool property_added_or_removed_ = false;
};
static bool IsRootScroller(const LayoutBox& box) {
auto* scrollable_area = box.GetScrollableArea();
DCHECK(scrollable_area);
auto* layer = scrollable_area->Layer();
return layer &&
CompositingReasonFinder::RequiresCompositingForRootScroller(*layer);
}
static bool HasScrollsOverflow(const LayoutBox& box) {
// TODO(crbug.com/839341): Remove ScrollTimeline check once we support
// main-thread AnimationWorklet and don't need to promote the scroll-source.
return box.GetScrollableArea()->ScrollsOverflow() ||
ScrollTimeline::HasActiveScrollTimeline(box.GetNode());
}
static bool NeedsScrollNode(const LayoutObject& object) {
if (!object.HasOverflowClip())
return false;
// TODO(crbug.com/839341): Remove ScrollTimeline check once we support
// main-thread AnimationWorklet and don't need to promote the scroll-source.
return ToLayoutBox(object).GetScrollableArea()->ScrollsOverflow() ||
ScrollTimeline::HasActiveScrollTimeline(object.GetNode());
const LayoutBox& box = ToLayoutBox(object);
// TODO(pdr): SPV2 has invalidation issues (crbug.com/732611) as well as
// subpixel issues (crbug.com/693741) which prevent us from compositing the
// root scroller.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
return HasScrollsOverflow(box);
return HasScrollsOverflow(box) || IsRootScroller(box);
}
static CompositingReasons CompositingReasonsForScroll(const LayoutBox& box) {
CompositingReasons compositing_reasons = CompositingReason::kNone;
if (auto* scrollable_area = box.GetScrollableArea()) {
if (auto* layer = scrollable_area->Layer()) {
if (CompositingReasonFinder::RequiresCompositingForRootScroller(*layer))
compositing_reasons |= CompositingReason::kRootScroller;
}
}
if (IsRootScroller(box))
compositing_reasons |= CompositingReason::kRootScroller;
// TODO(pdr): Set other compositing reasons for scroll here, see:
// PaintLayerScrollableArea::ComputeNeedsCompositedScrolling.
return compositing_reasons;
......@@ -1449,10 +1465,8 @@ void FragmentPaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation() {
if (properties_->Scroll())
context_.current.scroll = properties_->Scroll();
if (properties_->ScrollTranslation()) {
if (properties_->ScrollTranslation())
context_.current.transform = properties_->ScrollTranslation();
context_.current.should_flatten_inherited_transform = false;
}
}
void FragmentPaintPropertyTreeBuilder::UpdateOutOfFlowContext() {
......
......@@ -145,17 +145,12 @@ TEST_P(PaintPropertyTreeBuilderTest, FixedPosition) {
auto* positioned_scroll_translation =
positioned_scroll_properties->ScrollTranslation();
auto* positioned_scroll_node = positioned_scroll_translation->ScrollNode();
// TODO(bokan): Viewport property node generation has been disabled
// temporarily with the flag off to diagnose https//crbug.com/868927.
if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
EXPECT_EQ(GetDocument()
.GetPage()
->GetVisualViewport()
.GetScrollTranslationNode()
->ScrollNode(),
positioned_scroll_node->Parent());
} else {
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(positioned_scroll_node->Parent()->IsRoot());
} else {
EXPECT_EQ(DocScroll(), positioned_scroll_node->Parent());
}
EXPECT_EQ(TransformationMatrix().Translate(0, -3),
positioned_scroll_translation->Matrix());
......@@ -183,17 +178,12 @@ TEST_P(PaintPropertyTreeBuilderTest, FixedPosition) {
auto* transformed_scroll_translation =
transformed_scroll_properties->ScrollTranslation();
auto* transformed_scroll_node = transformed_scroll_translation->ScrollNode();
// TODO(bokan): Viewport property node generation has been disabled
// temporarily with the flag off to diagnose https//crbug.com/868927.
if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
EXPECT_EQ(GetDocument()
.GetPage()
->GetVisualViewport()
.GetScrollTranslationNode()
->ScrollNode(),
transformed_scroll_node->Parent());
} else {
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(transformed_scroll_node->Parent()->IsRoot());
} else {
EXPECT_EQ(DocScroll(), transformed_scroll_node->Parent());
}
EXPECT_EQ(TransformationMatrix().Translate(0, -5),
transformed_scroll_translation->Matrix());
......@@ -449,8 +439,15 @@ TEST_P(PaintPropertyTreeBuilderTest, Perspective) {
// paint offset.
EXPECT_EQ(FloatPoint3D(250, 250, 0),
perspective_properties->Perspective()->Origin());
EXPECT_EQ(DocPreTranslation(),
perspective_properties->Perspective()->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
perspective_properties->Perspective()->Parent());
} else {
EXPECT_EQ(DocScrollTranslation(),
perspective_properties->Perspective()->Parent());
}
// Adding perspective doesn't clear paint offset. The paint offset will be
// passed down to children.
......@@ -471,8 +468,15 @@ TEST_P(PaintPropertyTreeBuilderTest, Perspective) {
perspective_properties->Perspective()->Matrix());
EXPECT_EQ(FloatPoint3D(250, 250, 0),
perspective_properties->Perspective()->Origin());
EXPECT_EQ(DocPreTranslation(),
perspective_properties->Perspective()->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
perspective_properties->Perspective()->Parent());
} else {
EXPECT_EQ(DocScrollTranslation(),
perspective_properties->Perspective()->Parent());
}
perspective->setAttribute(HTMLNames::styleAttr, "perspective-origin: 5% 20%");
GetDocument().View()->UpdateAllLifecyclePhases();
......@@ -480,8 +484,15 @@ TEST_P(PaintPropertyTreeBuilderTest, Perspective) {
perspective_properties->Perspective()->Matrix());
EXPECT_EQ(FloatPoint3D(70, 160, 0),
perspective_properties->Perspective()->Origin());
EXPECT_EQ(DocPreTranslation(),
perspective_properties->Perspective()->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
perspective_properties->Perspective()->Parent());
} else {
EXPECT_EQ(DocScrollTranslation(),
perspective_properties->Perspective()->Parent());
}
}
TEST_P(PaintPropertyTreeBuilderTest, Transform) {
......@@ -688,8 +699,15 @@ TEST_P(PaintPropertyTreeBuilderTest, RelativePositionInline) {
inline_block->GetLayoutObject()->FirstFragment().PaintProperties();
EXPECT_EQ(TransformationMatrix().Translate(135, 490),
inline_block_properties->PaintOffsetTranslation()->Matrix());
EXPECT_EQ(DocPreTranslation(),
inline_block_properties->PaintOffsetTranslation()->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
inline_block_properties->PaintOffsetTranslation()->Parent());
} else {
EXPECT_EQ(DocScrollTranslation(),
inline_block_properties->PaintOffsetTranslation()->Parent());
}
CHECK_EXACT_VISUAL_RECT(LayoutRect(135, 490, 10, 20),
inline_block->GetLayoutObject(),
GetDocument().View()->GetLayoutView());
......@@ -1011,10 +1029,17 @@ TEST_P(PaintPropertyTreeBuilderTest, TransformNodesInSVG) {
EXPECT_EQ(
TransformationMatrix().Translate(70, 25),
svg_root_with3d_transform_properties->PaintOffsetTranslation()->Matrix());
EXPECT_EQ(
DocPreTranslation(),
svg_root_with3d_transform_properties->PaintOffsetTranslation()->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
svg_root_with3d_transform_properties->PaintOffsetTranslation()
->Parent());
} else {
EXPECT_EQ(DocScrollTranslation(),
svg_root_with3d_transform_properties->PaintOffsetTranslation()
->Parent());
}
LayoutObject& rect_with2d_transform =
*GetLayoutObjectByElementId("rectWith2dTransform");
const ObjectPaintProperties* rect_with2d_transform_properties =
......@@ -1097,8 +1122,15 @@ TEST_P(PaintPropertyTreeBuilderTest, SVGRootPaintOffsetTransformNode) {
FloatSize(50, 25),
svg_properties->PaintOffsetTranslation()->Matrix().To2DTranslation());
EXPECT_EQ(nullptr, svg_properties->ReplacedContentTransform());
EXPECT_EQ(DocPreTranslation(),
svg_properties->PaintOffsetTranslation()->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
svg_properties->PaintOffsetTranslation()->Parent());
} else {
EXPECT_EQ(DocScrollTranslation(),
svg_properties->PaintOffsetTranslation()->Parent());
}
}
TEST_P(PaintPropertyTreeBuilderTest, SVGRootLocalToBorderBoxTransformNode) {
......@@ -1462,11 +1494,21 @@ TEST_P(PaintPropertyTreeBuilderTest, ControlClip) {
LayoutObject& button = *GetLayoutObjectByElementId("button");
const ObjectPaintProperties* button_properties =
button.FirstFragment().PaintProperties();
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
button_properties->OverflowClip()->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(DocPreTranslation());
EXPECT_FALSE(DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
button_properties->OverflowClip()->LocalTransformSpace());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
button_properties->OverflowClip()->LocalTransformSpace());
}
EXPECT_EQ(FloatRoundedRect(5, 5, 335, 113),
button_properties->OverflowClip()->ClipRect());
EXPECT_EQ(DocContentClip(), button_properties->OverflowClip()->Parent());
......@@ -1492,9 +1534,16 @@ TEST_P(PaintPropertyTreeBuilderTest, ControlClipInsideForeignObject) {
LayoutObject& button = *GetLayoutObjectByElementId("button");
const ObjectPaintProperties* button_properties =
button.FirstFragment().PaintProperties();
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_FALSE(DocScrollTranslation());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
}
EXPECT_EQ(FloatRoundedRect(2, 2, 341, 119),
button_properties->OverflowClip()->ClipRect());
CHECK_EXACT_VISUAL_RECT(LayoutRect(8, 8, 345, 123), &button,
......@@ -1524,11 +1573,20 @@ TEST_P(PaintPropertyTreeBuilderTest, BorderRadiusClip) {
LayoutObject& div = *GetLayoutObjectByElementId("div");
const ObjectPaintProperties* div_properties =
div.FirstFragment().PaintProperties();
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
div_properties->OverflowClip()->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_FALSE(DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
div_properties->OverflowClip()->LocalTransformSpace());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
div_properties->OverflowClip()->LocalTransformSpace());
}
// The overflow clip rect includes only the padding box.
// padding box = border box(500+60+50, 400+45+55) - border outset(60+50,
// 45+55) - scrollbars(15, 15)
......@@ -1536,7 +1594,14 @@ TEST_P(PaintPropertyTreeBuilderTest, BorderRadiusClip) {
div_properties->OverflowClip()->ClipRect());
const ClipPaintPropertyNode* border_radius_clip =
div_properties->OverflowClip()->Parent();
EXPECT_EQ(DocPreTranslation(), border_radius_clip->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(), border_radius_clip->LocalTransformSpace());
} else {
EXPECT_EQ(DocScrollTranslation(),
border_radius_clip->LocalTransformSpace());
}
// The border radius clip is the area enclosed by inner border edge, including
// the scrollbars. As the border-radius is specified in outer radius, the
// inner radius is calculated by:
......@@ -1840,8 +1905,15 @@ TEST_P(PaintPropertyTreeBuilderTest, TableCellLayoutLocation) {
LayoutObject& target = *GetLayoutObjectByElementId("target");
EXPECT_EQ(LayoutPoint(170, 170), target.FirstFragment().PaintOffset());
EXPECT_EQ(DocPreTranslation(),
target.FirstFragment().LocalBorderBoxProperties().Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
target.FirstFragment().LocalBorderBoxProperties().Transform());
} else {
EXPECT_EQ(DocScrollTranslation(),
target.FirstFragment().LocalBorderBoxProperties().Transform());
}
CHECK_EXACT_VISUAL_RECT(LayoutRect(170, 170, 100, 100), &target,
GetDocument().View()->GetLayoutView());
}
......@@ -1878,8 +1950,15 @@ TEST_P(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendant) {
const ObjectPaintProperties* clip_properties =
clip.FirstFragment().PaintProperties();
EXPECT_EQ(DocContentClip(), clip_properties->CssClip()->Parent());
EXPECT_EQ(DocPreTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
} else {
EXPECT_EQ(DocScrollTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
}
EXPECT_EQ(FloatRoundedRect(FloatRect(absolute_clip_rect)),
clip_properties->CssClip()->ClipRect());
CHECK_VISUAL_RECT(absolute_clip_rect, &clip,
......@@ -1934,11 +2013,19 @@ TEST_P(PaintPropertyTreeBuilderTest, CSSClipAbsPositionDescendant) {
const ObjectPaintProperties* clip_properties =
clip->FirstFragment().PaintProperties();
EXPECT_EQ(DocContentClip(), clip_properties->CssClip()->Parent());
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_FALSE(DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
}
EXPECT_EQ(FloatRoundedRect(FloatRect(absolute_clip_rect)),
clip_properties->CssClip()->ClipRect());
CHECK_VISUAL_RECT(absolute_clip_rect, clip,
......@@ -1950,8 +2037,17 @@ TEST_P(PaintPropertyTreeBuilderTest, CSSClipAbsPositionDescendant) {
auto* absolute = GetLayoutObjectByElementId("absolute");
EXPECT_EQ(clip_properties->CssClip(),
absolute->FirstFragment().LocalBorderBoxProperties().Clip());
EXPECT_EQ(DocPreTranslation(),
absolute->FirstFragment().LocalBorderBoxProperties().Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_FALSE(DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
absolute->FirstFragment().LocalBorderBoxProperties().Transform());
} else {
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
absolute->FirstFragment().LocalBorderBoxProperties().Transform());
}
EXPECT_EQ(LayoutPoint(777, 777), absolute->FirstFragment().PaintOffset());
CHECK_VISUAL_RECT(LayoutRect(), absolute,
GetDocument().View()->GetLayoutView(),
......@@ -1987,11 +2083,19 @@ TEST_P(PaintPropertyTreeBuilderTest, CSSClipSubpixel) {
const ObjectPaintProperties* clip_properties =
clip->FirstFragment().PaintProperties();
EXPECT_EQ(DocContentClip(), clip_properties->CssClip()->Parent());
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(DocPreTranslation());
EXPECT_EQ(DocPreTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
clip_properties->CssClip()->LocalTransformSpace());
}
EXPECT_EQ(FloatRoundedRect(FloatRect(absolute_clip_rect)),
clip_properties->CssClip()->ClipRect());
}
......@@ -2035,11 +2139,19 @@ TEST_P(PaintPropertyTreeBuilderTest, CSSClipFixedPositionDescendantNonShared) {
const ObjectPaintProperties* overflow_properties =
overflow.FirstFragment().PaintProperties();
EXPECT_EQ(DocContentClip(), overflow_properties->OverflowClip()->Parent());
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
overflow_properties->ScrollTranslation()->Parent()->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(DocPreTranslation());
EXPECT_EQ(DocPreTranslation(),
overflow_properties->ScrollTranslation()->Parent()->Parent());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
overflow_properties->ScrollTranslation()->Parent()->Parent());
}
CHECK_EXACT_VISUAL_RECT(LayoutRect(0, 0, 50, 50), &overflow,
GetDocument().View()->GetLayoutView());
......@@ -2983,21 +3095,44 @@ TEST_P(PaintPropertyTreeBuilderTest, OverflowClipContentsTreeState) {
clipper->FirstFragment().PaintProperties();
LayoutObject* child = GetLayoutObjectByElementId("child");
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_FALSE(DocScrollTranslation());
EXPECT_TRUE(DocPreTranslation());
EXPECT_EQ(DocPreTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
}
EXPECT_EQ(DocContentClip(),
clipper->FirstFragment().LocalBorderBoxProperties().Clip());
auto contents_properties = clipper->FirstFragment().ContentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), clipper->FirstFragment().PaintOffset());
EXPECT_EQ(DocPreTranslation(), contents_properties.Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(), contents_properties.Transform());
} else {
EXPECT_EQ(DocScrollTranslation(), contents_properties.Transform());
}
EXPECT_EQ(clip_properties->OverflowClip(), contents_properties.Clip());
EXPECT_EQ(DocPreTranslation(),
child->FirstFragment().LocalBorderBoxProperties().Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
child->FirstFragment().LocalBorderBoxProperties().Transform());
} else {
EXPECT_EQ(DocScrollTranslation(),
child->FirstFragment().LocalBorderBoxProperties().Transform());
}
EXPECT_EQ(clip_properties->OverflowClip(),
child->FirstFragment().LocalBorderBoxProperties().Clip());
......@@ -3022,21 +3157,43 @@ TEST_P(PaintPropertyTreeBuilderTest, ContainsPaintContentsTreeState) {
clipper->FirstFragment().PaintProperties();
LayoutObject* child = GetLayoutObjectByElementId("child");
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_FALSE(DocScrollTranslation());
EXPECT_TRUE(DocPreTranslation());
EXPECT_EQ(DocPreTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
}
EXPECT_EQ(DocContentClip(),
clipper->FirstFragment().LocalBorderBoxProperties().Clip());
auto contents_properties = clipper->FirstFragment().ContentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), clipper->FirstFragment().PaintOffset());
EXPECT_EQ(DocPreTranslation(), contents_properties.Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(), contents_properties.Transform());
} else {
EXPECT_EQ(DocScrollTranslation(), contents_properties.Transform());
}
EXPECT_EQ(clip_properties->OverflowClip(), contents_properties.Clip());
EXPECT_EQ(DocPreTranslation(),
child->FirstFragment().LocalBorderBoxProperties().Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(),
child->FirstFragment().LocalBorderBoxProperties().Transform());
} else {
EXPECT_EQ(DocScrollTranslation(),
child->FirstFragment().LocalBorderBoxProperties().Transform());
}
EXPECT_EQ(clip_properties->OverflowClip(),
child->FirstFragment().LocalBorderBoxProperties().Clip());
......@@ -3158,18 +3315,32 @@ TEST_P(PaintPropertyTreeBuilderTest, CssClipContentsTreeState) {
clipper->FirstFragment().PaintProperties();
LayoutObject* child = GetLayoutObjectByElementId("child");
// No scroll translation because the document does not scroll (not enough
// content).
EXPECT_TRUE(!DocScrollTranslation());
EXPECT_EQ(DocPreTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(DocPreTranslation());
EXPECT_EQ(DocPreTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
EXPECT_EQ(DocScrollTranslation(),
clipper->FirstFragment().LocalBorderBoxProperties().Transform());
}
// CSS clip on an element causes it to clip itself, not just descendants.
EXPECT_EQ(clip_properties->CssClip(),
clipper->FirstFragment().LocalBorderBoxProperties().Clip());
auto contents_properties = clipper->FirstFragment().ContentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), clipper->FirstFragment().PaintOffset());
EXPECT_EQ(DocPreTranslation(), contents_properties.Transform());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(), contents_properties.Transform());
} else {
EXPECT_EQ(DocScrollTranslation(), contents_properties.Transform());
}
EXPECT_EQ(clip_properties->CssClip(), contents_properties.Clip());
CHECK_EXACT_VISUAL_RECT(LayoutRect(0, 0, 400, 500), child, clipper);
......@@ -3203,7 +3374,13 @@ TEST_P(PaintPropertyTreeBuilderTest,
EXPECT_EQ(
paint_offset_translation,
svg_with_view_box.FirstFragment().LocalBorderBoxProperties().Transform());
EXPECT_EQ(DocPreTranslation(), paint_offset_translation->Parent());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(), paint_offset_translation->Parent());
} else {
EXPECT_EQ(DocScrollTranslation(), paint_offset_translation->Parent());
}
EXPECT_EQ(FloatSize(30, 20),
paint_offset_translation->Matrix().To2DTranslation());
EXPECT_EQ(LayoutPoint(0, 0), svg_with_view_box.FirstFragment().PaintOffset());
......@@ -3276,12 +3453,18 @@ TEST_P(PaintPropertyTreeBuilderTest, FrameOverflowHiddenScrollProperties) {
GetDocument().View()->UpdateAllLifecyclePhases();
// Because the overflow hidden does not scroll and only has a static scroll
// offset, there should be a scroll translation node but no scroll node.
EXPECT_EQ(TransformationMatrix().Translate(0, -37),
DocScrollTranslation()->Matrix());
EXPECT_EQ(nullptr, DocScrollTranslation()->ScrollNode());
EXPECT_EQ(nullptr, DocScroll());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(nullptr, DocScrollTranslation()->ScrollNode());
EXPECT_EQ(nullptr, DocScroll());
} else {
EXPECT_TRUE(DocScrollTranslation()->ScrollNode());
EXPECT_TRUE(DocScroll());
}
}
TEST_P(PaintPropertyTreeBuilderTest, NestedScrollProperties) {
......@@ -3326,17 +3509,12 @@ TEST_P(PaintPropertyTreeBuilderTest, NestedScrollProperties) {
auto* scroll_a_translation =
overflow_a_scroll_properties->ScrollTranslation();
auto* overflow_a_scroll_node = scroll_a_translation->ScrollNode();
// TODO(bokan): Viewport property node generation has been disabled
// temporarily with the flag off to diagnose https//crbug.com/868927.
if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
EXPECT_EQ(GetDocument()
.GetPage()
->GetVisualViewport()
.GetScrollTranslationNode()
->ScrollNode(),
overflow_a_scroll_node->Parent());
} else {
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(overflow_a_scroll_node->Parent()->IsRoot());
} else {
EXPECT_EQ(DocScroll(), overflow_a_scroll_node->Parent());
}
EXPECT_EQ(TransformationMatrix().Translate(0, -37),
scroll_a_translation->Matrix());
......@@ -3519,17 +3697,12 @@ TEST_P(PaintPropertyTreeBuilderTest, NestedPositionedScrollProperties) {
auto* scroll_a_translation =
overflow_a_scroll_properties->ScrollTranslation();
auto* overflow_a_scroll_node = scroll_a_translation->ScrollNode();
// TODO(bokan): Viewport property node generation has been disabled
// temporarily with the flag off to diagnose https//crbug.com/868927.
if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
EXPECT_EQ(GetDocument()
.GetPage()
->GetVisualViewport()
.GetScrollTranslationNode()
->ScrollNode(),
overflow_a_scroll_node->Parent());
} else {
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(overflow_a_scroll_node->Parent()->IsRoot());
} else {
EXPECT_EQ(DocScroll(), overflow_a_scroll_node->Parent());
}
EXPECT_EQ(TransformationMatrix().Translate(0, -37),
scroll_a_translation->Matrix());
......@@ -4812,17 +4985,12 @@ TEST_P(PaintPropertyTreeBuilderTest, ScrollBoundsOffset) {
auto* scroll_translation = scroll_properties->ScrollTranslation();
auto* paint_offset_translation = scroll_properties->PaintOffsetTranslation();
auto* scroll_node = scroll_translation->ScrollNode();
// TODO(bokan): Viewport property node generation has been disabled
// temporarily with the flag off to diagnose https//crbug.com/868927.
if (RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()) {
EXPECT_EQ(GetDocument()
.GetPage()
->GetVisualViewport()
.GetScrollTranslationNode()
->ScrollNode(),
scroll_node->Parent());
} else {
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_TRUE(scroll_node->Parent()->IsRoot());
} else {
EXPECT_EQ(DocScroll(), scroll_node->Parent());
}
EXPECT_EQ(TransformationMatrix().Translate(0, -42),
scroll_translation->Matrix());
......@@ -4913,7 +5081,14 @@ TEST_P(PaintPropertyTreeBuilderTest, FrameBorderRadius) {
radius, radius),
border_radius_clip->ClipRect());
EXPECT_EQ(DocContentClip(), border_radius_clip->Parent());
EXPECT_EQ(DocPreTranslation(), border_radius_clip->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(), border_radius_clip->LocalTransformSpace());
} else {
EXPECT_EQ(DocScrollTranslation(),
border_radius_clip->LocalTransformSpace());
}
EXPECT_EQ(nullptr, properties->InnerBorderRadiusClip());
}
......@@ -4940,7 +5115,14 @@ TEST_P(PaintPropertyTreeBuilderTest, ImageBorderRadius) {
radius),
border_radius_clip->ClipRect());
EXPECT_EQ(DocContentClip(), border_radius_clip->Parent());
EXPECT_EQ(DocPreTranslation(), border_radius_clip->LocalTransformSpace());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_EQ(DocPreTranslation(), border_radius_clip->LocalTransformSpace());
} else {
EXPECT_EQ(DocScrollTranslation(),
border_radius_clip->LocalTransformSpace());
}
EXPECT_EQ(nullptr, properties->InnerBorderRadiusClip());
}
......@@ -5176,9 +5358,15 @@ TEST_P(PaintPropertyTreeBuilderTest, RootHasCompositedScrolling) {
Element* force_scroll_element = GetDocument().getElementById("forceScroll");
force_scroll_element->setAttribute(HTMLNames::styleAttr, "");
GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint();
// Without scrolling, the root should not have direct compositing reasons or
// even a scroll node.
EXPECT_EQ(nullptr, DocScrollTranslation());
// TODO(crbug.com/732611): SPv2 invalidations are incorrect if there is
// scrolling.
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EXPECT_FALSE(DocScrollTranslation());
} else {
// Always create scroll translation for layout view even the document does
// not scroll (not enough content).
EXPECT_TRUE(DocScrollTranslation());
}
}
TEST_P(PaintPropertyTreeBuilderTest, IframeDoesNotRequireCompositedScrolling) {
......
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