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

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

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use nullptr Created 6 years, 1 month 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 { 61 {
62 const AtomicString& controlId = getAttribute(forAttr); 62 const AtomicString& controlId = getAttribute(forAttr);
63 if (controlId.isNull()) { 63 if (controlId.isNull()) {
64 // Search the children and descendants of the label element for a form e lement. 64 // Search the children and descendants of the label element for a form e lement.
65 // per http://dev.w3.org/html5/spec/Overview.html#the-label-element 65 // per http://dev.w3.org/html5/spec/Overview.html#the-label-element
66 // the form element must be "labelable form-associated element". 66 // the form element must be "labelable form-associated element".
67 for (LabelableElement& element : Traversal<LabelableElement>::descendant sOf(*this)) { 67 for (LabelableElement& element : Traversal<LabelableElement>::descendant sOf(*this)) {
68 if (element.supportLabels()) 68 if (element.supportLabels())
69 return &element; 69 return &element;
70 } 70 }
71 return 0; 71 return nullptr;
72 } 72 }
73 73
74 if (Element* element = treeScope().getElementById(controlId)) { 74 if (Element* element = treeScope().getElementById(controlId)) {
75 if (isLabelableElement(*element) && toLabelableElement(*element).support Labels()) 75 if (isLabelableElement(*element) && toLabelableElement(*element).support Labels())
76 return toLabelableElement(element); 76 return toLabelableElement(element);
77 } 77 }
78 78
79 return 0; 79 return nullptr;
80 } 80 }
81 81
82 HTMLFormElement* HTMLLabelElement::formOwner() const 82 HTMLFormElement* HTMLLabelElement::formOwner() const
83 { 83 {
84 return FormAssociatedElement::form(); 84 return FormAssociatedElement::form();
85 } 85 }
86 86
87 void HTMLLabelElement::setActive(bool down) 87 void HTMLLabelElement::setActive(bool down)
88 { 88 {
89 if (down == active()) 89 if (down == active())
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const AtomicString& attributeValue) 277 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const AtomicString& attributeValue)
278 { 278 {
279 if (attributeName == formAttr) 279 if (attributeName == formAttr)
280 formAttributeChanged(); 280 formAttributeChanged();
281 else 281 else
282 HTMLElement::parseAttribute(attributeName, attributeValue); 282 HTMLElement::parseAttribute(attributeName, attributeValue);
283 } 283 }
284 284
285 } // namespace 285 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698