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

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

Issue 18167006: Implement Custom Elements' entered and left document callbacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/CustomElementLifecycleCallbacks.h ('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 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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 if (!insertionPoint->isInTreeScope()) 1261 if (!insertionPoint->isInTreeScope())
1262 return InsertionDone; 1262 return InsertionDone;
1263 1263
1264 if (hasRareData()) 1264 if (hasRareData())
1265 elementRareData()->clearClassListValueForQuirksMode(); 1265 elementRareData()->clearClassListValueForQuirksMode();
1266 1266
1267 TreeScope* scope = insertionPoint->treeScope(); 1267 TreeScope* scope = insertionPoint->treeScope();
1268 if (scope != treeScope()) 1268 if (scope != treeScope())
1269 return InsertionDone; 1269 return InsertionDone;
1270 1270
1271 if (isUpgradedCustomElement()) {
1272 RefPtr<CustomElementDefinition> definition = document()->registry()->fin dFor(this);
1273 CustomElementCallbackDispatcher::instance().enqueueEnteredDocumentCallba ck(definition->callbacks(), this);
1274 }
1275
1271 const AtomicString& idValue = getIdAttribute(); 1276 const AtomicString& idValue = getIdAttribute();
1272 if (!idValue.isNull()) 1277 if (!idValue.isNull())
1273 updateId(scope, nullAtom, idValue); 1278 updateId(scope, nullAtom, idValue);
1274 1279
1275 const AtomicString& nameValue = getNameAttribute(); 1280 const AtomicString& nameValue = getNameAttribute();
1276 if (!nameValue.isNull()) 1281 if (!nameValue.isNull())
1277 updateName(nullAtom, nameValue); 1282 updateName(nullAtom, nameValue);
1278 1283
1279 if (hasTagName(labelTag)) { 1284 if (hasTagName(labelTag)) {
1280 if (scope->shouldCacheLabelsByForAttribute()) 1285 if (scope->shouldCacheLabelsByForAttribute())
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 updateName(nameValue, nullAtom); 1321 updateName(nameValue, nullAtom);
1317 1322
1318 if (hasTagName(labelTag)) { 1323 if (hasTagName(labelTag)) {
1319 TreeScope* treeScope = insertionPoint->treeScope(); 1324 TreeScope* treeScope = insertionPoint->treeScope();
1320 if (treeScope->shouldCacheLabelsByForAttribute()) 1325 if (treeScope->shouldCacheLabelsByForAttribute())
1321 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); 1326 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom);
1322 } 1327 }
1323 } 1328 }
1324 1329
1325 ContainerNode::removedFrom(insertionPoint); 1330 ContainerNode::removedFrom(insertionPoint);
1326 if (wasInDocument && hasPendingResources()) 1331 if (wasInDocument) {
1327 document()->accessSVGExtensions()->removeElementFromPendingResources(thi s); 1332 if (hasPendingResources())
1333 document()->accessSVGExtensions()->removeElementFromPendingResources (this);
1334
1335 if (isUpgradedCustomElement()) {
1336 if (CustomElementRegistry* registry = document()->registry()) {
1337 RefPtr<CustomElementDefinition> definition = registry->findFor(t his);
1338 CustomElementCallbackDispatcher::instance().enqueueLeftDocumentC allback(definition->callbacks(), this);
1339 }
1340 }
1341 }
1328 } 1342 }
1329 1343
1330 void Element::createRendererIfNeeded(const AttachContext& context) 1344 void Element::createRendererIfNeeded(const AttachContext& context)
1331 { 1345 {
1332 NodeRenderingContext(this, context).createRendererForElementIfNeeded(); 1346 NodeRenderingContext(this, context).createRendererForElementIfNeeded();
1333 } 1347 }
1334 1348
1335 void Element::attach(const AttachContext& context) 1349 void Element::attach(const AttachContext& context)
1336 { 1350 {
1337 PostAttachCallbackDisabler callbackDisabler(this); 1351 PostAttachCallbackDisabler callbackDisabler(this);
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
3633 return 0; 3647 return 0;
3634 } 3648 }
3635 3649
3636 Attribute* UniqueElementData::attributeItem(unsigned index) 3650 Attribute* UniqueElementData::attributeItem(unsigned index)
3637 { 3651 {
3638 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3652 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3639 return &m_attributeVector.at(index); 3653 return &m_attributeVector.at(index);
3640 } 3654 }
3641 3655
3642 } // namespace WebCore 3656 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElementLifecycleCallbacks.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698