Diff
Modified: trunk/LayoutTests/ChangeLog (119798 => 119799)
--- trunk/LayoutTests/ChangeLog 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/LayoutTests/ChangeLog 2012-06-08 05:29:01 UTC (rev 119799)
@@ -1,3 +1,15 @@
+2012-06-07 Takashi Sakamoto <[email protected]>
+
+ ShadowRoot needs resetStyleInheritance
+ https://bugs.webkit.org/show_bug.cgi?id=84048
+
+ Added layout tests for checking whether resetStyleInheritance works correctly or not.
+
+ Reviewed by Hajime Morita.
+
+ * fast/dom/shadow/shadow-root-resetStyleInheritance.html: Added.
+ * fast/dom/shadow/shadow-root-resetStyleInheritance-expected.html: Added.
+
2012-06-07 Kinuko Yasuda <[email protected]>
Fix unmatched parenthesis in fast/dom/HTMLAnchorElement/anchor-download-unset.html
Added: trunk/LayoutTests/fast/dom/shadow/shadow-root-resetStyleInheritance-expected.html (0 => 119799)
--- trunk/LayoutTests/fast/dom/shadow/shadow-root-resetStyleInheritance-expected.html (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-root-resetStyleInheritance-expected.html 2012-06-08 05:29:01 UTC (rev 119799)
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div.resetTest {
+ background-color: #eef;
+ border: solid;
+ margin: 4px;
+ padding: 16px;
+ color: #fee;
+ font-family: Serif;
+ font-size: 24px;
+ font-style: italic;
+ font-variant: small-caps;
+ font-weight: bold;
+ letter-spacing: 2px;
+ line-height: 200%;
+ text-align: start;
+ text-indent: 50px;
+ text-transform: uppercase;
+ white-space: nowrap;
+ word-spacing: 30px;
+}
+div.initialValues {
+ color: initial;
+ font-family: initial;
+ font-size: initial;
+ font-style: initial;
+ font-variant: initial;
+ font-weight: initial;
+ letter-spacing: initial;
+ line-height: initial;
+ text-align: initial;
+ text-indent: initial;
+ text-transform: initial;
+ white-space: initial;
+ word-spacing: initial;
+}
+</style>
+</head>
+<body>
+<div><div class="resetTest"><div class="initialValues">text</div></div></div>
+<div><div class="resetTest"><div>text</div></div></div>
+<div><div class="resetTest"><div>text</div></div></div>
+<div><div class="resetTest"><div class="initialValues">text</div></div></div>
+<div><div class="resetTest"><div class="initialValues">text</div></div></div>
+<div><div class="resetTest"><div>text</div></div></div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/dom/shadow/shadow-root-resetStyleInheritance.html (0 => 119799)
--- trunk/LayoutTests/fast/dom/shadow/shadow-root-resetStyleInheritance.html (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-root-resetStyleInheritance.html 2012-06-08 05:29:01 UTC (rev 119799)
@@ -0,0 +1,169 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div.resetTest {
+ background-color: #eef;
+ border: solid;
+ margin: 4px;
+ padding: 16px;
+ color: #fee;
+ font-family: Serif;
+ font-size: 24px;
+ font-style: italic;
+ font-variant: small-caps;
+ font-weight: bold;
+ letter-spacing: 2px;
+ line-height: 200%;
+ text-align: start;
+ text-indent: 50px;
+ text-transform: uppercase;
+ white-space: nowrap;
+ word-spacing: 30px;
+}
+</style>
+<script>
+function assertTrue(id, actual) {
+ if (!actual)
+ throw "failure:" + id + ": assertTrue failed";
+}
+
+function assertFalse(id, actual) {
+ if (actual)
+ throw "failure:" + id + ": assertFalse failed";
+}
+
+function shouldBe(a, b)
+{
+ if (a != b)
+ throw "failure:" + a + ": should be " + b;
+}
+
+function shouldNotBe(a, b)
+{
+ if (a == b)
+ throw "failure:" + a + ": should not be " + b;
+}
+</script>
+<script src=""
+</head>
+<body>
+<div id="reset-style-inheritance"></div>
+<div id="no-reset-style-inheritance"></div>
+<div id="reset-style-inheritance-true-to-false"></div>
+<div id="reset-style-inheritance-false-to-true"></div>
+<div id="reset-style-inheritance-for-content"></div>
+<div id="no-reset-style-inheritance-for-content"></div>
+
+<script>
+function renderWithNoResetStyleInheritance() {
+ var div = document.createElement('div');
+ div.className = 'resetTest';
+
+ var shadowRoot = new WebKitShadowRoot(div);
+ assertFalse('default resetStyleInheritance should be false', shadowRoot.resetStyleInheritance);
+ shadowRoot.innerHTML = '<div>text</div>';
+
+ document.getElementById('no-reset-style-inheritance').appendChild(div);
+}
+
+function renderWithResetStyleInheritance() {
+ var div = document.createElement('div');
+ div.className = 'resetTest';
+
+ var shadowRoot = new WebKitShadowRoot(div);
+ assertFalse('default resetStyleInheritance should be false', shadowRoot.resetStyleInheritance);
+ shadowRoot.resetStyleInheritance = true;
+ shadowRoot.innerHTML = '<div>text</div>';
+ assertTrue('resetStyleInheritance should be true as explicitly set', shadowRoot.resetStyleInheritance);
+
+ document.getElementById('reset-style-inheritance').appendChild(div);
+}
+
+function renderWithChangingResetStyleInheritanceFromTrueToFalse() {
+ var div = document.createElement('div');
+ div.className = 'resetTest';
+
+ var shadowRoot = new WebKitShadowRoot(div);
+ assertFalse('default resetStyleInheritance should be false', shadowRoot.resetStyleInheritance);
+ shadowRoot.resetStyleInheritance = true;
+ shadowRoot.innerHTML = '<div id="test1">text</div>';
+ assertTrue('resetStyleInheritance should be true', shadowRoot.resetStyleInheritance);
+
+ document.getElementById('reset-style-inheritance-true-to-false').appendChild(div);
+ div.offsetLeft;
+ var target = shadowRoot.getElementById('test1');
+ shouldNotBe(window.getComputedStyle(target).getPropertyValue('font-family'), 'serif');
+ shouldNotBe(window.getComputedStyle(target).getPropertyValue('line-height'), '48px');
+
+ shadowRoot.resetStyleInheritance = false;
+ assertFalse('resetStyleInheritance should be false', shadowRoot.resetStyleInheritance);
+ div.offsetLeft;
+ shouldBe(window.getComputedStyle(target).getPropertyValue('font-family'), 'serif');
+ shouldBe(window.getComputedStyle(target).getPropertyValue('line-height'), '48px');
+}
+
+function renderWithChangingResetStyleInheritanceFromFalseToTrue() {
+ var div = document.createElement('div');
+ div.className = 'resetTest';
+
+ var shadowRoot = new WebKitShadowRoot(div);
+ assertFalse('default resetStyleInheritance should be false', shadowRoot.resetStyleInheritance);
+ shadowRoot.resetStyleInheritance = false;
+ shadowRoot.innerHTML = '<div id="test2">text</div>';
+ assertFalse('default resetStyleInheritance should be false', shadowRoot.resetStyleInheritance);
+
+ document.getElementById('reset-style-inheritance-false-to-true').appendChild(div);
+ div.offsetLeft;
+ var target = shadowRoot.getElementById('test2');
+ shouldBe(window.getComputedStyle(target).getPropertyValue('font-family'), 'serif');
+ shouldBe(window.getComputedStyle(target).getPropertyValue('line-height'), '48px');
+
+ shadowRoot.resetStyleInheritance = true;
+ assertTrue('resetStyleInheritance should be true', shadowRoot.resetStyleInheritance);
+ div.offsetLeft;
+ shouldNotBe(window.getComputedStyle(target).getPropertyValue('font-family'), 'serif');
+ shouldNotBe(window.getComputedStyle(target).getPropertyValue('line-height'), '48px');
+}
+
+function createDivWithText(text) {
+ var div = document.createElement('div');
+ div.appendChild(document.createTextNode(text));
+ return div;
+}
+
+function renderResetStyleInheritanceForContent() {
+ var div = document.createElement('div');
+ div.className = 'resetTest';
+ div.appendChild(createDivWithText('text'));
+
+ var shadowRoot = new WebKitShadowRoot(div);
+ shadowRoot.innerHTML = '<content select="div"></content>';
+ shadowRoot.resetStyleInheritance = true;
+ assertTrue('resetStyleInheritance should be true', shadowRoot.resetStyleInheritance);
+ document.getElementById('reset-style-inheritance-for-content').appendChild(div);
+ div.offsetLeft;
+}
+
+function renderNoResetStyleInheritanceForContent() {
+ var div = document.createElement('div');
+ div.className = 'resetTest';
+ div.appendChild(createDivWithText('text'));
+
+ var shadowRoot = new WebKitShadowRoot(div);
+ shadowRoot.innerHTML = '<content select="div"></content>';
+ shadowRoot.resetStyleInheritance = false;
+ assertFalse('resetStyleInheritance should be false', shadowRoot.resetStyleInheritance);
+ document.getElementById('no-reset-style-inheritance-for-content').appendChild(div);
+ div.offsetLeft;
+}
+
+renderWithNoResetStyleInheritance();
+renderWithResetStyleInheritance();
+renderWithChangingResetStyleInheritanceFromTrueToFalse();
+renderWithChangingResetStyleInheritanceFromFalseToTrue();
+renderResetStyleInheritanceForContent();
+renderNoResetStyleInheritanceForContent();
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (119798 => 119799)
--- trunk/Source/WebCore/ChangeLog 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/ChangeLog 2012-06-08 05:29:01 UTC (rev 119799)
@@ -1,3 +1,63 @@
+2012-06-07 Takashi Sakamoto <[email protected]>
+
+ ShadowRoot needs resetStyleInheritance
+ https://bugs.webkit.org/show_bug.cgi?id=84048
+
+ Added resetStyleInheritance API to ShadowRoot. The spec URL is
+ http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-attributes
+ To implement the API, modified StyleResolver to use empty style
+ instead of parent style if resetStyleInheritance is true,
+ and a node and its parent node are placed in different shadow trees.
+
+ Reviewed by Hajime Morita.
+
+ Test: fast/dom/shadow/shadow-root-resetStyleInheritance.html
+ fast/dom/shadow/shadow-root-resetStyleInheritance-expected.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::initForStyleResolve):
+ Set m_parentStyle to NULL when resetStyleInheritance.
+ (WebCore::StyleResolver::documentSettings):
+ Added a new method to obtain current document's settings.
+ (WebCore::StyleResolver::initializeFontStyle):
+ Initialize m_style by using document settings. Its code was move
+ from the code initializing font style in applyProperty.
+ (WebCore::StyleResolver::styleForElement):
+ Initialize font style if m_parentStyle is NULL. The old code just
+ used style() and don't touch font style. The new code uses the above
+ initializeFontStyle.
+ (WebCore::StyleResolver::applyProperty):
+ Moved a code for initializing font style as "initial" to
+ a new method: initializeFontStyle and modified to use the method.
+ Modified to use documentSettings().
+ (WebCore::StyleResolver::checkForGenericFamilyChange):
+ Modified to use documentSettings().
+ * css/StyleResolver.h:
+ (WebCore::StyleResolver::documentSettings):
+ (WebCore::StyleResolver::initializeFontStyle):
+ Added two new methods to class StyleResolver.
+ * dom/NodeRenderingContext.cpp:
+ (WebCore::NodeRenderingContext::NodeRenderingContext):
+ Modified to calculate m_resetStyleInheritance in its constructor.
+ * dom/NodeRenderingContext.h:
+ (WebCore::NodeRenderingContext::resetStyleInheritance):
+ Implemented a new method, just returning m_resetStyleInheritance.
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::setResetStyleInheritance):
+ Modified to force to recalculate children's styles if
+ resetStyleInheritance is changed.
+ * dom/ShadowRoot.h:
+ (ShadowRoot):
+ Added resetStyleInheritance getter and setter.
+ * dom/ShadowRoot.idl:
+ Added an attribute, resetStyleInheritance.
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::resetStyleInheritance):
+ * dom/TreeScope.h:
+ (TreeScope):
+ Added resetStyleInheritance's default getter.
+ The getter will be overrided by class ShadowRoot's getter.
+
2012-06-07 Victor Carbune <[email protected]>
addTextTrack should set track mode to HIDDEN
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (119798 => 119799)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2012-06-08 05:29:01 UTC (rev 119799)
@@ -78,6 +78,7 @@
#include "MediaList.h"
#include "MediaQueryEvaluator.h"
#include "NodeRenderStyle.h"
+#include "NodeRenderingContext.h"
#include "Page.h"
#include "PageGroup.h"
#include "Pair.h"
@@ -1163,12 +1164,16 @@
{
m_checker.setPseudoStyle(pseudoID);
- m_parentNode = e ? e->parentNodeForRenderingAndStyle() : 0;
-
- if (parentStyle)
+ if (e) {
+ NodeRenderingContext context(e);
+ m_parentNode = context.parentNodeForRenderingAndStyle();
+ m_parentStyle = context.resetStyleInheritance()? 0 :
+ parentStyle ? parentStyle :
+ m_parentNode ? m_parentNode->renderStyle() : 0;
+ } else {
+ m_parentNode = 0;
m_parentStyle = parentStyle;
- else
- m_parentStyle = m_parentNode ? m_parentNode->renderStyle() : 0;
+ }
Node* docElement = e ? e->document()->documentElement() : 0;
RenderStyle* docStyle = m_checker.document()->renderStyle();
@@ -1653,7 +1658,11 @@
else {
m_parentStyle = style();
// Make sure our fonts are initialized if we don't inherit them from our parent style.
- m_style->font().update(0);
+ if (Settings* settings = documentSettings()) {
+ initializeFontStyle(settings);
+ m_style->font().update(fontSelector());
+ } else
+ m_style->font().update(0);
}
// Even if surrounding content is user-editable, shadow DOM should act as a single unit, and not necessarily be editable
@@ -3347,7 +3356,7 @@
continue;
CSSPrimitiveValue* contentValue = static_cast<CSSPrimitiveValue*>(item);
AtomicString face;
- Settings* settings = m_checker.document()->settings();
+ Settings* settings = documentSettings();
if (contentValue->isString())
face = contentValue->getStringValue();
else if (settings) {
@@ -3431,24 +3440,11 @@
m_lineHeightValue = 0;
setFontDescription(fontDescription);
} else if (isInitial) {
- Settings* settings = m_checker.document()->settings();
+ Settings* settings = documentSettings();
ASSERT(settings); // If we're doing style resolution, this document should always be in a frame and thus have settings
if (!settings)
return;
- FontDescription fontDescription;
- fontDescription.setGenericFamily(FontDescription::StandardFamily);
- fontDescription.setRenderingMode(settings->fontRenderingMode());
- fontDescription.setUsePrinterFont(m_checker.document()->printing());
- const AtomicString& standardFontFamily = m_checker.document()->settings()->standardFontFamily();
- if (!standardFontFamily.isEmpty()) {
- fontDescription.firstFamily().setFamily(standardFontFamily);
- fontDescription.firstFamily().appendFamily(0);
- }
- fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
- setFontSize(fontDescription, fontSizeForKeyword(m_checker.document(), CSSValueMedium, false));
- m_style->setLineHeight(RenderStyle::initialLineHeight());
- m_lineHeightValue = 0;
- setFontDescription(fontDescription);
+ initializeFontStyle(settings);
} else if (primitiveValue) {
m_style->setLineHeight(RenderStyle::initialLineHeight());
m_lineHeightValue = 0;
@@ -3459,7 +3455,7 @@
// Double-check and see if the theme did anything. If not, don't bother updating the font.
if (fontDescription.isAbsoluteSize()) {
// Make sure the rendering mode and printer font settings are updated.
- Settings* settings = m_checker.document()->settings();
+ Settings* settings = documentSettings();
ASSERT(settings); // If we're doing style resolution, this document should always be in a frame and thus have settings
if (!settings)
return;
@@ -4912,7 +4908,7 @@
if (childFont.keywordSize())
size = fontSizeForKeyword(m_checker.document(), CSSValueXxSmall + childFont.keywordSize() - 1, childFont.useFixedDefaultSize());
else {
- Settings* settings = m_checker.document()->settings();
+ Settings* settings = documentSettings();
float fixedScaleFactor = settings
? static_cast<float>(settings->defaultFixedFontSize()) / settings->defaultFontSize()
: 1;
@@ -4926,6 +4922,24 @@
style->setFontDescription(newFontDescription);
}
+void StyleResolver::initializeFontStyle(Settings* settings)
+{
+ FontDescription fontDescription;
+ fontDescription.setGenericFamily(FontDescription::StandardFamily);
+ fontDescription.setRenderingMode(settings->fontRenderingMode());
+ fontDescription.setUsePrinterFont(m_checker.document()->printing());
+ const AtomicString& standardFontFamily = documentSettings()->standardFontFamily();
+ if (!standardFontFamily.isEmpty()) {
+ fontDescription.firstFamily().setFamily(standardFontFamily);
+ fontDescription.firstFamily().appendFamily(0);
+ }
+ fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
+ setFontSize(fontDescription, fontSizeForKeyword(m_checker.document(), CSSValueMedium, false));
+ m_style->setLineHeight(RenderStyle::initialLineHeight());
+ m_lineHeightValue = 0;
+ setFontDescription(fontDescription);
+}
+
void StyleResolver::setFontSize(FontDescription& fontDescription, float size)
{
fontDescription.setSpecifiedSize(size);
Modified: trunk/Source/WebCore/css/StyleResolver.h (119798 => 119799)
--- trunk/Source/WebCore/css/StyleResolver.h 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/css/StyleResolver.h 2012-06-08 05:29:01 UTC (rev 119799)
@@ -208,6 +208,7 @@
void applyPropertyToCurrentStyle(CSSPropertyID, CSSValue*);
void updateFont();
+ void initializeFontStyle(Settings*);
static float getComputedSizeFromSpecifiedSize(Document*, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize = UseSmartMinimumForFontFize);
@@ -366,6 +367,8 @@
void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPage, const String& pageName);
void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vector<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName);
+ Settings* documentSettings() { return m_checker.document()->settings(); }
+
bool isLeftPage(int pageIndex) const;
bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
bool isFirstPage(int pageIndex) const;
Modified: trunk/Source/WebCore/dom/NodeRenderingContext.cpp (119798 => 119799)
--- trunk/Source/WebCore/dom/NodeRenderingContext.cpp 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/dom/NodeRenderingContext.cpp 2012-06-08 05:29:01 UTC (rev 119799)
@@ -55,6 +55,7 @@
: m_phase(AttachingNotInTree)
, m_node(node)
, m_parentNodeForRenderingAndStyle(0)
+ , m_resetStyleInheritance(false)
, m_visualParentShadow(0)
, m_insertionPoint(0)
, m_style(0)
@@ -67,6 +68,7 @@
if (parent->isShadowRoot() && toShadowRoot(parent)->isYoungest()) {
m_phase = AttachingShadowChild;
m_parentNodeForRenderingAndStyle = toShadowRoot(parent)->host();
+ m_resetStyleInheritance = toShadowRoot(parent)->resetStyleInheritance();
return;
}
@@ -82,7 +84,9 @@
if ((m_insertionPoint = m_visualParentShadow->insertionPointFor(m_node))) {
if (m_insertionPoint->shadowRoot()->isUsedForRendering()) {
m_phase = AttachingDistributed;
- m_parentNodeForRenderingAndStyle = NodeRenderingContext(m_insertionPoint).parentNodeForRenderingAndStyle();
+ NodeRenderingContext insertionPointContext(m_insertionPoint);
+ m_parentNodeForRenderingAndStyle = insertionPointContext.parentNodeForRenderingAndStyle();
+ m_resetStyleInheritance = insertionPointContext.resetStyleInheritance();
return;
}
}
@@ -107,9 +111,11 @@
else
m_phase = AttachingFallbacked;
- if (toInsertionPoint(parent)->isActive())
- m_parentNodeForRenderingAndStyle = NodeRenderingContext(parent).parentNodeForRenderingAndStyle();
- else
+ if (toInsertionPoint(parent)->isActive()) {
+ NodeRenderingContext parentContext(parent);
+ m_parentNodeForRenderingAndStyle = parentContext.parentNodeForRenderingAndStyle();
+ m_resetStyleInheritance = parentContext.resetStyleInheritance();
+ } else
m_parentNodeForRenderingAndStyle = parent;
return;
}
@@ -123,6 +129,7 @@
: m_phase(Calculating)
, m_node(node)
, m_parentNodeForRenderingAndStyle(0)
+ , m_resetStyleInheritance(false)
, m_visualParentShadow(0)
, m_insertionPoint(0)
, m_style(style)
Modified: trunk/Source/WebCore/dom/NodeRenderingContext.h (119798 => 119799)
--- trunk/Source/WebCore/dom/NodeRenderingContext.h 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/dom/NodeRenderingContext.h 2012-06-08 05:29:01 UTC (rev 119799)
@@ -49,6 +49,7 @@
Node* node() const;
ContainerNode* parentNodeForRenderingAndStyle() const;
+ bool resetStyleInheritance() const;
RenderObject* parentRenderer() const;
RenderObject* nextRenderer() const;
RenderObject* previousRenderer() const;
@@ -81,6 +82,7 @@
AttachingPhase m_phase;
Node* m_node;
ContainerNode* m_parentNodeForRenderingAndStyle;
+ bool m_resetStyleInheritance;
ElementShadow* m_visualParentShadow;
InsertionPoint* m_insertionPoint;
RefPtr<RenderStyle> m_style;
@@ -99,6 +101,12 @@
return m_parentNodeForRenderingAndStyle;
}
+inline bool NodeRenderingContext::resetStyleInheritance() const
+{
+ ASSERT(m_phase != Calculating);
+ return m_resetStyleInheritance;
+}
+
inline RenderStyle* NodeRenderingContext::style() const
{
return m_style.get();
Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (119798 => 119799)
--- trunk/Source/WebCore/dom/ShadowRoot.cpp 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp 2012-06-08 05:29:01 UTC (rev 119799)
@@ -50,6 +50,7 @@
, m_prev(0)
, m_next(0)
, m_applyAuthorStyles(false)
+ , m_resetStyleInheritance(false)
, m_insertionPointAssignedTo(0)
{
ASSERT(document);
@@ -193,6 +194,20 @@
}
}
+bool ShadowRoot::resetStyleInheritance() const
+{
+ return m_resetStyleInheritance;
+}
+
+void ShadowRoot::setResetStyleInheritance(bool value)
+{
+ if (value != m_resetStyleInheritance) {
+ m_resetStyleInheritance = value;
+ if (attached() && owner())
+ owner()->recalcStyle(Force);
+ }
+}
+
void ShadowRoot::attach()
{
StyleResolver* styleResolver = document()->styleResolver();
Modified: trunk/Source/WebCore/dom/ShadowRoot.h (119798 => 119799)
--- trunk/Source/WebCore/dom/ShadowRoot.h 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/dom/ShadowRoot.h 2012-06-08 05:29:01 UTC (rev 119799)
@@ -63,6 +63,8 @@
virtual bool applyAuthorStyles() const OVERRIDE;
void setApplyAuthorStyles(bool);
+ virtual bool resetStyleInheritance() const OVERRIDE;
+ void setResetStyleInheritance(bool);
Element* host() const;
void setHost(Element*);
@@ -98,6 +100,7 @@
ShadowRoot* m_prev;
ShadowRoot* m_next;
bool m_applyAuthorStyles : 1;
+ bool m_resetStyleInheritance : 1;
InsertionPoint* m_insertionPointAssignedTo;
};
Modified: trunk/Source/WebCore/dom/ShadowRoot.idl (119798 => 119799)
--- trunk/Source/WebCore/dom/ShadowRoot.idl 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/dom/ShadowRoot.idl 2012-06-08 05:29:01 UTC (rev 119799)
@@ -34,6 +34,7 @@
readonly attribute Element host;
readonly attribute Element activeElement;
attribute boolean applyAuthorStyles;
+ attribute boolean resetStyleInheritance;
attribute [TreatNullAs=NullString] DOMString innerHTML
setter raises(DOMException);
Modified: trunk/Source/WebCore/dom/TreeScope.cpp (119798 => 119799)
--- trunk/Source/WebCore/dom/TreeScope.cpp 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/dom/TreeScope.cpp 2012-06-08 05:29:01 UTC (rev 119799)
@@ -191,6 +191,11 @@
return true;
}
+bool TreeScope::resetStyleInheritance() const
+{
+ return false;
+}
+
void TreeScope::adoptIfNeeded(Node* node)
{
ASSERT(this);
Modified: trunk/Source/WebCore/dom/TreeScope.h (119798 => 119799)
--- trunk/Source/WebCore/dom/TreeScope.h 2012-06-08 04:49:34 UTC (rev 119798)
+++ trunk/Source/WebCore/dom/TreeScope.h 2012-06-08 05:29:01 UTC (rev 119799)
@@ -75,6 +75,7 @@
Element* findAnchor(const String& name);
virtual bool applyAuthorStyles() const;
+ virtual bool resetStyleInheritance() const;
// Used by the basic DOM mutation methods (e.g., appendChild()).
void adoptIfNeeded(Node*);