| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |