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 9fa9b1a039e23d3e39cb4b3fdd6268187b522f94..7b6bb39e0245e9809bca46fe7c1500d7bbc0a26c 100644 |
--- a/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp |
+++ b/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp |
@@ -719,7 +719,7 @@ TEST_F(TextAutosizerTest, ResizeAndGlyphOverflowChanged) { |
Element* html = document().body()->parentElement(); |
html->setInnerHTML( |
"<head>" |
- " <meta name='viewport' content='800'>" |
+ " <meta name='viewport' content='width=800'>" |
" <style>" |
" html { font-size:16px; font-family:'Times New Roman';}" |
" </style>" |
@@ -752,4 +752,44 @@ TEST_F(TextAutosizerTest, ResizeAndGlyphOverflowChanged) { |
document().settings()->setTextAutosizingWindowSizeOverride(IntSize(360, 640)); |
document().view()->updateAllLifecyclePhases(); |
} |
+ |
+TEST_F(TextAutosizerTest, LayoutViewWidthProvider) { |
+ Element* html = document().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); |
+ document().view()->updateAllLifecyclePhases(); |
+ |
+ Element* content = document().getElementById("content"); |
+ // (specified font-size = 16px) * (viewport width = 800px) / |
+ // (window width = 320px) = 40px. |
+ EXPECT_FLOAT_EQ(40.f, content->layoutObject()->style()->computedFontSize()); |
+ |
+ document().getElementById("panel")->setInnerHTML("insert text"); |
+ content->setInnerHTML(content->innerHTML()); |
+ document().view()->updateAllLifecyclePhases(); |
+ |
+ // (specified font-size = 16px) * (viewport width = 800px) / |
+ // (window width = 320px) = 40px. |
+ EXPECT_FLOAT_EQ(40.f, content->layoutObject()->style()->computedFontSize()); |
+} |
+ |
} // namespace blink |