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

Unified Diff: third_party/WebKit/Source/core/html/HTMLButtonElement.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, 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp b/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
index f9c89becb2af0466fcb39bb3821d4d51c8a8802c..44a97178edc587d66835b7fa6c013f9020a511bd 100644
--- a/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
@@ -214,6 +214,13 @@ bool HTMLButtonElement::supportsAutofocus() const
return true;
}
+bool HTMLButtonElement::matchesDefaultPseudoClass() const
+{
+ // HTMLFormElement::findDefaultButton() traverses the tree. So we check
+ // canBeSuccessfulSubmitButton() first for early return.
+ return canBeSuccessfulSubmitButton() && form() && form()->findDefaultButton() == this;
+}
+
Node::InsertionNotificationRequest HTMLButtonElement::insertedInto(ContainerNode* insertionPoint)
{
InsertionNotificationRequest request = HTMLFormControlElement::insertedInto(insertionPoint);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLButtonElement.h ('k') | third_party/WebKit/Source/core/html/HTMLFormControlElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698