Diff
Modified: branches/chromium/1312/Source/WebCore/dom/ContextFeatures.cpp (134365 => 134366)
--- branches/chromium/1312/Source/WebCore/dom/ContextFeatures.cpp 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebCore/dom/ContextFeatures.cpp 2012-11-13 06:36:48 UTC (rev 134366)
@@ -63,6 +63,18 @@
#endif
}
+bool ContextFeatures::shadowDOMEnabled(Document* document)
+{
+#if ENABLE(SHADOW_DOM)
+ if (!document)
+ return RuntimeEnabledFeatures::shadowDOMEnabled();
+ return document->contextFeatures()->isEnabled(document, ShadowDOM, RuntimeEnabledFeatures::shadowDOMEnabled());
+#else
+ UNUSED_PARAM(document);
+ return false;
+#endif
+}
+
bool ContextFeatures::styleScopedEnabled(Document* document)
{
#if ENABLE(STYLE_SCOPED)
Modified: branches/chromium/1312/Source/WebCore/dom/ContextFeatures.h (134365 => 134366)
--- branches/chromium/1312/Source/WebCore/dom/ContextFeatures.h 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebCore/dom/ContextFeatures.h 2012-11-13 06:36:48 UTC (rev 134366)
@@ -40,6 +40,7 @@
public:
enum FeatureType {
DialogElement = 0,
+ ShadowDOM,
StyleScoped,
PagePopup,
HTMLNotifications,
@@ -53,6 +54,7 @@
static PassRefPtr<ContextFeatures> create(ContextFeaturesClient*);
static bool dialogElementEnabled(Document*);
+ static bool shadowDOMEnabled(Document*);
static bool styleScopedEnabled(Document*);
static bool pagePopupEnabled(Document*);
static bool htmlNotificationsEnabled(Document*);
Modified: branches/chromium/1312/Source/WebCore/dom/Position.cpp (134365 => 134366)
--- branches/chromium/1312/Source/WebCore/dom/Position.cpp 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebCore/dom/Position.cpp 2012-11-13 06:36:48 UTC (rev 134366)
@@ -27,13 +27,13 @@
#include "Position.h"
#include "CSSComputedStyleDeclaration.h"
+#include "ContextFeatures.h"
#include "HTMLNames.h"
#include "InlineTextBox.h"
#include "Logging.h"
#include "PositionIterator.h"
#include "RenderBlock.h"
#include "RenderText.h"
-#include "RuntimeEnabledFeatures.h"
#include "Text.h"
#include "TextIterator.h"
#include "VisiblePosition.h"
@@ -82,7 +82,7 @@
, m_isLegacyEditingPosition(true)
{
#if ENABLE(SHADOW_DOM)
- ASSERT((m_anchorNode && RuntimeEnabledFeatures::shadowDOMEnabled())
+ ASSERT((m_anchorNode && ContextFeatures::shadowDOMEnabled(m_anchorNode->document()))
|| !m_anchorNode || !m_anchorNode->isShadowRoot());
#else
ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot());
@@ -96,7 +96,7 @@
, m_isLegacyEditingPosition(false)
{
#if ENABLE(SHADOW_DOM)
- ASSERT((m_anchorNode && RuntimeEnabledFeatures::shadowDOMEnabled())
+ ASSERT((m_anchorNode && ContextFeatures::shadowDOMEnabled(m_anchorNode->document()))
|| !m_anchorNode || !m_anchorNode->isShadowRoot());
#else
ASSERT(!m_anchorNode || !m_anchorNode->isShadowRoot());
@@ -114,7 +114,7 @@
, m_isLegacyEditingPosition(false)
{
#if ENABLE(SHADOW_DOM)
- ASSERT((m_anchorNode && RuntimeEnabledFeatures::shadowDOMEnabled())
+ ASSERT((m_anchorNode && ContextFeatures::shadowDOMEnabled(m_anchorNode->document()))
|| !m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot());
#else
ASSERT(!m_anchorNode || !editingIgnoresContent(m_anchorNode.get()) || !m_anchorNode->isShadowRoot());
@@ -858,7 +858,7 @@
// FIXME: See http://web.ug/82697
#if ENABLE(SHADOW_DOM)
- if (RuntimeEnabledFeatures::shadowDOMEnabled())
+ if (ContextFeatures::shadowDOMEnabled(node->document()))
return node->parentNode();
#endif
Modified: branches/chromium/1312/Source/WebCore/dom/TreeScope.cpp (134365 => 134366)
--- branches/chromium/1312/Source/WebCore/dom/TreeScope.cpp 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebCore/dom/TreeScope.cpp 2012-11-13 06:36:48 UTC (rev 134366)
@@ -28,6 +28,7 @@
#include "ComposedShadowTreeWalker.h"
#include "ContainerNode.h"
+#include "ContextFeatures.h"
#include "DOMSelection.h"
#include "DOMWindow.h"
#include "Document.h"
@@ -42,7 +43,6 @@
#include "IdTargetObserverRegistry.h"
#include "InsertionPoint.h"
#include "Page.h"
-#include "RuntimeEnabledFeatures.h"
#include "ShadowRoot.h"
#include "TreeScopeAdopter.h"
#include <wtf/Vector.h>
@@ -189,7 +189,7 @@
// as a container. It is now enabled only if runtime Shadow DOM feature is enabled.
// See https://bugs.webkit.org/show_bug.cgi?id=82697
#if ENABLE(SHADOW_DOM)
- if (RuntimeEnabledFeatures::shadowDOMEnabled()) {
+ if (ContextFeatures::shadowDOMEnabled(rootNode()->document())) {
m_selection = DOMSelection::create(this);
return m_selection.get();
}
Modified: branches/chromium/1312/Source/WebCore/html/HTMLTagNames.in (134365 => 134366)
--- branches/chromium/1312/Source/WebCore/html/HTMLTagNames.in 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebCore/html/HTMLTagNames.in 2012-11-13 06:36:48 UTC (rev 134366)
@@ -31,7 +31,7 @@
col interfaceName=HTMLTableColElement
colgroup interfaceName=HTMLTableColElement
command interfaceName=HTMLElement
-content interfaceName=HTMLContentElement, conditional=SHADOW_DOM, runtimeConditional=shadowDOM
+content interfaceName=HTMLContentElement, conditional=SHADOW_DOM, contextConditional=shadowDOM
webkitShadowContent interfaceName=HTMLElement, noConstructor
datalist interfaceName=HTMLDataListElement, conditional=DATALIST_ELEMENT
dd interfaceName=HTMLElement
@@ -97,7 +97,7 @@
optgroup interfaceName=HTMLOptGroupElement
option
output constructorNeedsFormElement
-shadow interfaceName=HTMLShadowElement, conditional=SHADOW_DOM, runtimeConditional=shadowDOM
+shadow interfaceName=HTMLShadowElement, conditional=SHADOW_DOM, contextConditional=shadowDOM
p interfaceName=HTMLParagraphElement
param
plaintext interfaceName=HTMLElement
Modified: branches/chromium/1312/Source/WebCore/html/shadow/HTMLContentElement.cpp (134365 => 134366)
--- branches/chromium/1312/Source/WebCore/html/shadow/HTMLContentElement.cpp 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebCore/html/shadow/HTMLContentElement.cpp 2012-11-13 06:36:48 UTC (rev 134366)
@@ -29,10 +29,10 @@
#include "ContentDistributor.h"
#include "ContentSelectorQuery.h"
+#include "ContextFeatures.h"
#include "ElementShadow.h"
#include "HTMLNames.h"
#include "QualifiedName.h"
-#include "RuntimeEnabledFeatures.h"
#include "ShadowRoot.h"
#include <wtf/StdLibExtras.h>
@@ -40,13 +40,14 @@
using HTMLNames::selectAttr;
-const QualifiedName& HTMLContentElement::contentTagName(Document*)
+const QualifiedName& HTMLContentElement::contentTagName(Document* document)
{
#if ENABLE(SHADOW_DOM)
- if (!RuntimeEnabledFeatures::shadowDOMEnabled())
+ if (!ContextFeatures::shadowDOMEnabled(document))
return HTMLNames::webkitShadowContentTag;
return HTMLNames::contentTag;
#else
+ UNUSED_PARAM(document);
return HTMLNames::webkitShadowContentTag;
#endif
}
Modified: branches/chromium/1312/Source/WebCore/page/DOMWindow.idl (134365 => 134366)
--- branches/chromium/1312/Source/WebCore/page/DOMWindow.idl 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebCore/page/DOMWindow.idl 2012-11-13 06:36:48 UTC (rev 134366)
@@ -392,9 +392,9 @@
attribute EntityConstructor Entity;
attribute EntityReferenceConstructor EntityReference;
attribute ProcessingInstructionConstructor ProcessingInstruction;
- [Conditional=SHADOW_DOM, V8EnabledAtRuntime=shadowDOM] attribute ShadowRootConstructor WebKitShadowRoot;
- [Conditional=SHADOW_DOM, V8EnabledAtRuntime=shadowDOM] attribute HTMLContentElementConstructor HTMLContentElement;
- [Conditional=SHADOW_DOM, V8EnabledAtRuntime=shadowDOM] attribute HTMLShadowElementConstructor HTMLShadowElement;
+ [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] attribute ShadowRootConstructor WebKitShadowRoot;
+ [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] attribute HTMLContentElementConstructor HTMLContentElement;
+ [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] attribute HTMLShadowElementConstructor HTMLShadowElement;
attribute DOMSelectionConstructor Selection;
attribute DOMWindowConstructor Window;
Modified: branches/chromium/1312/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp (134365 => 134366)
--- branches/chromium/1312/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp 2012-11-13 06:36:05 UTC (rev 134365)
+++ branches/chromium/1312/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp 2012-11-13 06:36:48 UTC (rev 134366)
@@ -140,6 +140,7 @@
return defaultValue;
switch (type) {
+ case ContextFeatures::ShadowDOM:
case ContextFeatures::StyleScoped:
return m_client->allowWebComponents(WebDocument(document), defaultValue);
case ContextFeatures::HTMLNotifications: