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

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

Issue 2817443003: Fix font-size shaking issue in some pages (Closed)
Patch Set: rebase layout-after-append.html Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/TextAutosizer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp b/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp
index b6fdb705e83f0f5073a0e77eb7aea56d397a0e30..8875de4b2a1d00b840bc0a9021291cd87c65a91d 100644
--- a/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp
+++ b/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp
@@ -811,4 +811,45 @@ TEST_F(TextAutosizerTest, narrowContentInsideNestedWideBlock) {
content->GetLayoutObject()->Style()->ComputedFontSize());
}
+TEST_F(TextAutosizerTest, LayoutViewWidthProvider) {
+ Element* html = GetDocument().body()->parentElement();
+ html->setInnerHTML(
+ "<head>"
+ " <meta name='viewport' content='width=800'>"
+ " <style>"
+ " html { font-size:16px;}"
+ " #content {margin-left: 140px;}"
+ " </style>"
+ "</head>"
+ "<body>"
+ " <div id='content'>"
+ " Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do"
+ " eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim"
+ " ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut"
+ " aliquip ex ea commodo consequat. Duis aute irure dolor in"
+ " reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla"
+ " pariatur. Excepteur sint occaecat cupidatat non proident, sunt in"
+ " culpa qui officia deserunt mollit anim id est laborum."
+ " </div>"
+ " <div id='panel'></div>"
+ "</body>",
+ ASSERT_NO_EXCEPTION);
+ GetDocument().View()->UpdateAllLifecyclePhases();
+
+ Element* content = GetDocument().getElementById("content");
+ // (specified font-size = 16px) * (viewport width = 800px) /
+ // (window width = 320px) = 40px.
+ EXPECT_FLOAT_EQ(40.f,
+ content->GetLayoutObject()->Style()->ComputedFontSize());
+
+ GetDocument().getElementById("panel")->setInnerHTML("insert text");
+ content->setInnerHTML(content->innerHTML());
+ GetDocument().View()->UpdateAllLifecyclePhases();
+
+ // (specified font-size = 16px) * (viewport width = 800px) /
+ // (window width = 320px) = 40px.
+ EXPECT_FLOAT_EQ(40.f,
+ content->GetLayoutObject()->Style()->ComputedFontSize());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/TextAutosizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698