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

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

Issue 148463008: Update is-valid flag upon resetting input elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch test over to use js-test.js Created 6 years, 10 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 void HTMLFormControlElement::setNeedsValidityCheck() 451 void HTMLFormControlElement::setNeedsValidityCheck()
452 { 452 {
453 bool newIsValid = valid(); 453 bool newIsValid = valid();
454 if (willValidate() && newIsValid != m_isValid) { 454 if (willValidate() && newIsValid != m_isValid) {
455 // Update style for pseudo classes such as :valid :invalid. 455 // Update style for pseudo classes such as :valid :invalid.
456 setNeedsStyleRecalc(); 456 setNeedsStyleRecalc();
457 } 457 }
458 m_isValid = newIsValid; 458 m_isValid = newIsValid;
459 459
460 // Updates only if this control already has a validtion message. 460 // Updates only if this control already has a validation message.
461 if (m_validationMessage && m_validationMessage->isVisible()) { 461 if (m_validationMessage && m_validationMessage->isVisible()) {
462 // Calls updateVisibleValidationMessage() even if m_isValid is not 462 // Calls updateVisibleValidationMessage() even if m_isValid is not
463 // changed because a validation message can be chagned. 463 // changed because a validation message can be chagned.
464 updateVisibleValidationMessage(); 464 updateVisibleValidationMessage();
465 } 465 }
466 } 466 }
467 467
468 void HTMLFormControlElement::setCustomValidity(const String& error) 468 void HTMLFormControlElement::setCustomValidity(const String& error)
469 { 469 {
470 FormAssociatedElement::setCustomValidity(error); 470 FormAssociatedElement::setCustomValidity(error);
(...skipping 30 matching lines...) Expand all
501 String fullName = name(); 501 String fullName = name();
502 String trimmedName = fullName.stripWhiteSpace(); 502 String trimmedName = fullName.stripWhiteSpace();
503 if (!trimmedName.isEmpty()) 503 if (!trimmedName.isEmpty())
504 return trimmedName; 504 return trimmedName;
505 fullName = getIdAttribute(); 505 fullName = getIdAttribute();
506 trimmedName = fullName.stripWhiteSpace(); 506 trimmedName = fullName.stripWhiteSpace();
507 return trimmedName; 507 return trimmedName;
508 } 508 }
509 509
510 } // namespace Webcore 510 } // namespace Webcore
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/file/file-input-reset-validation-expected.txt ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698