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

Unified Diff: LayoutTests/fast/css/invalidation/targeted-id-style-invalidation.html

Issue 220123004: Add support for element ids in TargetedStyleRecalc (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adjust test. Created 6 years, 9 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/invalidation/targeted-id-style-invalidation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/targeted-id-style-invalidation.html
diff --git a/LayoutTests/fast/css/invalidation/targeted-attribute-style-invalidation.html b/LayoutTests/fast/css/invalidation/targeted-id-style-invalidation.html
similarity index 81%
copy from LayoutTests/fast/css/invalidation/targeted-attribute-style-invalidation.html
copy to LayoutTests/fast/css/invalidation/targeted-id-style-invalidation.html
index 7ffb6044c5a3e40c618720cdb39277c6adf6a825..4b822e3df75e1356d5bc283ea888e67e354b34d8 100644
--- a/LayoutTests/fast/css/invalidation/targeted-attribute-style-invalidation.html
+++ b/LayoutTests/fast/css/invalidation/targeted-id-style-invalidation.html
@@ -3,14 +3,14 @@
<style>
div { width: 100px }
- [outer="1"] [inner="1"] { width: 200px }
- [outer="2"] { width: 150px }
- [outer="3"][nomatch="1"] { width: 300px; }
+ #outer1on #inner1on { width: 200px }
+ #outer2on { width: 150px }
+ #outer3on#nomatch1 { width: 300px; }
</style>
<div id="outer">
<div id="mid">
- <div id="inner" inner="1">
+ <div id="inner1on">
<div id="innerChild">
</div>
</div>
@@ -27,7 +27,7 @@
</div>
<script>
-description("Test that adding and removing class names only updates the elements that are affected.");
+description("Test that adding and removing ids only updates the elements that are affected.");
function insertStyleSheet(css)
{
@@ -37,7 +37,7 @@ function insertStyleSheet(css)
}
var outer = document.getElementById('outer');
-var inner = document.getElementById('inner');
+var inner = document.getElementById('inner1on');
var outer2 = document.getElementById('outer2');
var outer3 = document.getElementById('outer3');
@@ -49,7 +49,7 @@ else
// Style recalc should happen on "inner" and "outer", but not "inner2" or "mid".
outer.offsetTop;
-outer.setAttribute('outer', '1');
+outer.id = 'outer1on';
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '' + count);
shouldBe("getComputedStyle(inner).width", '"200px"');
@@ -60,7 +60,7 @@ else
// Style recalc should happen on "inner", but not "innerChild".
inner.offsetTop;
-inner.removeAttribute('inner');
+inner.id = '';
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '' + count);
shouldBe("getComputedStyle(inner).width", '"100px"');
@@ -71,7 +71,7 @@ else
// Style recalc should happen on "outer2", but not "inner3".
outer2.offsetTop;
-outer2.setAttribute('outer', '2');
+outer2.id = 'outer2on';
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '' + count);
shouldBe("getComputedStyle(outer2).width", '"150px"');
@@ -82,6 +82,6 @@ else
// Style recalc should happen on "outer3", but none of its children.
outer3.offsetTop;
-outer3.setAttribute('outer', '3');
+outer3.id = 'outer3on';
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '' + count);
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/targeted-id-style-invalidation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698