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

Side by Side Diff: Source/core/dom/DocumentTest.cpp

Issue 1333193004: Increment style version for all style changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Increment style version in scheduleLayoutTreeUpdate Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 EXPECT_EQ("https://www.example.com/hoge", document().outgoingReferrer()); 317 EXPECT_EQ("https://www.example.com/hoge", document().outgoingReferrer());
318 } 318 }
319 319
320 TEST_F(DocumentTest, OutgoingReferrerWithUniqueOrigin) 320 TEST_F(DocumentTest, OutgoingReferrerWithUniqueOrigin)
321 { 321 {
322 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo")); 322 document().setURL(KURL(KURL(), "https://www.example.com/hoge#fuga?piyo"));
323 document().setSecurityOrigin(SecurityOrigin::createUnique()); 323 document().setSecurityOrigin(SecurityOrigin::createUnique());
324 EXPECT_EQ(String(), document().outgoingReferrer()); 324 EXPECT_EQ(String(), document().outgoingReferrer());
325 } 325 }
326 326
327 TEST_F(DocumentTest, StyleVersion)
328 {
329 setHtmlInnerHTML(
330 "<style>"
331 " .a * { color: green }"
332 " .b .c { color: green }"
333 "</style>"
334 "<div id='x'><span class='c'></span></div>");
335
336 Element* element = document().getElementById("x");
337 EXPECT_TRUE(element);
338
339 uint64_t previousStyleVersion = document().styleVersion();
340 element->setAttribute(blink::HTMLNames::classAttr, "notfound");
341 EXPECT_EQ(previousStyleVersion, document().styleVersion());
342
343 document().view()->updateAllLifecyclePhases();
344
345 previousStyleVersion = document().styleVersion();
346 element->setAttribute(blink::HTMLNames::classAttr, "a");
347 EXPECT_NE(previousStyleVersion, document().styleVersion());
348
349 document().view()->updateAllLifecyclePhases();
350
351 previousStyleVersion = document().styleVersion();
352 element->setAttribute(blink::HTMLNames::classAttr, "a b");
353 EXPECT_NE(previousStyleVersion, document().styleVersion());
354 }
355
327 } // namespace blink 356 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698