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

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

Issue 460343004: Fix update of validity cache value, so that it reflects the correct state of any FormControlElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated Created 6 years, 3 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
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 AtomicString valueString = fastGetAttribute(valueAttr); 447 AtomicString valueString = fastGetAttribute(valueAttr);
448 m_inputType->warnIfValueIsInvalid(valueString); 448 m_inputType->warnIfValueIsInvalid(valueString);
449 m_valueIfDirty = sanitizeValue(valueString); 449 m_valueIfDirty = sanitizeValue(valueString);
450 } else { 450 } else {
451 if (!hasDirtyValue()) 451 if (!hasDirtyValue())
452 m_inputType->warnIfValueIsInvalid(fastGetAttribute(valueAttr).string ()); 452 m_inputType->warnIfValueIsInvalid(fastGetAttribute(valueAttr).string ());
453 updateValueIfNeeded(); 453 updateValueIfNeeded();
454 } 454 }
455 455
456 m_needsToUpdateViewValue = true; 456 m_needsToUpdateViewValue = true;
457 setNeedsValidityCheck();
457 m_inputTypeView->updateView(); 458 m_inputTypeView->updateView();
458 459
459 if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttr ibutes()) { 460 if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttr ibutes()) {
460 ASSERT(elementData()); 461 ASSERT(elementData());
461 AttributeCollection attributes = attributesWithoutUpdate(); 462 AttributeCollection attributes = attributesWithoutUpdate();
462 if (const Attribute* height = attributes.find(heightAttr)) 463 if (const Attribute* height = attributes.find(heightAttr))
463 attributeChanged(heightAttr, height->value()); 464 attributeChanged(heightAttr, height->value());
464 if (const Attribute* width = attributes.find(widthAttr)) 465 if (const Attribute* width = attributes.find(widthAttr))
465 attributeChanged(widthAttr, width->value()); 466 attributeChanged(widthAttr, width->value());
466 if (const Attribute* align = attributes.find(alignAttr)) 467 if (const Attribute* align = attributes.find(alignAttr))
467 attributeChanged(alignAttr, align->value()); 468 attributeChanged(alignAttr, align->value());
468 } 469 }
469 470
470 if (document().focusedElement() == this) 471 if (document().focusedElement() == this)
471 document().updateFocusAppearanceSoon(true /* restore selection */); 472 document().updateFocusAppearanceSoon(true /* restore selection */);
472 473
473 setChangedSinceLastFormControlChangeEvent(false); 474 setChangedSinceLastFormControlChangeEvent(false);
474 475
475 addToRadioButtonGroup(); 476 addToRadioButtonGroup();
476 477
477 setNeedsValidityCheck();
478 notifyFormStateChanged(); 478 notifyFormStateChanged();
479 } 479 }
480 480
481 void HTMLInputElement::subtreeHasChanged() 481 void HTMLInputElement::subtreeHasChanged()
482 { 482 {
483 m_inputTypeView->subtreeHasChanged(); 483 m_inputTypeView->subtreeHasChanged();
484 // When typing in an input field, childrenChanged is not called, so we need to force the directionality check. 484 // When typing in an input field, childrenChanged is not called, so we need to force the directionality check.
485 calculateAndAdjustDirectionality(); 485 calculateAndAdjustDirectionality();
486 } 486 }
487 487
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 { 1894 {
1895 listAttributeTargetChanged(); 1895 listAttributeTargetChanged();
1896 } 1896 }
1897 1897
1898 AXObject* HTMLInputElement::popupRootAXObject() 1898 AXObject* HTMLInputElement::popupRootAXObject()
1899 { 1899 {
1900 return m_inputTypeView->popupRootAXObject(); 1900 return m_inputTypeView->popupRootAXObject();
1901 } 1901 }
1902 1902
1903 } // namespace 1903 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698