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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 dialog->document().clearFocusedElement(); | 78 dialog->document().clearFocusedElement(); |
79 } | 79 } |
80 | 80 |
81 static void inertSubtreesChanged(Document& document) | 81 static void inertSubtreesChanged(Document& document) |
82 { | 82 { |
83 // When a modal dialog opens or closes, nodes all over the accessibility | 83 // When a modal dialog opens or closes, nodes all over the accessibility |
84 // tree can change inertness which means they must be added or removed from | 84 // tree can change inertness which means they must be added or removed from |
85 // the tree. The most foolproof way is to clear the entire tree and rebuild | 85 // the tree. The most foolproof way is to clear the entire tree and rebuild |
86 // it, though a more clever way is probably possible. | 86 // it, though a more clever way is probably possible. |
87 Document& topDocument = document.topDocument(); | 87 document.clearAXObjectCache(); |
88 topDocument.clearAXObjectCache(); | 88 if (AXObjectCache* cache = document.axObjectCache()) |
89 if (AXObjectCache* cache = topDocument.axObjectCache()) | 89 cache->childrenChanged(&document); |
90 cache->childrenChanged(&topDocument); | |
91 } | 90 } |
92 | 91 |
93 inline HTMLDialogElement::HTMLDialogElement(Document& document) | 92 inline HTMLDialogElement::HTMLDialogElement(Document& document) |
94 : HTMLElement(dialogTag, document) | 93 : HTMLElement(dialogTag, document) |
95 , m_centeringMode(NotCentered) | 94 , m_centeringMode(NotCentered) |
96 , m_centeredPosition(0) | 95 , m_centeredPosition(0) |
97 , m_returnValue("") | 96 , m_returnValue("") |
98 { | 97 { |
99 UseCounter::count(document, UseCounter::DialogElement); | 98 UseCounter::count(document, UseCounter::DialogElement); |
100 } | 99 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 { | 202 { |
204 if (event->type() == EventTypeNames::cancel) { | 203 if (event->type() == EventTypeNames::cancel) { |
205 closeDialog(); | 204 closeDialog(); |
206 event->setDefaultHandled(); | 205 event->setDefaultHandled(); |
207 return; | 206 return; |
208 } | 207 } |
209 HTMLElement::defaultEventHandler(event); | 208 HTMLElement::defaultEventHandler(event); |
210 } | 209 } |
211 | 210 |
212 } // namespace blink | 211 } // namespace blink |
OLD | NEW |