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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CEReactionsScope.cpp

Issue 2132343002: Make Custom Elements V1 work in HTML imports documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: imports-create tests checks the order of constructors Created 4 years, 5 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/custom/CEReactionsScope.h" 5 #include "core/dom/custom/CEReactionsScope.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/dom/custom/CustomElement.h"
9 #include "core/dom/custom/CustomElementReactionStack.h" 10 #include "core/dom/custom/CustomElementReactionStack.h"
10 #include "core/frame/FrameHost.h" 11 #include "core/frame/FrameHost.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 CEReactionsScope* CEReactionsScope::s_topOfStack = nullptr; 15 CEReactionsScope* CEReactionsScope::s_topOfStack = nullptr;
15 16
16 void CEReactionsScope::enqueueToCurrentQueue( 17 void CEReactionsScope::enqueueToCurrentQueue(
17 Element* element, 18 Element* element,
18 CustomElementReaction* reaction) 19 CustomElementReaction* reaction)
19 { 20 {
20 if (!m_frameHost.get()) { 21 if (!m_frameHost.get()) {
21 m_frameHost = element->document().frameHost(); 22 m_frameHost = CustomElement::contextFrameHost(*element);
22 m_frameHost->customElementReactionStack().push(); 23 m_frameHost->customElementReactionStack().push();
23 } else { 24 } else {
24 DCHECK_EQ(m_frameHost, element->document().frameHost()); 25 DCHECK_EQ(m_frameHost, CustomElement::contextFrameHost(*element));
25 } 26 }
26 m_frameHost->customElementReactionStack().enqueueToCurrentQueue( 27 m_frameHost->customElementReactionStack().enqueueToCurrentQueue(
27 element, reaction); 28 element, reaction);
28 } 29 }
29 30
30 void CEReactionsScope::invokeReactions() 31 void CEReactionsScope::invokeReactions()
31 { 32 {
32 m_frameHost->customElementReactionStack().popInvokingReactions(); 33 m_frameHost->customElementReactionStack().popInvokingReactions();
33 } 34 }
34 35
35 } // namespace blink 36 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698