diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/dom/DocumentTest.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/dom/DocumentTest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/core/dom/DocumentTest.cpp b/chromium/third_party/WebKit/Source/core/dom/DocumentTest.cpp index 1937e46252a..aadc52838ab 100644 --- a/chromium/third_party/WebKit/Source/core/dom/DocumentTest.cpp +++ b/chromium/third_party/WebKit/Source/core/dom/DocumentTest.cpp @@ -916,4 +916,24 @@ TEST_F(DocumentTest, GetDocument().Lifecycle().GetState()); } +// Tests that the difference in computed style of direction on the html and body +// elements does not trigger a style recalc for viewport style propagation when +// the computed style for another element in the document is recalculated. +TEST_F(DocumentTest, ViewportPropagationNoRecalc) { + SetHtmlInnerHTML( + "<body style='direction:rtl'>" + " <div id=recalc></div>" + "</body>"); + + int old_element_count = GetDocument().GetStyleEngine().StyleForElementCount(); + + Element* div = GetDocument().getElementById("recalc"); + div->setAttribute("style", "color:green"); + GetDocument().UpdateStyleAndLayoutTree(); + + int new_element_count = GetDocument().GetStyleEngine().StyleForElementCount(); + + EXPECT_EQ(1, new_element_count - old_element_count); +} + } // namespace blink |