| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (focusableDescendant) { | 67 if (focusableDescendant) { |
| 68 focusableDescendant->focus(); | 68 focusableDescendant->focus(); |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 | 71 |
| 72 if (dialog->isFocusable()) { | 72 if (dialog->isFocusable()) { |
| 73 dialog->focus(); | 73 dialog->focus(); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 | 76 |
| 77 dialog->document().setFocusedElement(0); | 77 dialog->document().setFocusedElement(nullptr); |
| 78 } | 78 } |
| 79 | 79 |
| 80 static void inertSubtreesChanged(Document& document) | 80 static void inertSubtreesChanged(Document& document) |
| 81 { | 81 { |
| 82 // When a modal dialog opens or closes, nodes all over the accessibility | 82 // When a modal dialog opens or closes, nodes all over the accessibility |
| 83 // tree can change inertness which means they must be added or removed from | 83 // tree can change inertness which means they must be added or removed from |
| 84 // the tree. The most foolproof way is to clear the entire tree and rebuild | 84 // the tree. The most foolproof way is to clear the entire tree and rebuild |
| 85 // it, though a more clever way is probably possible. | 85 // it, though a more clever way is probably possible. |
| 86 Document* topDocument = document.topDocument(); | 86 Document* topDocument = document.topDocument(); |
| 87 topDocument->clearAXObjectCache(); | 87 topDocument->clearAXObjectCache(); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 { | 199 { |
| 200 if (event->type() == EventTypeNames::cancel) { | 200 if (event->type() == EventTypeNames::cancel) { |
| 201 closeDialog(); | 201 closeDialog(); |
| 202 event->setDefaultHandled(); | 202 event->setDefaultHandled(); |
| 203 return; | 203 return; |
| 204 } | 204 } |
| 205 HTMLElement::defaultEventHandler(event); | 205 HTMLElement::defaultEventHandler(event); |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace WebCore | 208 } // namespace WebCore |
| OLD | NEW |