| Index: third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp b/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
|
| index e62026ec9a2d63c9b05fdea6e2d35cd0caf23a9e..dce66ba0d1990ac457d707a2fbed0fb6ba93f9fc 100644
|
| --- a/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
|
| @@ -144,7 +144,13 @@ TEST_F(StyleEngineTest, RuleSetInvalidationTypeSelectors) {
|
| "<div>"
|
| " <span></span>"
|
| " <div></div>"
|
| - "</div>");
|
| + "</div>"
|
| + "<b></b><b></b><b></b><b></b>"
|
| + "<i id=i>"
|
| + " <i>"
|
| + " <b></b>"
|
| + " </i>"
|
| + "</i>");
|
|
|
| document().view()->updateAllLifecyclePhases();
|
|
|
| @@ -167,6 +173,43 @@ TEST_F(StyleEngineTest, RuleSetInvalidationTypeSelectors) {
|
| EXPECT_EQ(
|
| scheduleInvalidationsForRules(document(), "div * { background: green}"),
|
| RuleSetInvalidationFullRecalc);
|
| + document().view()->updateAllLifecyclePhases();
|
| +
|
| + beforeCount = styleEngine().styleForElementCount();
|
| + EXPECT_EQ(
|
| + scheduleInvalidationsForRules(document(), "#i b { background: green}"),
|
| + RuleSetInvalidationsScheduled);
|
| + document().view()->updateAllLifecyclePhases();
|
| + afterCount = styleEngine().styleForElementCount();
|
| + EXPECT_EQ(1u, afterCount - beforeCount);
|
| +}
|
| +
|
| +TEST_F(StyleEngineTest, RuleSetInvalidationClass) {
|
| + document().body()->setInnerHTML(
|
| + "<div class='container'>"
|
| + " <div class='x'></div>"
|
| + "</div>"
|
| + "<div class='x'></div>"
|
| + "<div class='x'></div>"
|
| + "<div class='x'></div>");
|
| +
|
| + document().view()->updateAllLifecyclePhases();
|
| +
|
| + unsigned beforeCount = styleEngine().styleForElementCount();
|
| + EXPECT_EQ(
|
| + scheduleInvalidationsForRules(document(), ".x { background: green }"),
|
| + RuleSetInvalidationsScheduled);
|
| + document().view()->updateAllLifecyclePhases();
|
| + unsigned afterCount = styleEngine().styleForElementCount();
|
| + EXPECT_EQ(4u, afterCount - beforeCount);
|
| +
|
| + beforeCount = afterCount;
|
| + EXPECT_EQ(scheduleInvalidationsForRules(
|
| + document(), ".container .x { background: green }"),
|
| + RuleSetInvalidationsScheduled);
|
| + document().view()->updateAllLifecyclePhases();
|
| + afterCount = styleEngine().styleForElementCount();
|
| + EXPECT_EQ(1u, afterCount - beforeCount);
|
| }
|
|
|
| TEST_F(StyleEngineTest, RuleSetInvalidationHost) {
|
|
|