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

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

Issue 2672833004: Invalidate width available to children if style diff needs full layout (Closed)
Patch Set: rebase Created 3 years, 10 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/LayoutBlock.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/LayoutBlockTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp
index a12acfb5202b02d252c807ee3203cf5d7b79e957..013e6fca70ee97ac6624d6d032e80482f4efaa2e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "core/dom/ElementTraversal.h"
#include "core/layout/LayoutBlock.h"
#include "core/layout/LayoutBlockFlow.h"
@@ -20,4 +21,33 @@ TEST_F(LayoutBlockTest, LayoutNameCalledWithNullStyle) {
obj->destroy();
}
+TEST_F(LayoutBlockTest, WidthAvailableToChildrenChanged) {
+ RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false);
+ setBodyInnerHTML(
+ "<!DOCTYPE html>"
+ "<div id='list' style='overflow-y:auto; width:150px; height:100px'>"
+ " <div style='height:20px'>Item</div>"
+ " <div style='height:20px'>Item</div>"
+ " <div style='height:20px'>Item</div>"
+ " <div style='height:20px'>Item</div>"
+ " <div style='height:20px'>Item</div>"
+ " <div style='height:20px'>Item</div>"
+ "</div>");
+ Element* listElement = document().getElementById("list");
+ ASSERT_TRUE(listElement);
+ LayoutBox* listBox = toLayoutBox(listElement->layoutObject());
+ Element* itemElement = ElementTraversal::firstChild(*listElement);
+ ASSERT_TRUE(itemElement);
+ ASSERT_GT(listBox->verticalScrollbarWidth(), 0);
+ ASSERT_EQ(itemElement->offsetWidth(),
+ 150 - listBox->verticalScrollbarWidth());
+
+ DummyExceptionStateForTesting exceptionState;
+ listElement->style()->setCSSText("width:150px;height:100px;", exceptionState);
+ ASSERT_FALSE(exceptionState.hadException());
+ document().view()->updateAllLifecyclePhases();
+ ASSERT_EQ(listBox->verticalScrollbarWidth(), 0);
+ ASSERT_EQ(itemElement->offsetWidth(), 150);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698