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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp

Issue 2068723002: Paint local attachment backgrounds into composited scrolling contents layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add/update tests and simplify added code. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
index e89af5b107787ae323f747ebc74f500f58fcfcd8..5d7f480a49cbad84194fba7e821b15cf1653ae13 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
@@ -24,4 +24,13 @@ TEST_F(LayoutBoxTest, BackgroundObscuredInRect)
ASSERT_TRUE(layoutObject->backgroundIsKnownToBeObscured());
}
+TEST_F(LayoutBoxTest, BackgroundRect)
chrishtr 2016/08/12 17:03:00 Add more tests for other cases.
flackr 2016/08/16 17:52:51 I added tests which I think cover all of the speci
+{
+ setBodyInnerHTML("<style>#target { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUg) border-box, green content-box; width: 100px; height: 100px; padding: 10px; border: 10px solid black;}</style>"
+ "<div id='target'></div>");
+ LayoutBox* layoutBox = toLayoutBox(getLayoutObjectByElementId("target"));
+ EXPECT_EQ(LayoutRect(20, 20, 100, 100), layoutBox->backgroundRect(OpaqueBackgroundRect));
+ EXPECT_EQ(LayoutRect(0, 0, 140, 140), layoutBox->backgroundRect(TranslucentBackgroundRect));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698