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

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

Issue 24773003: Rename Node::attached() to confusingAndOftenMisusedAttached() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « Source/core/dom/shadow/ElementShadow.cpp ('k') | Source/core/dom/shadow/ShadowRoot.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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 m_distribution.swap(distribution); 94 m_distribution.swap(distribution);
95 m_distribution.shrinkToFit(); 95 m_distribution.shrinkToFit();
96 } 96 }
97 97
98 void InsertionPoint::attach(const AttachContext& context) 98 void InsertionPoint::attach(const AttachContext& context)
99 { 99 {
100 // FIXME: This loop shouldn't be needed since the distributed nodes should 100 // FIXME: This loop shouldn't be needed since the distributed nodes should
101 // never be detached, we can probably remove it. 101 // never be detached, we can probably remove it.
102 for (size_t i = 0; i < m_distribution.size(); ++i) { 102 for (size_t i = 0; i < m_distribution.size(); ++i) {
103 if (!m_distribution.at(i)->attached()) 103 if (!m_distribution.at(i)->confusingAndOftenMisusedAttached())
104 m_distribution.at(i)->attach(context); 104 m_distribution.at(i)->attach(context);
105 } 105 }
106 106
107 HTMLElement::attach(context); 107 HTMLElement::attach(context);
108 } 108 }
109 109
110 void InsertionPoint::detach(const AttachContext& context) 110 void InsertionPoint::detach(const AttachContext& context)
111 { 111 {
112 for (size_t i = 0; i < m_distribution.size(); ++i) 112 for (size_t i = 0; i < m_distribution.size(); ++i)
113 m_distribution.at(i)->lazyReattachIfAttached(); 113 m_distribution.at(i)->lazyReattachIfAttached();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 rootOwner->willAffectSelector(); 215 rootOwner->willAffectSelector();
216 } 216 }
217 } 217 }
218 218
219 HTMLElement::removedFrom(insertionPoint); 219 HTMLElement::removedFrom(insertionPoint);
220 } 220 }
221 221
222 void InsertionPoint::parseAttribute(const QualifiedName& name, const AtomicStrin g& value) 222 void InsertionPoint::parseAttribute(const QualifiedName& name, const AtomicStrin g& value)
223 { 223 {
224 if (name == reset_style_inheritanceAttr) { 224 if (name == reset_style_inheritanceAttr) {
225 if (!inDocument() || !attached() || !isActive()) 225 if (!inDocument() || !confusingAndOftenMisusedAttached() || !isActive())
226 return; 226 return;
227 containingShadowRoot()->host()->setNeedsStyleRecalc(); 227 containingShadowRoot()->host()->setNeedsStyleRecalc();
228 } else 228 } else
229 HTMLElement::parseAttribute(name, value); 229 HTMLElement::parseAttribute(name, value);
230 } 230 }
231 231
232 bool InsertionPoint::resetStyleInheritance() const 232 bool InsertionPoint::resetStyleInheritance() const
233 { 233 {
234 return fastHasAttribute(reset_style_inheritanceAttr); 234 return fastHasAttribute(reset_style_inheritanceAttr);
235 } 235 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 current = insertedTo; 283 current = insertedTo;
284 results.append(insertedTo); 284 results.append(insertedTo);
285 continue; 285 continue;
286 } 286 }
287 } 287 }
288 return; 288 return;
289 } 289 }
290 } 290 }
291 291
292 } // namespace WebCore 292 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ElementShadow.cpp ('k') | Source/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698