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

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

Issue 1433103002: Use FocusParams in FocusController::setFocusedElement and Document::setFocusedElement arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (focusableDescendant) { 69 if (focusableDescendant) {
70 focusableDescendant->focus(); 70 focusableDescendant->focus();
71 return; 71 return;
72 } 72 }
73 73
74 if (dialog->isFocusable()) { 74 if (dialog->isFocusable()) {
75 dialog->focus(); 75 dialog->focus();
76 return; 76 return;
77 } 77 }
78 78
79 dialog->document().setFocusedElement(nullptr); 79 dialog->document().clearFocusedElement();
80 } 80 }
81 81
82 static void inertSubtreesChanged(Document& document) 82 static void inertSubtreesChanged(Document& document)
83 { 83 {
84 // When a modal dialog opens or closes, nodes all over the accessibility 84 // When a modal dialog opens or closes, nodes all over the accessibility
85 // tree can change inertness which means they must be added or removed from 85 // tree can change inertness which means they must be added or removed from
86 // the tree. The most foolproof way is to clear the entire tree and rebuild 86 // the tree. The most foolproof way is to clear the entire tree and rebuild
87 // it, though a more clever way is probably possible. 87 // it, though a more clever way is probably possible.
88 Document& topDocument = document.topDocument(); 88 Document& topDocument = document.topDocument();
89 topDocument.clearAXObjectCache(); 89 topDocument.clearAXObjectCache();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 { 198 {
199 if (event->type() == EventTypeNames::cancel) { 199 if (event->type() == EventTypeNames::cancel) {
200 closeDialog(); 200 closeDialog();
201 event->setDefaultHandled(); 201 event->setDefaultHandled();
202 return; 202 return;
203 } 203 }
204 HTMLElement::defaultEventHandler(event); 204 HTMLElement::defaultEventHandler(event);
205 } 205 }
206 206
207 } // namespace blink 207 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698