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

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

Issue 2510513002: Issue paint offset for SVGText, etc. (Closed)
Patch Set: Created 4 years, 1 month 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
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/layout/LayoutTestHelper.h" 5 #include "core/layout/LayoutTestHelper.h"
6 #include "core/layout/LayoutTreeAsText.h" 6 #include "core/layout/LayoutTreeAsText.h"
7 #include "core/layout/api/LayoutViewItem.h" 7 #include "core/layout/api/LayoutViewItem.h"
8 #include "core/paint/ObjectPaintProperties.h" 8 #include "core/paint/ObjectPaintProperties.h"
9 #include "core/paint/PaintPropertyTreePrinter.h" 9 #include "core/paint/PaintPropertyTreePrinter.h"
10 #include "platform/graphics/paint/GeometryMapper.h" 10 #include "platform/graphics/paint/GeometryMapper.h"
(...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 setBodyInnerHTML( 2580 setBodyInnerHTML(
2581 "<svg id='svg' xmlns='http://www.w3.org/2000/svg' width='100px' " 2581 "<svg id='svg' xmlns='http://www.w3.org/2000/svg' width='100px' "
2582 "height='100px' style='overflow: visible'>" 2582 "height='100px' style='overflow: visible'>"
2583 " <rect width='200' height='200' fill='red' />" 2583 " <rect width='200' height='200' fill='red' />"
2584 "</svg>"); 2584 "</svg>");
2585 2585
2586 EXPECT_FALSE( 2586 EXPECT_FALSE(
2587 getLayoutObjectByElementId("svg")->paintProperties()->overflowClip()); 2587 getLayoutObjectByElementId("svg")->paintProperties()->overflowClip());
2588 } 2588 }
2589 2589
2590 TEST_P(PaintPropertyTreeBuilderTest, SVGTextPaintOffset) {
2591 setBodyInnerHTML(
2592 "<svg xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'>"
2593 " <text id='text' x='77' y='88'>"
2594 " TEXT"
2595 " <tspan id='tspan' x='20' y='20'>TSPAN</tspan>"
2596 " </text>"
2597 "</svg>");
2598
2599 LayoutObject* text = getLayoutObjectByElementId("text");
2600 LayoutObject* tspan = getLayoutObjectByElementId("tspan");
2601 LayoutPoint textPaintOffset = text->previousPaintOffset();
2602 EXPECT_EQ(toLayoutBox(text)->location(), textPaintOffset);
2603 // All inline and text descendants share the same paint offset.
2604 EXPECT_EQ(textPaintOffset, text->slowFirstChild()->previousPaintOffset());
2605 EXPECT_EQ(textPaintOffset, tspan->previousPaintOffset());
2606 EXPECT_EQ(textPaintOffset, tspan->slowFirstChild()->previousPaintOffset());
2607 }
2608
2590 TEST_P(PaintPropertyTreeBuilderTest, 2609 TEST_P(PaintPropertyTreeBuilderTest,
2591 ThreadedScrollingDisabledMainThreadScrollReason) { 2610 ThreadedScrollingDisabledMainThreadScrollReason) {
2592 setBodyInnerHTML( 2611 setBodyInnerHTML(
2593 "<style>" 2612 "<style>"
2594 " #overflowA {" 2613 " #overflowA {"
2595 " position: absolute;" 2614 " position: absolute;"
2596 " overflow: scroll;" 2615 " overflow: scroll;"
2597 " width: 20px;" 2616 " width: 20px;"
2598 " height: 20px;" 2617 " height: 20px;"
2599 " }" 2618 " }"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 EXPECT_EQ(framePreTranslation(), 2935 EXPECT_EQ(framePreTranslation(),
2917 childProperties->paintOffsetTranslation()->parent()); 2936 childProperties->paintOffsetTranslation()->parent());
2918 EXPECT_EQ(childProperties->paintOffsetTranslation(), 2937 EXPECT_EQ(childProperties->paintOffsetTranslation(),
2919 childPaintState.transform()); 2938 childPaintState.transform());
2920 // This will change once we added clip expansion node. 2939 // This will change once we added clip expansion node.
2921 EXPECT_EQ(filterProperties->effect()->outputClip(), childPaintState.clip()); 2940 EXPECT_EQ(filterProperties->effect()->outputClip(), childPaintState.clip());
2922 EXPECT_EQ(filterProperties->effect(), childPaintState.effect()); 2941 EXPECT_EQ(filterProperties->effect(), childPaintState.effect());
2923 } 2942 }
2924 2943
2925 } // namespace blink 2944 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698