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

Unified Diff: Source/core/html/HTMLFieldSetElement.cpp

Issue 68173014: Have ElementTraversal::firstWithin() take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLFieldSetElement.h ('k') | Source/core/html/HTMLNameCollection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFieldSetElement.cpp
diff --git a/Source/core/html/HTMLFieldSetElement.cpp b/Source/core/html/HTMLFieldSetElement.cpp
index 130d800e40d4883bb9d5bc6ba3209b4f3c2a3c5b..bf568d1417c08dcfd7cd2dc9da8b707ad3305ec3 100644
--- a/Source/core/html/HTMLFieldSetElement.cpp
+++ b/Source/core/html/HTMLFieldSetElement.cpp
@@ -49,9 +49,9 @@ PassRefPtr<HTMLFieldSetElement> HTMLFieldSetElement::create(Document& document,
return adoptRef(new HTMLFieldSetElement(document, form));
}
-void HTMLFieldSetElement::invalidateDisabledStateUnder(Element* base)
+void HTMLFieldSetElement::invalidateDisabledStateUnder(Element& base)
{
- for (Element* element = ElementTraversal::firstWithin(base); element; element = ElementTraversal::next(*element, base)) {
+ for (Element* element = ElementTraversal::firstWithin(base); element; element = ElementTraversal::next(*element, &base)) {
if (element->isFormControlElement())
toHTMLFormControlElement(element)->ancestorDisabledStateWasChanged();
}
@@ -61,15 +61,15 @@ void HTMLFieldSetElement::disabledAttributeChanged()
{
// This element must be updated before the style of nodes in its subtree gets recalculated.
HTMLFormControlElement::disabledAttributeChanged();
- invalidateDisabledStateUnder(this);
+ invalidateDisabledStateUnder(*this);
}
void HTMLFieldSetElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
HTMLFormControlElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- for (Element* element = ElementTraversal::firstWithin(this); element; element = ElementTraversal::nextSkippingChildren(*element, this)) {
+ for (Element* element = ElementTraversal::firstWithin(*this); element; element = ElementTraversal::nextSkippingChildren(*element, this)) {
if (element->hasTagName(legendTag))
- invalidateDisabledStateUnder(element);
+ invalidateDisabledStateUnder(*element);
}
}
@@ -91,7 +91,7 @@ RenderObject* HTMLFieldSetElement::createRenderer(RenderStyle*)
HTMLLegendElement* HTMLFieldSetElement::legend() const
{
- for (Element* child = ElementTraversal::firstWithin(this); child; child = ElementTraversal::nextSkippingChildren(*child, this)) {
+ for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSkippingChildren(*child, this)) {
if (child->hasTagName(legendTag))
return toHTMLLegendElement(child);
}
@@ -113,7 +113,7 @@ void HTMLFieldSetElement::refreshElementsIfNeeded() const
m_associatedElements.clear();
- for (Element* element = ElementTraversal::firstWithin(this); element; element = ElementTraversal::next(*element, this)) {
+ for (Element* element = ElementTraversal::firstWithin(*this); element; element = ElementTraversal::next(*element, this)) {
if (element->hasTagName(objectTag)) {
m_associatedElements.append(toHTMLObjectElement(element));
continue;
« no previous file with comments | « Source/core/html/HTMLFieldSetElement.h ('k') | Source/core/html/HTMLNameCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698