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

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

Issue 179163004: Have Document::topDocument() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months 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
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 dialog->document().setFocusedElement(nullptr); 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();
88 if (AXObjectCache* cache = topDocument->axObjectCache()) 88 if (AXObjectCache* cache = topDocument.axObjectCache())
89 cache->childrenChanged(cache->getOrCreate(topDocument)); 89 cache->childrenChanged(cache->getOrCreate(&topDocument));
90 } 90 }
91 91
92 HTMLDialogElement::HTMLDialogElement(Document& document) 92 HTMLDialogElement::HTMLDialogElement(Document& document)
93 : HTMLElement(dialogTag, document) 93 : HTMLElement(dialogTag, document)
94 , m_centeringMode(NotCentered) 94 , m_centeringMode(NotCentered)
95 , m_centeredPosition(0) 95 , m_centeredPosition(0)
96 , m_returnValue("") 96 , m_returnValue("")
97 { 97 {
98 ScriptWrappable::init(this); 98 ScriptWrappable::init(this);
99 } 99 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698