| 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 da1c58804a77623961a6f2c10dca1c6e3aa4328f..862fe81b072b2d47e3853ac0e8776a07a48fff5c 100644
|
| --- a/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/TextAutosizerTest.cpp
|
| @@ -774,4 +774,46 @@ TEST_F(TextAutosizerTest, ResizeAndGlyphOverflowChanged) {
|
| IntSize(360, 640));
|
| GetDocument().View()->UpdateAllLifecyclePhases();
|
| }
|
| +
|
| +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
|
|
|