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

Unified Diff: third_party/WebKit/Source/core/html/HTMLDialogElement.cpp

Issue 2428333002: <dialog>: don't focus non-form elements with tabindex < 0 when showModal() is called (Closed)
Patch Set: asdf Created 4 years, 2 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/HTMLDialogElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
index 9edc5883e4ea38e02f6a61618fe0434fdac93113..348ea44fcf9e0e7602f7fc8073fad541aec7a672 100644
--- a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
@@ -54,13 +54,15 @@ static void setFocusForDialog(HTMLDialogElement* dialog) {
continue;
Element* element = toElement(node);
if (element->isFormControlElement()) {
+ // TODO(dbeam): <button tabindex="-1"> or <a href="..." tabindex="-1">
+ // should not have precedence over <div tabindex="0"> but currently do.
HTMLFormControlElement* control = toHTMLFormControlElement(node);
if (control->isAutofocusable() && control->isFocusable()) {
control->focus();
return;
}
}
- if (!focusableDescendant && element->isFocusable())
+ if (!focusableDescendant && element->isKeyboardFocusable())
focusableDescendant = element;
}
@@ -69,6 +71,7 @@ static void setFocusForDialog(HTMLDialogElement* dialog) {
return;
}
+ // TODO(dbeam): should this be isKeyboardFocusable() instead?
if (dialog->isFocusable()) {
dialog->focus();
return;

Powered by Google App Engine
This is Rietveld 408576698