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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLLabelElement.cpp

Issue 1511523002: Align HTMLImageElement relevant mutations to spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix removal issue when a text node is between <source> and <img> Created 5 years 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 /* 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, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 updateLabel(scope, nullAtom, fastGetAttribute(forAttr)); 245 updateLabel(scope, nullAtom, fastGetAttribute(forAttr));
246 } 246 }
247 247
248 // Trigger for elements outside of forms. 248 // Trigger for elements outside of forms.
249 if (!formOwner() && insertionPoint->inDocument()) 249 if (!formOwner() && insertionPoint->inDocument())
250 document().didAssociateFormControl(this); 250 document().didAssociateFormControl(this);
251 251
252 return result; 252 return result;
253 } 253 }
254 254
255 void HTMLLabelElement::removedFrom(ContainerNode* insertionPoint) 255 void HTMLLabelElement::removedFrom(ContainerNode* insertionPoint, Node* next)
256 { 256 {
257 if (insertionPoint->isInTreeScope() && treeScope() == document()) { 257 if (insertionPoint->isInTreeScope() && treeScope() == document()) {
258 TreeScope& treeScope = insertionPoint->treeScope(); 258 TreeScope& treeScope = insertionPoint->treeScope();
259 if (treeScope.shouldCacheLabelsByForAttribute()) 259 if (treeScope.shouldCacheLabelsByForAttribute())
260 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); 260 updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom);
261 } 261 }
262 HTMLElement::removedFrom(insertionPoint); 262 HTMLElement::removedFrom(insertionPoint, next);
263 FormAssociatedElement::removedFrom(insertionPoint); 263 FormAssociatedElement::removedFrom(insertionPoint, next);
264 document().removeFormAssociation(this); 264 document().removeFormAssociation(this);
265 } 265 }
266 266
267 DEFINE_TRACE(HTMLLabelElement) 267 DEFINE_TRACE(HTMLLabelElement)
268 { 268 {
269 HTMLElement::trace(visitor); 269 HTMLElement::trace(visitor);
270 FormAssociatedElement::trace(visitor); 270 FormAssociatedElement::trace(visitor);
271 } 271 }
272 272
273 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& attributeValue) 273 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const AtomicString& oldValue, const AtomicString& attributeValue)
274 { 274 {
275 if (attributeName == formAttr) { 275 if (attributeName == formAttr) {
276 formAttributeChanged(); 276 formAttributeChanged();
277 UseCounter::count(document(), UseCounter::HTMLLabelElementFormContentAtt ribute); 277 UseCounter::count(document(), UseCounter::HTMLLabelElementFormContentAtt ribute);
278 } else { 278 } else {
279 if (attributeName == forAttr) { 279 if (attributeName == forAttr) {
280 TreeScope& scope = treeScope(); 280 TreeScope& scope = treeScope();
281 if (scope.shouldCacheLabelsByForAttribute()) 281 if (scope.shouldCacheLabelsByForAttribute())
282 updateLabel(scope, oldValue, attributeValue); 282 updateLabel(scope, oldValue, attributeValue);
283 } 283 }
284 HTMLElement::parseAttribute(attributeName, oldValue, attributeValue); 284 HTMLElement::parseAttribute(attributeName, oldValue, attributeValue);
285 } 285 }
286 } 286 }
287 287
288 } // namespace 288 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698