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

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

Issue 1756483005: Option, checkbox and radio should support ':default' selector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated as per review comments Created 4 years, 9 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 m_wasFocusedByMouse = false; 628 m_wasFocusedByMouse = false;
629 HTMLElement::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities); 629 HTMLElement::dispatchBlurEvent(newFocusedElement, type, sourceCapabilities);
630 hideVisibleValidationMessage(); 630 hideVisibleValidationMessage();
631 } 631 }
632 632
633 bool HTMLFormControlElement::isSuccessfulSubmitButton() const 633 bool HTMLFormControlElement::isSuccessfulSubmitButton() const
634 { 634 {
635 return canBeSuccessfulSubmitButton() && !isDisabledFormControl(); 635 return canBeSuccessfulSubmitButton() && !isDisabledFormControl();
636 } 636 }
637 637
638 bool HTMLFormControlElement::matchesDefaultPseudoClass() const
639 {
640 // HTMLFormElement::findDefaultButton() traverses the tree. So we check
641 // canBeSuccessfulSubmitButton() first for early return.
642 return canBeSuccessfulSubmitButton() && form() && form()->findDefaultButton( ) == this;
643 }
644
645 HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node * node) 638 HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node * node)
646 { 639 {
647 if (!node) 640 if (!node)
648 return nullptr; 641 return nullptr;
649 return Traversal<HTMLFormControlElement>::firstAncestorOrSelf(*node); 642 return Traversal<HTMLFormControlElement>::firstAncestorOrSelf(*node);
650 } 643 }
651 644
652 String HTMLFormControlElement::nameForAutofill() const 645 String HTMLFormControlElement::nameForAutofill() const
653 { 646 {
654 String fullName = name(); 647 String fullName = name();
(...skipping 13 matching lines...) Expand all
668 dispatchFormControlChangeEvent(); 661 dispatchFormControlChangeEvent();
669 } 662 }
670 663
671 void HTMLFormControlElement::copyNonAttributePropertiesFromElement(const Element & source) 664 void HTMLFormControlElement::copyNonAttributePropertiesFromElement(const Element & source)
672 { 665 {
673 HTMLElement::copyNonAttributePropertiesFromElement(source); 666 HTMLElement::copyNonAttributePropertiesFromElement(source);
674 setNeedsValidityCheck(); 667 setNeedsValidityCheck();
675 } 668 }
676 669
677 } // namespace blink 670 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormControlElement.h ('k') | third_party/WebKit/Source/core/html/HTMLInputElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698