- Revision
- 120816
- Author
- [email protected]
- Date
- 2012-06-20 04:48:24 -0700 (Wed, 20 Jun 2012)
Log Message
applyAuthorStyles makes rules declared in all enclosing shadow dom subtrees applicable.
https://bugs.webkit.org/show_bug.cgi?id=89061
Patch by Takashi Sakamoto <[email protected]> on 2012-06-20
Reviewed by Dimitri Glazkov.
Source/WebCore:
Fixing apply-author-styles bug. If there exists some shadow subtree A
and A has apply-author-styles flag set, whether some rules declared in
a tree B is applicable in A or not depends on:
- the tree B encloses the tree A, and
- all trees which enclose A and are enclosed by B has
apply-author-styles set.
c.f.
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles
However the second rule was not implemented.
Test: fast/css/style-scoped/style-scoped-apply-author-styles.html
* css/StyleResolver.cpp:
(WebCore::StyleResolver::setupScopeStack):
Modified to add a new member variable, authorStyleBoundsIndex to
ScopeStackFrame used by m_scopeStack. The index means: if shadow dom
subtree A and B has the same value and A encloses B, all shadow dom
subtrees which enclose B and are enclosed by B have
apply-author-styles set. And B also has apply-author-styles set.
This means, if some element X has authorStyleBoundsIndex N, all
rulesets whose scopes have authorStyleBoundsIndex N are applicable in
B's tree scope. If all shadow dom subtrees have apply-author-styles
unset, the index looks almost the same as treeScope(). In this case,
Rules in different tree scopes have different author style bounds
index.
(WebCore::StyleResolver::pushScope):
(WebCore::StyleResolver::popScope):
Added the code for updating m_scopeStackParentBoundsIndex. The member
variable keeps m_scopeStackParent's author style bounds index.
(WebCore::StyleResolver::matchScopedAuthorRules):
Modified to consider author style's bounds index. Firstly applying
scoped styles declared in document if apply-author-styles is set.
Next, applying scoped styles declared in shadow dom subtree with
considering author style bounds index, i.e. considering
apply-author-styles flag.
* css/StyleResolver.h:
(WebCore::StyleResolver::ScopeStackFrame::ScopeStackFrame):
(ScopeStackFrame):
Added m_authorStyleBoundsIndex to keep apply-author-styles flag
information. m_authorStyleBoundsIndex increments by 1 if shadow root is
given and it has apply-author-styles unset.
Now rules in the same authorStyleBoundsIndex should be applied.
(StyleResolver):
Added m_scopeStackParentBoundsIndex.
As m_scopeStackParentAuthorStyleBoundsIndex is a little long,
used m_scopeStackParentBoundsIndex.
LayoutTests:
* fast/css/style-scoped/style-scoped-apply-author-styles-expected.txt: Added.
* fast/css/style-scoped/style-scoped-apply-author-styles.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (120815 => 120816)
--- trunk/LayoutTests/ChangeLog 2012-06-20 11:07:53 UTC (rev 120815)
+++ trunk/LayoutTests/ChangeLog 2012-06-20 11:48:24 UTC (rev 120816)
@@ -1,3 +1,13 @@
+2012-06-20 Takashi Sakamoto <[email protected]>
+
+ applyAuthorStyles makes rules declared in all enclosing shadow dom subtrees applicable.
+ https://bugs.webkit.org/show_bug.cgi?id=89061
+
+ Reviewed by Dimitri Glazkov.
+
+ * fast/css/style-scoped/style-scoped-apply-author-styles-expected.txt: Added.
+ * fast/css/style-scoped/style-scoped-apply-author-styles.html: Added.
+
2012-06-20 Sergio Villar Senin <[email protected]>
Unreviewed GTK gardening. Removed some tests from TestExpectations
Added: trunk/LayoutTests/fast/css/style-scoped/style-scoped-apply-author-styles-expected.txt (0 => 120816)
--- trunk/LayoutTests/fast/css/style-scoped/style-scoped-apply-author-styles-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css/style-scoped/style-scoped-apply-author-styles-expected.txt 2012-06-20 11:48:24 UTC (rev 120816)
@@ -0,0 +1,38 @@
+PASS window.internals is defined.
+PASS window.internals.ensureShadowRoot is defined.
+PASS WebKitShadowRoot is defined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+test a scoped style in document is applied to a node in shadow dom subtree when apply-author-styles is true.
+target: rgb(0, 0, 0)
+target: rgb(255, 0, 0)
+test a style in an enclosing shadow dom tree is applied to a node in shadow subtree when apply-author-styles is true.
+target: rgb(0, 0, 0)
+target: rgb(255, 0, 0)
+test a scoped style in an enclosing shadow dom tree is applied to a node in shadow subtree when apply-author-styles is true and the node is in the scope.
+targetInScope: rgb(0, 0, 0)
+targetOutOfScope: rgb(0, 0, 0)
+targetInScope: rgb(255, 0, 0)
+targetOutOfScope: rgb(0, 0, 0)
+test a style in a shadow subtree is applied to a node in its descendant shadow subtree when all apply-author-styles in shadow subtrees between the shadow subtree and the descendant are true.
+target: rgb(0, 0, 0)
+target: rgb(255, 0, 0)
+target: rgb(0, 0, 255)
+test a style in document is applied to nodes in multiple shadow subtrees when apply-author-styles is true.
+oldestShadow: rgb(0, 0, 0)
+olderShadow: rgb(0, 0, 255)
+target: rgb(0, 0, 0)
+oldestShadow: rgb(0, 0, 0)
+olderShadow: rgb(0, 0, 255)
+target: rgb(255, 0, 0)
+oldestShadow: rgb(0, 0, 0)
+olderShadow: rgb(0, 0, 255)
+target: rgb(0, 0, 0)
+oldestShadow: rgb(255, 0, 0)
+olderShadow: rgb(0, 0, 255)
+target: rgb(0, 0, 0)
+test a style is applied in document order.
+target: rgb(255, 255, 0)
+target: rgb(0, 128, 0)
+
Added: trunk/LayoutTests/fast/css/style-scoped/style-scoped-apply-author-styles.html (0 => 120816)
--- trunk/LayoutTests/fast/css/style-scoped/style-scoped-apply-author-styles.html (rev 0)
+++ trunk/LayoutTests/fast/css/style-scoped/style-scoped-apply-author-styles.html 2012-06-20 11:48:24 UTC (rev 120816)
@@ -0,0 +1,225 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+shouldBeDefined("window.internals");
+shouldBeDefined("window.internals.ensureShadowRoot");
+shouldBeDefined("WebKitShadowRoot");
+
+function dumpComputedStyle(node)
+{
+ debug(node.id + ": " + document.defaultView.getComputedStyle(node, null).getPropertyValue('border-color'));
+}
+
+function testBasic()
+{
+ debug('test a scoped style in document is applied to a node in shadow dom subtree when apply-author-styles is true.');
+ var div = document.createElement('div');
+ div.innerHTML = '<div><style scoped>div { border: 1px solid red; }</style><div id="host"></div></div>';
+ document.body.appendChild(div);
+
+ var shadow = new WebKitShadowRoot(document.getElementById("host"));
+ shadow.innerHTML = '<div id="target">target</div>';
+ document.body.appendChild(div);
+
+ // before
+ shadow.applyAuthorStyles = false;
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ // after
+ shadow.applyAuthorStyles = true;
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ document.body.removeChild(div);
+}
+
+function testEnclosingShadow()
+{
+ debug('test a style in an enclosing shadow dom tree is applied to a node in shadow subtree when apply-author-styles is true.');
+
+ var div = document.createElement('div');
+ document.body.appendChild(div);
+
+ var outerShadow = new WebKitShadowRoot(div);
+ outerShadow.innerHTML = '<style>div { border: 1px solid red; }</style><div id="outer">outer</div>';
+ var shadow = new WebKitShadowRoot(outerShadow.getElementById("outer"));
+ shadow.innerHTML = '<div id="target">target</div>';
+
+ // before
+ shadow.applyAuthorStyles = false;
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ // after
+ shadow.applyAuthorStyles = true;
+ dumpComputedStyle(shadow.getElementById("target"));
+ document.body.removeChild(div);
+}
+
+function testEnclosingShadowWithScoped()
+{
+ debug('test a scoped style in an enclosing shadow dom tree is applied to a node in shadow subtree when apply-author-styles is true and the node is in the scope.');
+
+ var div = document.createElement('div');
+ document.body.appendChild(div);
+
+ var outerShadow = new WebKitShadowRoot(div);
+ outerShadow.innerHTML = '<div><style scoped>div { border: 1px solid red; }</style><div id="outerInScope">outerInScope</div></div><div id="outerOutOfScope">outerOutOfScope</div>';
+
+ var shadow1 = new WebKitShadowRoot(outerShadow.getElementById("outerInScope"));
+ shadow1.innerHTML = '<div id="targetInScope">targetInScope</div>';
+ var shadow2 = new WebKitShadowRoot(outerShadow.getElementById("outerOutOfScope"));
+ shadow2.innerHTML = '<div id="targetOutOfScope">targetOutOfScope</div>';
+
+ // before
+ shadow1.applyAuthorStyles = false;
+ shadow2.applyAuthorStyles = false;
+ dumpComputedStyle(shadow1.getElementById("targetInScope"));
+ dumpComputedStyle(shadow2.getElementById("targetOutOfScope"));
+
+ // after
+ shadow1.applyAuthorStyles = true;
+ shadow2.applyAuthorStyles = true;
+ dumpComputedStyle(shadow1.getElementById("targetInScope"));
+ dumpComputedStyle(shadow2.getElementById("targetOutOfScope"));
+
+ document.body.removeChild(div);
+}
+
+function testNestedShadow()
+{
+ debug('test a style in a shadow subtree is applied to a node in its descendant shadow subtree when all apply-author-styles in shadow subtrees between the shadow subtree and the descendant are true.');
+
+ var div = document.createElement('div');
+ div.innerHTML = '<style scoped>div { border: 1px solid red }</style><div id="host"></div>';
+ document.body.appendChild(div);
+
+ var outerMostShadow = new WebKitShadowRoot(document.getElementById("host"));
+ outerMostShadow.innerHTML = '<style>div { border: 1px solid blue; }</style><div id="outerMost">outerMost</div>';
+ outerMostShadow.applyAuthorStyles = false;
+
+ var outerShadow = new WebKitShadowRoot(outerMostShadow.getElementById("outerMost"));
+ outerShadow.innerHTML = '<div id="outer">outer</div>';
+ outerShadow.applyAuthorStyles = false;
+
+ var shadow = new WebKitShadowRoot(outerShadow.getElementById("outer"));
+ shadow.innerHTML = '<div id="target">target</div>';
+ shadow.applyAuthorStyles = false;
+
+ // No styles should be applied.
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ shadow.applyAuthorStyles = true;
+ // A style in document should be applied.
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ outerShadow.applyAuthorStyles = true
+ // A style in 'outerMost' shadow should be applied.
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ document.body.removeChild(div);
+}
+
+function testMultipleShadow()
+{
+ debug('test a style in document is applied to nodes in multiple shadow subtrees when apply-author-styles is true.');
+
+ var div = document.createElement('div');
+ div.innerHTML = '<style scoped>div { border: 1px solid red }</style><div>test</div>';
+ document.body.appendChild(div);
+
+ var oldestShadow = new WebKitShadowRoot(div);
+ oldestShadow.innerHTML = '<shadow></shadow><div id="oldestShadow">oldestShadow</div>';
+ oldestShadow.applyAuthorStyles = false;
+
+ var olderShadow = new WebKitShadowRoot(div);
+ olderShadow.innerHTML = '<style scoped>div { border: 1px solid blue }</style><shadow></shadow><div id="olderShadow">olderShadow</div>';
+ olderShadow.applyAuthorStyles = false;
+
+ var shadow = new WebKitShadowRoot(div);
+ shadow.innerHTML = '<shadow></shadow><div id="target">shadow</div>';
+ shadow.applyAuthorStyles = false;
+
+ // before
+ dumpComputedStyle(oldestShadow.getElementById("oldestShadow"));
+ dumpComputedStyle(olderShadow.getElementById("olderShadow"));
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ // document ---+--- oldestShadow
+ // |
+ // +--- olderShadow
+ // |
+ // +--- shadow
+
+ // apply-author-styles affects between shadow and document.
+ shadow.applyAuthorStyles = true;
+ dumpComputedStyle(oldestShadow.getElementById("oldestShadow"));
+ dumpComputedStyle(olderShadow.getElementById("olderShadow"));
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ // apply-author-styles affects between older shadow and document.
+ shadow.applyAuthorStyles = false;
+ olderShadow.applyAuthorStyles = true;
+ dumpComputedStyle(oldestShadow.getElementById("oldestShadow"));
+ dumpComputedStyle(olderShadow.getElementById("olderShadow"));
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ // apply-author-styles affects between oldest shadow and document.
+ olderShadow.applyAuthorStyles = false;
+ oldestShadow.applyAuthorStyles = true;
+ dumpComputedStyle(oldestShadow.getElementById("oldestShadow"));
+ dumpComputedStyle(olderShadow.getElementById("olderShadow"));
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ document.body.removeChild(div);
+}
+
+function testOrderOfApplyStyle()
+{
+ debug('test a style is applied in document order.');
+
+ var div = document.createElement('div');
+ div.innerHTML = '<style scoped>div { border: 1px solid red }</style><div id="host"></div>';
+ document.body.appendChild(div);
+
+ var outerMostShadow = new WebKitShadowRoot(document.getElementById("host"));
+ outerMostShadow.innerHTML = '<style>div { border: 1px solid blue; }</style><div id="outerMost">outerMost</div>';
+ outerMostShadow.applyAuthorStyles = true;
+
+ var outerShadow = new WebKitShadowRoot(outerMostShadow.getElementById("outerMost"));
+ outerShadow.innerHTML = '<style>div { border: 1px solid green; }</style><div id="outer">outer</div>';
+ outerShadow.applyAuthorStyles = true;
+
+ var shadow = new WebKitShadowRoot(outerShadow.getElementById("outer"));
+ shadow.innerHTML = '<style>div { border: 1px solid yellow; }</style><div id="target">target</div>';
+ shadow.applyAuthorStyles = true;
+
+ // The last scoped style should be applied.
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ shadow.innerHTML = '<div id="target">target</div>';
+ // The outer's scoped style should be applied.
+ dumpComputedStyle(shadow.getElementById("target"));
+
+ document.body.removeChild(div);
+}
+
+function runTests() {
+ testBasic();
+ testEnclosingShadow();
+ testEnclosingShadowWithScoped();
+ testNestedShadow();
+ testMultipleShadow();
+ testOrderOfApplyStyle();
+}
+
+</script>
+</head>
+<body _onload_="runTests()">
+ <script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (120815 => 120816)
--- trunk/Source/WebCore/ChangeLog 2012-06-20 11:07:53 UTC (rev 120815)
+++ trunk/Source/WebCore/ChangeLog 2012-06-20 11:48:24 UTC (rev 120816)
@@ -1,3 +1,57 @@
+2012-06-20 Takashi Sakamoto <[email protected]>
+
+ applyAuthorStyles makes rules declared in all enclosing shadow dom subtrees applicable.
+ https://bugs.webkit.org/show_bug.cgi?id=89061
+
+ Reviewed by Dimitri Glazkov.
+
+ Fixing apply-author-styles bug. If there exists some shadow subtree A
+ and A has apply-author-styles flag set, whether some rules declared in
+ a tree B is applicable in A or not depends on:
+ - the tree B encloses the tree A, and
+ - all trees which enclose A and are enclosed by B has
+ apply-author-styles set.
+ c.f.
+ http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles
+ However the second rule was not implemented.
+
+ Test: fast/css/style-scoped/style-scoped-apply-author-styles.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::setupScopeStack):
+ Modified to add a new member variable, authorStyleBoundsIndex to
+ ScopeStackFrame used by m_scopeStack. The index means: if shadow dom
+ subtree A and B has the same value and A encloses B, all shadow dom
+ subtrees which enclose B and are enclosed by B have
+ apply-author-styles set. And B also has apply-author-styles set.
+ This means, if some element X has authorStyleBoundsIndex N, all
+ rulesets whose scopes have authorStyleBoundsIndex N are applicable in
+ B's tree scope. If all shadow dom subtrees have apply-author-styles
+ unset, the index looks almost the same as treeScope(). In this case,
+ Rules in different tree scopes have different author style bounds
+ index.
+ (WebCore::StyleResolver::pushScope):
+ (WebCore::StyleResolver::popScope):
+ Added the code for updating m_scopeStackParentBoundsIndex. The member
+ variable keeps m_scopeStackParent's author style bounds index.
+ (WebCore::StyleResolver::matchScopedAuthorRules):
+ Modified to consider author style's bounds index. Firstly applying
+ scoped styles declared in document if apply-author-styles is set.
+ Next, applying scoped styles declared in shadow dom subtree with
+ considering author style bounds index, i.e. considering
+ apply-author-styles flag.
+ * css/StyleResolver.h:
+ (WebCore::StyleResolver::ScopeStackFrame::ScopeStackFrame):
+ (ScopeStackFrame):
+ Added m_authorStyleBoundsIndex to keep apply-author-styles flag
+ information. m_authorStyleBoundsIndex increments by 1 if shadow root is
+ given and it has apply-author-styles unset.
+ Now rules in the same authorStyleBoundsIndex should be applied.
+ (StyleResolver):
+ Added m_scopeStackParentBoundsIndex.
+ As m_scopeStackParentAuthorStyleBoundsIndex is a little long,
+ used m_scopeStackParentBoundsIndex.
+
2012-06-20 Amy Ousterhout <[email protected]>
Adds DeviceMotionClientMock
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (120815 => 120816)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2012-06-20 11:07:53 UTC (rev 120815)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2012-06-20 11:48:24 UTC (rev 120816)
@@ -372,6 +372,7 @@
#endif
#if ENABLE(STYLE_SCOPED)
, m_scopeStackParent(0)
+ , m_scopeStackParentBoundsIndex(0)
#endif
{
Element* root = document->documentElement();
@@ -564,13 +565,17 @@
ASSERT(!m_scopedAuthorStyles.isEmpty());
m_scopeStack.shrink(0);
+ int authorStyleBoundsIndex = 0;
for (const ContainerNode* scope = parent; scope; scope = scope->parentOrHostNode()) {
RuleSet* ruleSet = ruleSetForScope(scope);
if (ruleSet)
- m_scopeStack.append(ScopeStackFrame(scope, ruleSet));
+ m_scopeStack.append(ScopeStackFrame(scope, authorStyleBoundsIndex, ruleSet));
+ if (scope->isShadowRoot() && !toShadowRoot(scope)->applyAuthorStyles())
+ --authorStyleBoundsIndex;
}
m_scopeStack.reverse();
m_scopeStackParent = parent;
+ m_scopeStackParentBoundsIndex = 0;
}
void StyleResolver::pushScope(const ContainerNode* scope, const ContainerNode* scopeParent)
@@ -587,10 +592,12 @@
setupScopeStack(scope);
return;
}
+ if (scope->isShadowRoot() && !toShadowRoot(scope)->applyAuthorStyles())
+ ++m_scopeStackParentBoundsIndex;
// Otherwise just push the parent onto the stack.
RuleSet* ruleSet = ruleSetForScope(scope);
if (ruleSet)
- m_scopeStack.append(ScopeStackFrame(scope, ruleSet));
+ m_scopeStack.append(ScopeStackFrame(scope, m_scopeStackParentBoundsIndex, ruleSet));
m_scopeStackParent = scope;
}
@@ -600,6 +607,8 @@
if (scopeStackIsConsistent(scope)) {
if (!m_scopeStack.isEmpty() && m_scopeStack.last().m_scope == scope)
m_scopeStack.removeLast();
+ if (scope->isShadowRoot() && !toShadowRoot(scope)->applyAuthorStyles())
+ --m_scopeStackParentBoundsIndex;
m_scopeStackParent = scope->parentOrHostNode();
}
}
@@ -926,22 +935,38 @@
MatchOptions options(includeEmptyRules);
// Match scoped author rules by traversing the scoped element stack (rebuild it if it got inconsistent).
- const ContainerNode* parent = m_element->parentOrHostNode();
- if (!scopeStackIsConsistent(parent))
- setupScopeStack(parent);
- for (size_t i = m_scopeStack.size(); i; --i) {
- const ScopeStackFrame& frame = m_scopeStack[i - 1];
+ if (!scopeStackIsConsistent(m_element))
+ setupScopeStack(m_element);
+
+ unsigned int firstShadowScopeIndex = 0;
+ if (m_element->treeScope()->applyAuthorStyles()) {
+ unsigned i;
+ for (i = 0; i < m_scopeStack.size() && !m_scopeStack[i].m_scope->isInShadowTree(); ++i) {
+ const ScopeStackFrame& frame = m_scopeStack[i];
+ options.scope = frame.m_scope;
+ collectMatchingRules(frame.m_ruleSet, result.ranges.firstAuthorRule, result.ranges.lastAuthorRule, options);
+ collectMatchingRulesForRegion(frame.m_ruleSet, result.ranges.firstAuthorRule, result.ranges.lastAuthorRule, options);
+ }
+ firstShadowScopeIndex = i;
+ }
+
+ if (!m_element->isInShadowTree() || m_scopeStack.isEmpty())
+ return;
+
+ unsigned scopedIndex = m_scopeStack.size();
+ int authorStyleBoundsIndex = m_scopeStackParentBoundsIndex;
+ for ( ; scopedIndex > firstShadowScopeIndex; --scopedIndex) {
+ if (authorStyleBoundsIndex != m_scopeStack[scopedIndex - 1].m_authorStyleBoundsIndex)
+ break;
+ }
+
+ // Ruleset for ancestor nodes should be applied first.
+ for (unsigned i = scopedIndex; i < m_scopeStack.size(); ++i) {
+ const ScopeStackFrame& frame = m_scopeStack[i];
options.scope = frame.m_scope;
collectMatchingRules(frame.m_ruleSet, result.ranges.firstAuthorRule, result.ranges.lastAuthorRule, options);
collectMatchingRulesForRegion(frame.m_ruleSet, result.ranges.firstAuthorRule, result.ranges.lastAuthorRule, options);
}
- // Also include the current element.
- RuleSet* ruleSet = ruleSetForScope(m_element);
- if (ruleSet) {
- options.scope = m_element;
- collectMatchingRules(ruleSet, result.ranges.firstAuthorRule, result.ranges.lastAuthorRule, options);
- collectMatchingRulesForRegion(ruleSet, result.ranges.firstAuthorRule, result.ranges.lastAuthorRule, options);
- }
#else
UNUSED_PARAM(result);
UNUSED_PARAM(includeEmptyRules);
Modified: trunk/Source/WebCore/css/StyleResolver.h (120815 => 120816)
--- trunk/Source/WebCore/css/StyleResolver.h 2012-06-20 11:07:53 UTC (rev 120815)
+++ trunk/Source/WebCore/css/StyleResolver.h 2012-06-20 11:48:24 UTC (rev 120816)
@@ -531,9 +531,10 @@
ScopedRuleSetMap m_scopedAuthorStyles;
struct ScopeStackFrame {
- ScopeStackFrame() : m_scope(0), m_ruleSet(0) { }
- ScopeStackFrame(const ContainerNode* scope, RuleSet* ruleSet) : m_scope(scope), m_ruleSet(ruleSet) { }
+ ScopeStackFrame() : m_scope(0), m_authorStyleBoundsIndex(0), m_ruleSet(0) { }
+ ScopeStackFrame(const ContainerNode* scope, int authorStyleBoundsIndex, RuleSet* ruleSet) : m_scope(scope), m_authorStyleBoundsIndex(authorStyleBoundsIndex), m_ruleSet(ruleSet) { }
const ContainerNode* m_scope;
+ int m_authorStyleBoundsIndex;
RuleSet* m_ruleSet;
};
// Vector (used as stack) that keeps track of scoping elements (i.e., elements with a <style scoped> child)
@@ -542,6 +543,7 @@
// Element last seen as parent element when updating m_scopingElementStack.
// This is used to decide whether m_scopingElementStack is consistent, separately from SelectorChecker::m_parentStack.
const ContainerNode* m_scopeStackParent;
+ int m_scopeStackParentBoundsIndex;
#endif
friend class StyleBuilder;