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

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

Issue 1805283002: [SPv2] Fix paint offset computation for LayoutTableCell in property tree builder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/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/LayoutView.h" 7 #include "core/layout/LayoutView.h"
8 #include "core/paint/ObjectPaintProperties.h" 8 #include "core/paint/ObjectPaintProperties.h"
9 #include "platform/graphics/paint/TransformPaintPropertyNode.h" 9 #include "platform/graphics/paint/TransformPaintPropertyNode.h"
10 #include "platform/testing/UnitTestHelpers.h" 10 #include "platform/testing/UnitTestHelpers.h"
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 LayoutObject& scroller = *document().getElementById("scroller")->layoutObjec t(); 672 LayoutObject& scroller = *document().getElementById("scroller")->layoutObjec t();
673 ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties() ; 673 ObjectPaintProperties* scrollerProperties = scroller.objectPaintProperties() ;
674 LayoutObject& child = *document().getElementById("child")->layoutObject(); 674 LayoutObject& child = *document().getElementById("child")->layoutObject();
675 ObjectPaintProperties* childProperties = child.objectPaintProperties(); 675 ObjectPaintProperties* childProperties = child.objectPaintProperties();
676 676
677 EXPECT_EQ(frameView->contentClip(), childProperties->localBorderBoxPropertie s()->clip); 677 EXPECT_EQ(frameView->contentClip(), childProperties->localBorderBoxPropertie s()->clip);
678 EXPECT_EQ(frameView->scrollTranslation(), childProperties->localBorderBoxPro perties()->transform); 678 EXPECT_EQ(frameView->scrollTranslation(), childProperties->localBorderBoxPro perties()->transform);
679 EXPECT_EQ(scrollerProperties->effect(), childProperties->localBorderBoxPrope rties()->effect); 679 EXPECT_EQ(scrollerProperties->effect(), childProperties->localBorderBoxPrope rties()->effect);
680 } 680 }
681 681
682 TEST_F(PaintPropertyTreeBuilderTest, TableCellLayoutLocation)
683 {
684 // This test verifies that the border box space of a table cell is being cor rectly computed.
685 // Table cells have weird location adjustment in our layout/paint implementa tion.
686 setBodyInnerHTML(
687 "<style>"
688 " body {"
689 " margin: 0;"
690 " }"
691 " table {"
692 " border-spacing: 0;"
693 " margin: 20px;"
694 " padding: 40px;"
695 " border: 10px solid black;"
696 " }"
697 " td {"
698 " width: 100px;"
699 " height: 100px;"
700 " padding: 0;"
701 " }"
702 " #target {"
703 " position: relative;"
704 " width: 100px;"
705 " height: 100px;"
706 " }"
707 "</style>"
708 "<table>"
709 " <tr><td></td><td></td></tr>"
710 " <tr><td></td><td><div id='target'></div></td></tr>"
711 "</table>"
712 );
713
714 FrameView* frameView = document().view();
715 LayoutObject& target = *document().getElementById("target")->layoutObject();
716 ObjectPaintProperties* targetProperties = target.objectPaintProperties();
717
718 EXPECT_EQ(LayoutPoint(170, 170), targetProperties->localBorderBoxProperties( )->paintOffset);
719 EXPECT_EQ(frameView->scrollTranslation(), targetProperties->localBorderBoxPr operties()->transform);
720 }
721
682 } // namespace blink 722 } // 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