Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: Source/core/dom/Element.cpp

Issue 1158163004: Add ShadowRootInit dictionary. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nit fix in layout test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "core/dom/PseudoElement.h" 67 #include "core/dom/PseudoElement.h"
68 #include "core/dom/ScriptableDocumentParser.h" 68 #include "core/dom/ScriptableDocumentParser.h"
69 #include "core/dom/SelectorQuery.h" 69 #include "core/dom/SelectorQuery.h"
70 #include "core/dom/StyleChangeReason.h" 70 #include "core/dom/StyleChangeReason.h"
71 #include "core/dom/StyleEngine.h" 71 #include "core/dom/StyleEngine.h"
72 #include "core/dom/Text.h" 72 #include "core/dom/Text.h"
73 #include "core/dom/custom/CustomElement.h" 73 #include "core/dom/custom/CustomElement.h"
74 #include "core/dom/custom/CustomElementRegistrationContext.h" 74 #include "core/dom/custom/CustomElementRegistrationContext.h"
75 #include "core/dom/shadow/InsertionPoint.h" 75 #include "core/dom/shadow/InsertionPoint.h"
76 #include "core/dom/shadow/ShadowRoot.h" 76 #include "core/dom/shadow/ShadowRoot.h"
77 #include "core/dom/shadow/ShadowRootInit.h"
77 #include "core/editing/FrameSelection.h" 78 #include "core/editing/FrameSelection.h"
78 #include "core/editing/htmlediting.h" 79 #include "core/editing/htmlediting.h"
79 #include "core/editing/iterators/TextIterator.h" 80 #include "core/editing/iterators/TextIterator.h"
80 #include "core/editing/markup.h" 81 #include "core/editing/markup.h"
81 #include "core/events/EventDispatcher.h" 82 #include "core/events/EventDispatcher.h"
82 #include "core/events/FocusEvent.h" 83 #include "core/events/FocusEvent.h"
83 #include "core/frame/FrameHost.h" 84 #include "core/frame/FrameHost.h"
84 #include "core/frame/FrameView.h" 85 #include "core/frame/FrameView.h"
85 #include "core/frame/LocalDOMWindow.h" 86 #include "core/frame/LocalDOMWindow.h"
86 #include "core/frame/LocalFrame.h" 87 #include "core/frame/LocalFrame.h"
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1802 return elementRareData()->customElementDefinition(); 1803 return elementRareData()->customElementDefinition();
1803 return nullptr; 1804 return nullptr;
1804 } 1805 }
1805 1806
1806 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* script State, ExceptionState& exceptionState) 1807 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* script State, ExceptionState& exceptionState)
1807 { 1808 {
1808 OriginsUsingFeatures::count(scriptState, document(), OriginsUsingFeatures::F eature::ElementCreateShadowRoot); 1809 OriginsUsingFeatures::count(scriptState, document(), OriginsUsingFeatures::F eature::ElementCreateShadowRoot);
1809 return createShadowRoot(exceptionState); 1810 return createShadowRoot(exceptionState);
1810 } 1811 }
1811 1812
1813 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* script State, ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionState)
1814 {
1815 ASSERT(RuntimeEnabledFeatures::createShadowRootWithParameterEnabled());
1816 UseCounter::count(document(), UseCounter::ElementCreateShadowRootWithParamet er);
1817
1818 OriginsUsingFeatures::count(scriptState, document(), OriginsUsingFeatures::F eature::ElementCreateShadowRoot);
1819 // TODO(kochi): Add support for closed shadow root. crbug.com/459136
1820 if (shadowRootInitDict.hasMode() && shadowRootInitDict.mode() == "closed") {
1821 exceptionState.throwDOMException(NotSupportedError, "Closed shadow root is not implemented yet.");
1822 return nullptr;
1823 }
1824
1825 return createShadowRoot(exceptionState);
1826 }
1827
1812 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exc eptionState) 1828 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exc eptionState)
1813 { 1829 {
1814 if (alwaysCreateUserAgentShadowRoot()) 1830 if (alwaysCreateUserAgentShadowRoot())
1815 ensureUserAgentShadowRoot(); 1831 ensureUserAgentShadowRoot();
1816 1832
1817 // Some elements make assumptions about what kind of layoutObjects they allo w 1833 // Some elements make assumptions about what kind of layoutObjects they allo w
1818 // as children so we can't allow author shadows on them for now. An override 1834 // as children so we can't allow author shadows on them for now. An override
1819 // flag is provided for testing how author shadows interact on these element s. 1835 // flag is provided for testing how author shadows interact on these element s.
1820 if (!areAuthorShadowsAllowed() && !RuntimeEnabledFeatures::authorShadowDOMFo rAnyElementEnabled()) { 1836 if (!areAuthorShadowsAllowed() && !RuntimeEnabledFeatures::authorShadowDOMFo rAnyElementEnabled()) {
1821 exceptionState.throwDOMException(HierarchyRequestError, "Author-created shadow roots are disabled for this element."); 1837 exceptionState.throwDOMException(HierarchyRequestError, "Author-created shadow roots are disabled for this element.");
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
3435 { 3451 {
3436 #if ENABLE(OILPAN) 3452 #if ENABLE(OILPAN)
3437 if (hasRareData()) 3453 if (hasRareData())
3438 visitor->trace(elementRareData()); 3454 visitor->trace(elementRareData());
3439 visitor->trace(m_elementData); 3455 visitor->trace(m_elementData);
3440 #endif 3456 #endif
3441 ContainerNode::trace(visitor); 3457 ContainerNode::trace(visitor);
3442 } 3458 }
3443 3459
3444 } // namespace blink 3460 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698