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

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

Issue 599733005: Merge 181302 "Tell synthetic attribute nodes inside shadow DOM a..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2125/
Patch Set: Created 6 years, 2 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 | « LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt ('k') | no next file » | 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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 #if !ENABLE(OILPAN) 85 #if !ENABLE(OILPAN)
86 oldScope().guardDeref(); 86 oldScope().guardDeref();
87 #endif 87 #endif
88 } 88 }
89 89
90 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument, Document& newDocument) const 90 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument, Document& newDocument) const
91 { 91 {
92 ASSERT(oldDocument != newDocument); 92 ASSERT(oldDocument != newDocument);
93 for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) { 93 for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) {
94 moveNodeToNewDocument(*node, oldDocument, newDocument); 94 moveNodeToNewDocument(*node, oldDocument, newDocument);
95
96 if (node->hasSyntheticAttrChildNodes()) {
97 WillBeHeapVector<RefPtrWillBeMember<Attr> >& attrs = *toElement(node )->attrNodeList();
98 for (unsigned i = 0; i < attrs.size(); ++i)
99 moveTreeToNewDocument(*attrs[i], oldDocument, newDocument);
100 }
101
95 for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = s hadow->olderShadowRoot()) 102 for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = s hadow->olderShadowRoot())
96 moveTreeToNewDocument(*shadow, oldDocument, newDocument); 103 moveTreeToNewDocument(*shadow, oldDocument, newDocument);
97 } 104 }
98 } 105 }
99 106
100 #if ENABLE(ASSERT) 107 #if ENABLE(ASSERT)
101 static bool didMoveToNewDocumentWasCalled = false; 108 static bool didMoveToNewDocumentWasCalled = false;
102 static Document* oldDocumentDidMoveToNewDocumentWasCalledWith = 0; 109 static Document* oldDocumentDidMoveToNewDocumentWasCalledWith = 0;
103 110
104 void TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(Document& oldDocument ) 111 void TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(Document& oldDocument )
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #if ENABLE(ASSERT) 145 #if ENABLE(ASSERT)
139 didMoveToNewDocumentWasCalled = false; 146 didMoveToNewDocumentWasCalled = false;
140 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; 147 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument;
141 #endif 148 #endif
142 149
143 node.didMoveToNewDocument(oldDocument); 150 node.didMoveToNewDocument(oldDocument);
144 ASSERT(didMoveToNewDocumentWasCalled); 151 ASSERT(didMoveToNewDocumentWasCalled);
145 } 152 }
146 153
147 } 154 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698