diff --git a/src/declaration/styles.js b/src/declaration/styles.js index f094fde450..f6a22024ef 100644 --- a/src/declaration/styles.js +++ b/src/declaration/styles.js @@ -26,6 +26,7 @@ */ installSheets: function() { this.cacheSheets(); + this.cacheStyles(); this.installLocalSheets(); this.installGlobalStyles(); }, @@ -40,6 +41,14 @@ } }); }, + cacheStyles: function() { + this.styles = this.findNodes(STYLE_SELECTOR + '[' + SCOPE_ATTR + ']'); + this.styles.forEach(function(s) { + if (s.parentNode) { + s.parentNode.removeChild(s); + } + }); + }, /** * Takes external stylesheets loaded in an element and moves * their content into a + + + +
1
+
2
+
3
+
4
+ + + + + + + + + + + + + + + diff --git a/test/js/styling.js b/test/js/styling.js index 6655a99520..45de82b1a1 100644 --- a/test/js/styling.js +++ b/test/js/styling.js @@ -5,6 +5,7 @@ */ htmlSuite('styling', function() { htmlTest('html/styling/sheet-order.html'); + htmlTest('html/styling/sheet-scope.html'); htmlTest('html/styling/sheet-main-doc.html'); htmlTest('html/styling/apply-reset-styles.html'); });