Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp

Issue 2819923003: [SPInvalidation, SPv2] Compute paint offset for paginated content (Closed)
Patch Set: none Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintPropertyTreeBuilderTest.h" 5 #include "core/paint/PaintPropertyTreeBuilderTest.h"
6 6
7 #include "core/html/HTMLIFrameElement.h" 7 #include "core/html/HTMLIFrameElement.h"
8 #include "core/layout/LayoutTreeAsText.h" 8 #include "core/layout/LayoutTreeAsText.h"
9 #include "core/paint/ObjectPaintProperties.h" 9 #include "core/paint/ObjectPaintProperties.h"
10 #include "core/paint/PaintPropertyTreePrinter.h" 10 #include "core/paint/PaintPropertyTreePrinter.h"
(...skipping 2938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2949 " <div id=bottom-right class=abs style='bottom: 0; right: 0'></div>" 2949 " <div id=bottom-right class=abs style='bottom: 0; right: 0'></div>"
2950 " </div>" 2950 " </div>"
2951 " <div id=space3 class=space></div>" 2951 " <div id=space3 class=space></div>"
2952 " <div id=space4 class=space></div>" 2952 " <div id=space4 class=space></div>"
2953 " </div>" 2953 " </div>"
2954 "</div>"); 2954 "</div>");
2955 2955
2956 // Above the spanner. 2956 // Above the spanner.
2957 // Column 1. 2957 // Column 1.
2958 EXPECT_EQ(LayoutPoint(), GetLayoutObjectByElementId("space1")->PaintOffset()); 2958 EXPECT_EQ(LayoutPoint(), GetLayoutObjectByElementId("space1")->PaintOffset());
2959 // Column 2. TODO(crbug.com/648274): This is incorrect. Should be (100, 0). 2959 EXPECT_EQ(LayoutPoint(100, 0),
2960 EXPECT_EQ(LayoutPoint(0, 30),
2961 GetLayoutObjectByElementId("space2")->PaintOffset()); 2960 GetLayoutObjectByElementId("space2")->PaintOffset());
2962 2961
2963 // The spanner's normal flow. 2962 // The spanner's normal flow.
2964 EXPECT_EQ(LayoutPoint(0, 30), 2963 EXPECT_EQ(LayoutPoint(0, 30),
2965 GetLayoutObjectByElementId("spanner")->PaintOffset()); 2964 GetLayoutObjectByElementId("spanner")->PaintOffset());
2966 EXPECT_EQ(LayoutPoint(0, 30), 2965 EXPECT_EQ(LayoutPoint(0, 30),
2967 GetLayoutObjectByElementId("normal")->PaintOffset()); 2966 GetLayoutObjectByElementId("normal")->PaintOffset());
2968 2967
2969 // Below the spanner. 2968 // Below the spanner.
2970 // Column 1. TODO(crbug.com/648274): This is incorrect. Should be (0, 80). 2969 EXPECT_EQ(LayoutPoint(0, 80),
2971 EXPECT_EQ(LayoutPoint(0, 60),
2972 GetLayoutObjectByElementId("space3")->PaintOffset()); 2970 GetLayoutObjectByElementId("space3")->PaintOffset());
2973 // Column 2. TODO(crbug.com/648274): This is incorrect. Should be (100, 80). 2971 EXPECT_EQ(LayoutPoint(100, 80),
2974 EXPECT_EQ(LayoutPoint(0, 90),
2975 GetLayoutObjectByElementId("space4")->PaintOffset()); 2972 GetLayoutObjectByElementId("space4")->PaintOffset());
2976 2973
2977 // Out-of-flow positioned descendants of the spanner. They are laid out in 2974 // Out-of-flow positioned descendants of the spanner. They are laid out in
2978 // the relative-position container. 2975 // the relative-position container.
2979 2976
2980 // "top-left" should be aligned to the top-left corner of space1. 2977 // "top-left" should be aligned to the top-left corner of space1.
2981 EXPECT_EQ(LayoutPoint(0, 0), 2978 EXPECT_EQ(LayoutPoint(0, 0),
2982 GetLayoutObjectByElementId("top-left")->PaintOffset()); 2979 GetLayoutObjectByElementId("top-left")->PaintOffset());
2983 2980
2984 // "bottom-right" should be aligned to the bottom-right corner of space4. 2981 // "bottom-right" should be aligned to the bottom-right corner of space4.
2985 // TODO(crbug.com/648274): This is incorrect. Should be (180, 90). 2982 EXPECT_EQ(LayoutPoint(180, 90),
2986 EXPECT_EQ(LayoutPoint(80, 100),
2987 GetLayoutObjectByElementId("bottom-right")->PaintOffset()); 2983 GetLayoutObjectByElementId("bottom-right")->PaintOffset());
2988 } 2984 }
2989 2985
2990 // Ensures no crash with multi-column containing relative-position inline with 2986 // Ensures no crash with multi-column containing relative-position inline with
2991 // spanner with absolute-position children. 2987 // spanner with absolute-position children.
2992 TEST_P(PaintPropertyTreeBuilderTest, 2988 TEST_P(PaintPropertyTreeBuilderTest,
2993 MultiColumnInlineRelativeAndSpannerAndAbsPos) { 2989 MultiColumnInlineRelativeAndSpannerAndAbsPos) {
2994 SetBodyInnerHTML( 2990 SetBodyInnerHTML(
2995 "<div style='columns:2; width: 200px; column-gap: 0'>" 2991 "<div style='columns:2; width: 200px; column-gap: 0'>"
2996 " <span style='position: relative'>" 2992 " <span style='position: relative'>"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
3460 3456
3461 LayoutObject& svg_root = 3457 LayoutObject& svg_root =
3462 *GetDocument().GetElementById("svgroot")->GetLayoutObject(); 3458 *GetDocument().GetElementById("svgroot")->GetLayoutObject();
3463 const ObjectPaintProperties* svg_root_properties = svg_root.PaintProperties(); 3459 const ObjectPaintProperties* svg_root_properties = svg_root.PaintProperties();
3464 EXPECT_TRUE(svg_root_properties->Effect()); 3460 EXPECT_TRUE(svg_root_properties->Effect());
3465 EXPECT_EQ(EffectPaintPropertyNode::Root(), 3461 EXPECT_EQ(EffectPaintPropertyNode::Root(),
3466 svg_root_properties->Effect()->Parent()); 3462 svg_root_properties->Effect()->Parent());
3467 } 3463 }
3468 3464
3469 } // namespace blink 3465 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698