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

Unified Diff: third_party/WebKit/LayoutTests/shadow-dom/layout-update-on-slotassignment.html

Issue 2085853004: Force reattach all shadow host's children (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/shadow-dom/layout-update-on-slotassignment.html
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/layout-update-on-slotassignment.html b/third_party/WebKit/LayoutTests/shadow-dom/layout-update-on-slotassignment.html
new file mode 100644
index 0000000000000000000000000000000000000000..03ec0e1cdb3c70a17397ce8b7b38f7d4dc7cdbb1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/shadow-dom/layout-update-on-slotassignment.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<script src='../resources/testharness.js'></script>
+<script src='../resources/testharnessreport.js'></script>
+<script src='resources/shadow-dom.js'></script>
+<div id='host' class='container'>
+ <template data-mode='open' data-expose-as='root'>
+ <div id='container' style='position: relative'>
+ <slot name='x'></slot>
+ </div>
+ </template>
+ <span id='target' slot='x'>X</span>
+</div>
+
+<script>
+test(() => {
+ // Update layout and make layout clean.
+ document.body.offsetTop;
+ // Change slotting to make layout dirty.
+ convertTemplatesToShadowRootsWithin(host);
+ var slot = root.querySelector('slot');
+ assert_equals(slot.assignedNodes()[0].id, 'target', 'make sure the element is assigned to slot');
+ assert_equals(target.offsetParent.id, 'container', 'offsetParent should return layout tree parent.');
+}, 'slotting change should cause layout recalculation.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698