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

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

Issue 15871005: Avoid N^2 walk placing renderers when building the render tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merging ToT Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index e832e65abc5e3970dbf792e23f5e1146a3351523..9c38f7cee41bfb0cbeb0cce31ed78b41813d4bdd 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -1475,11 +1475,18 @@ void HTMLInputElement::didChangeForm()
addToRadioButtonGroup();
}
+void HTMLInputElement::addToRadioButtonGroupCallback(Node* node)
+{
+ ASSERT(node && node->toInputElement());
+ HTMLInputElement* inputElement = node->toInputElement();
+ inputElement->addToRadioButtonGroup();
+}
+
Node::InsertionNotificationRequest HTMLInputElement::insertedInto(ContainerNode* insertionPoint)
{
HTMLTextFormControlElement::insertedInto(insertionPoint);
- if (insertionPoint->inDocument() && !form())
- addToRadioButtonGroup();
+ if (insertionPoint->inDocument() && !form() && checkedRadioButtons())
+ queueInsertionCallback(addToRadioButtonGroupCallback, this);
resetListAttributeTargetObserver();
return InsertionDone;
}

Powered by Google App Engine
This is Rietveld 408576698