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

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

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

Powered by Google App Engine
This is Rietveld 408576698