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

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

Issue 101193002: Send AX focus changed events for modal dialog open/close (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: refactoring Created 7 years 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 | Annotate | Revision Log
« Source/core/dom/Document.cpp ('K') | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 61
62 static void inertSubtreesChanged(Document& document) 62 static void inertSubtreesChanged(Document& document)
63 { 63 {
64 // When a modal dialog opens or closes, nodes all over the accessibility 64 // When a modal dialog opens or closes, nodes all over the accessibility
65 // tree can change inertness which means they must be added or removed from 65 // tree can change inertness which means they must be added or removed from
66 // the tree. The most foolproof way is to clear the entire tree and rebuild 66 // the tree. The most foolproof way is to clear the entire tree and rebuild
67 // it, though a more clever way is probably possible. 67 // it, though a more clever way is probably possible.
68 Document* topDocument = document.topDocument(); 68 Document* topDocument = document.topDocument();
69 topDocument->clearAXObjectCache(); 69 topDocument->clearAXObjectCache();
70 if (AXObjectCache* cache = topDocument->axObjectCache()) 70 if (AXObjectCache* cache = topDocument->axObjectCache()) {
71 cache->childrenChanged(cache->getOrCreate(topDocument)); 71 cache->childrenChanged(cache->getOrCreate(topDocument));
72 // Screen readers appear to rely on focus to update their trees. Send
73 // one out in case one was queued up before the AX tree was cleared,
74 // rendering it meaningless.
75 cache->handleFocusedUIElementChanged(document);
76 }
72 } 77 }
73 78
74 HTMLDialogElement::HTMLDialogElement(Document& document) 79 HTMLDialogElement::HTMLDialogElement(Document& document)
75 : HTMLElement(dialogTag, document) 80 : HTMLElement(dialogTag, document)
76 , m_centeringMode(Uninitialized) 81 , m_centeringMode(Uninitialized)
77 , m_centeredPosition(0) 82 , m_centeredPosition(0)
78 , m_returnValue("") 83 , m_returnValue("")
79 { 84 {
80 ScriptWrappable::init(this); 85 ScriptWrappable::init(this);
81 } 86 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 185 }
181 186
182 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty le) const 187 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty le) const
183 { 188 {
184 if (style && style->position() == AbsolutePosition) 189 if (style && style->position() == AbsolutePosition)
185 return true; 190 return true;
186 return Element::shouldBeReparentedUnderRenderView(style); 191 return Element::shouldBeReparentedUnderRenderView(style);
187 } 192 }
188 193
189 } // namespace WebCore 194 } // namespace WebCore
OLDNEW
« Source/core/dom/Document.cpp ('K') | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698