diff options
Diffstat (limited to 'layout/reftests/css-ruby/dynamic-removal.js')
-rw-r--r-- | layout/reftests/css-ruby/dynamic-removal.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/layout/reftests/css-ruby/dynamic-removal.js b/layout/reftests/css-ruby/dynamic-removal.js new file mode 100644 index 000000000..f258f28cf --- /dev/null +++ b/layout/reftests/css-ruby/dynamic-removal.js @@ -0,0 +1,14 @@ +function getElements(className) { + return Array.from(document.getElementsByClassName(className)); +} +window.onload = function() { + // Force a reflow before any changes. + document.body.clientWidth; + + getElements('remove').forEach(function(e) { + e.parentNode.removeChild(e); + }); + getElements('remove-after').forEach(function(e) { + e.parentNode.removeChild(e.nextSibling); + }); +}; |