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

Unified Diff: LayoutTests/fast/css/pseudo-empty-adjacent-dynamic.html

Issue 558333002: Don't clear StyleAffectedByEmpty before recalc. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/pseudo-empty-adjacent-dynamic-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/pseudo-empty-adjacent-dynamic.html
diff --git a/LayoutTests/fast/css/pseudo-empty-adjacent-dynamic.html b/LayoutTests/fast/css/pseudo-empty-adjacent-dynamic.html
new file mode 100644
index 0000000000000000000000000000000000000000..8fdbd40591785395bc345b47e1d69f52b7a029cf
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-empty-adjacent-dynamic.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<style>
+:empty + div { background-color: green; }
+</style>
+<div id="empty">To be removed</div>
+<div id="sibling">This text should be green</div>
+<script>
+description("Check that the sibling of an element that becomes :empty is properly recalculated");
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+empty.offsetTop; // force recalc
+empty.style.color = "red"; // force LocalStyleChange on #empty
+empty.offsetTop; // force recalc
+
+shouldBe("getComputedStyle(sibling, '').backgroundColor", "transparent");
+
+empty.removeChild(empty.firstChild);
+empty.offsetTop; // force recalc
+
+shouldBe("getComputedStyle(sibling, '').backgroundColor", "green");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/pseudo-empty-adjacent-dynamic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698