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

Side by Side 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 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, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 removeFromRadioButtonGroup(); 1468 removeFromRadioButtonGroup();
1469 HTMLTextFormControlElement::willChangeForm(); 1469 HTMLTextFormControlElement::willChangeForm();
1470 } 1470 }
1471 1471
1472 void HTMLInputElement::didChangeForm() 1472 void HTMLInputElement::didChangeForm()
1473 { 1473 {
1474 HTMLTextFormControlElement::didChangeForm(); 1474 HTMLTextFormControlElement::didChangeForm();
1475 addToRadioButtonGroup(); 1475 addToRadioButtonGroup();
1476 } 1476 }
1477 1477
1478 void HTMLInputElement::addToRadioButtonGroupCallback(Node* node)
1479 {
1480 ASSERT(node && node->toInputElement());
1481 HTMLInputElement* inputElement = node->toInputElement();
1482 inputElement->addToRadioButtonGroup();
1483 }
1484
1478 Node::InsertionNotificationRequest HTMLInputElement::insertedInto(ContainerNode* insertionPoint) 1485 Node::InsertionNotificationRequest HTMLInputElement::insertedInto(ContainerNode* insertionPoint)
1479 { 1486 {
1480 HTMLTextFormControlElement::insertedInto(insertionPoint); 1487 HTMLTextFormControlElement::insertedInto(insertionPoint);
1481 if (insertionPoint->inDocument() && !form()) 1488 if (insertionPoint->inDocument() && !form() && checkedRadioButtons())
1482 addToRadioButtonGroup(); 1489 queueInsertionCallback(addToRadioButtonGroupCallback, this);
1483 resetListAttributeTargetObserver(); 1490 resetListAttributeTargetObserver();
1484 return InsertionDone; 1491 return InsertionDone;
1485 } 1492 }
1486 1493
1487 void HTMLInputElement::removedFrom(ContainerNode* insertionPoint) 1494 void HTMLInputElement::removedFrom(ContainerNode* insertionPoint)
1488 { 1495 {
1489 if (insertionPoint->inDocument() && !form()) 1496 if (insertionPoint->inDocument() && !form())
1490 removeFromRadioButtonGroup(); 1497 removeFromRadioButtonGroup();
1491 HTMLTextFormControlElement::removedFrom(insertionPoint); 1498 HTMLTextFormControlElement::removedFrom(insertionPoint);
1492 ASSERT(!inDocument()); 1499 ASSERT(!inDocument());
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 } 1930 }
1924 1931
1925 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1932 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1926 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1933 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1927 { 1934 {
1928 return m_inputType->customStyleForRenderer(originalStyleForRenderer()); 1935 return m_inputType->customStyleForRenderer(originalStyleForRenderer());
1929 } 1936 }
1930 #endif 1937 #endif
1931 1938
1932 } // namespace 1939 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698