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

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

Issue 436603003: Make Element::attributes() less error-prone and simplify call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Keep synchronizeAllAttributes() in hasAttributes() Created 6 years, 4 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 | Annotate | Revision Log
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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 AtomicString valueString = fastGetAttribute(valueAttr); 441 AtomicString valueString = fastGetAttribute(valueAttr);
442 m_valueIfDirty = sanitizeValue(valueString); 442 m_valueIfDirty = sanitizeValue(valueString);
443 } else 443 } else
444 updateValueIfNeeded(); 444 updateValueIfNeeded();
445 445
446 m_needsToUpdateViewValue = true; 446 m_needsToUpdateViewValue = true;
447 m_inputTypeView->updateView(); 447 m_inputTypeView->updateView();
448 448
449 if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttr ibutes()) { 449 if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttr ibutes()) {
450 ASSERT(elementData()); 450 ASSERT(elementData());
451 AttributeCollection attributes = this->attributes(); 451 AttributeCollection attributes = this->attributesWithoutUpdate();
adamk 2014/08/04 18:54:34 Nit: you can drop |this| here.
Inactive 2014/08/04 19:39:52 Done.
452 if (const Attribute* height = attributes.find(heightAttr)) 452 if (const Attribute* height = attributes.find(heightAttr))
453 attributeChanged(heightAttr, height->value()); 453 attributeChanged(heightAttr, height->value());
454 if (const Attribute* width = attributes.find(widthAttr)) 454 if (const Attribute* width = attributes.find(widthAttr))
455 attributeChanged(widthAttr, width->value()); 455 attributeChanged(widthAttr, width->value());
456 if (const Attribute* align = attributes.find(alignAttr)) 456 if (const Attribute* align = attributes.find(alignAttr))
457 attributeChanged(alignAttr, align->value()); 457 attributeChanged(alignAttr, align->value());
458 } 458 }
459 459
460 if (document().focusedElement() == this) 460 if (document().focusedElement() == this)
461 document().updateFocusAppearanceSoon(true /* restore selection */); 461 document().updateFocusAppearanceSoon(true /* restore selection */);
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 { 1880 {
1881 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue) ; 1881 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue) ;
1882 } 1882 }
1883 1883
1884 void HTMLInputElement::didNotifySubtreeInsertionsToDocument() 1884 void HTMLInputElement::didNotifySubtreeInsertionsToDocument()
1885 { 1885 {
1886 listAttributeTargetChanged(); 1886 listAttributeTargetChanged();
1887 } 1887 }
1888 1888
1889 } // namespace 1889 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698