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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 setFocusForDialog(this); 147 setFocusForDialog(this);
148 } 148 }
149 149
150 void HTMLDialogElement::showModal(ExceptionState& exceptionState) 150 void HTMLDialogElement::showModal(ExceptionState& exceptionState)
151 { 151 {
152 if (fastHasAttribute(openAttr)) { 152 if (fastHasAttribute(openAttr)) {
153 exceptionState.throwDOMException(InvalidStateError, "The element already has an 'open' attribute, and therefore cannot be opened modally."); 153 exceptionState.throwDOMException(InvalidStateError, "The element already has an 'open' attribute, and therefore cannot be opened modally.");
154 return; 154 return;
155 } 155 }
156 if (!inDocument()) { 156 if (!inShadowIncludingDocument()) {
157 exceptionState.throwDOMException(InvalidStateError, "The element is not in a Document."); 157 exceptionState.throwDOMException(InvalidStateError, "The element is not in a Document.");
158 return; 158 return;
159 } 159 }
160 160
161 document().addToTopLayer(this); 161 document().addToTopLayer(this);
162 setBooleanAttribute(openAttr, true); 162 setBooleanAttribute(openAttr, true);
163 163
164 // Throw away the AX cache first, so the subsequent steps don't have a chanc e of queuing up 164 // Throw away the AX cache first, so the subsequent steps don't have a chanc e of queuing up
165 // AX events on objects that would be invalidated when the cache is thrown a way. 165 // AX events on objects that would be invalidated when the cache is thrown a way.
166 inertSubtreesChanged(document()); 166 inertSubtreesChanged(document());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 { 202 {
203 if (event->type() == EventTypeNames::cancel) { 203 if (event->type() == EventTypeNames::cancel) {
204 closeDialog(); 204 closeDialog();
205 event->setDefaultHandled(); 205 event->setDefaultHandled();
206 return; 206 return;
207 } 207 }
208 HTMLElement::defaultEventHandler(event); 208 HTMLElement::defaultEventHandler(event);
209 } 209 }
210 210
211 } // namespace blink 211 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698