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

Side by Side Diff: Source/core/dom/shadow/ElementShadow.cpp

Issue 446063007: Rename NoEventDispatchAssertion to EventDispatchForbiddenScope and move it to platform/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/Node.cpp ('k') | Source/core/editing/UndoStack.cpp » ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 11 matching lines...) Expand all
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "core/dom/shadow/ElementShadow.h" 28 #include "core/dom/shadow/ElementShadow.h"
29 29
30 #include "core/css/StyleSheetList.h" 30 #include "core/css/StyleSheetList.h"
31 #include "core/dom/ElementTraversal.h" 31 #include "core/dom/ElementTraversal.h"
32 #include "core/dom/NoEventDispatchAssertion.h"
33 #include "core/dom/NodeTraversal.h" 32 #include "core/dom/NodeTraversal.h"
34 #include "core/dom/shadow/ContentDistribution.h" 33 #include "core/dom/shadow/ContentDistribution.h"
35 #include "core/html/HTMLContentElement.h" 34 #include "core/html/HTMLContentElement.h"
36 #include "core/html/HTMLShadowElement.h" 35 #include "core/html/HTMLShadowElement.h"
37 #include "core/inspector/InspectorInstrumentation.h" 36 #include "core/inspector/InspectorInstrumentation.h"
37 #include "platform/EventDispatchForbiddenScope.h"
38 #include "platform/ScriptForbiddenScope.h" 38 #include "platform/ScriptForbiddenScope.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 class DistributionPool FINAL { 42 class DistributionPool FINAL {
43 STACK_ALLOCATED(); 43 STACK_ALLOCATED();
44 public: 44 public:
45 explicit DistributionPool(const ContainerNode&); 45 explicit DistributionPool(const ContainerNode&);
46 void clear(); 46 void clear();
47 ~DistributionPool(); 47 ~DistributionPool();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 ElementShadow::~ElementShadow() 138 ElementShadow::~ElementShadow()
139 { 139 {
140 #if !ENABLE(OILPAN) 140 #if !ENABLE(OILPAN)
141 removeDetachedShadowRoots(); 141 removeDetachedShadowRoots();
142 #endif 142 #endif
143 } 143 }
144 144
145 ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow RootType type) 145 ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow RootType type)
146 { 146 {
147 NoEventDispatchAssertion assertNoEventDispatch; 147 EventDispatchForbiddenScope assertNoEventDispatch;
148 ScriptForbiddenScope forbidScript; 148 ScriptForbiddenScope forbidScript;
149 149
150 if (type == ShadowRoot::AuthorShadowRoot && (!youngestShadowRoot() || younge stShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot)) 150 if (type == ShadowRoot::AuthorShadowRoot && (!youngestShadowRoot() || younge stShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot))
151 shadowHost.willAddFirstAuthorShadowRoot(); 151 shadowHost.willAddFirstAuthorShadowRoot();
152 152
153 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) 153 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root())
154 root->lazyReattachIfAttached(); 154 root->lazyReattachIfAttached();
155 155
156 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = ShadowRoot::create(shadowHost.do cument(), type); 156 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = ShadowRoot::create(shadowHost.do cument(), type);
157 shadowRoot->setParentOrShadowHostNode(&shadowHost); 157 shadowRoot->setParentOrShadowHostNode(&shadowHost);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 visitor->trace(m_nodeToInsertionPoints); 361 visitor->trace(m_nodeToInsertionPoints);
362 visitor->trace(m_selectFeatures); 362 visitor->trace(m_selectFeatures);
363 // Shadow roots are linked with previous and next pointers which are traced. 363 // Shadow roots are linked with previous and next pointers which are traced.
364 // It is therefore enough to trace one of the shadow roots here and the 364 // It is therefore enough to trace one of the shadow roots here and the
365 // rest will be traced from there. 365 // rest will be traced from there.
366 visitor->trace(m_shadowRoots.head()); 366 visitor->trace(m_shadowRoots.head());
367 #endif 367 #endif
368 } 368 }
369 369
370 } // namespace 370 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/editing/UndoStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698