| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 if (AXObjectCache* cache = topDocument.axObjectCache()) | 90 if (AXObjectCache* cache = topDocument.axObjectCache()) |
| 91 cache->childrenChanged(cache->getOrCreate(&topDocument)); | 91 cache->childrenChanged(cache->getOrCreate(&topDocument)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 inline HTMLDialogElement::HTMLDialogElement(Document& document) | 94 inline HTMLDialogElement::HTMLDialogElement(Document& document) |
| 95 : HTMLElement(dialogTag, document) | 95 : HTMLElement(dialogTag, document) |
| 96 , m_centeringMode(NotCentered) | 96 , m_centeringMode(NotCentered) |
| 97 , m_centeredPosition(0) | 97 , m_centeredPosition(0) |
| 98 , m_returnValue("") | 98 , m_returnValue("") |
| 99 { | 99 { |
| 100 ScriptWrappable::init(this); | |
| 101 UseCounter::count(document, UseCounter::DialogElement); | 100 UseCounter::count(document, UseCounter::DialogElement); |
| 102 } | 101 } |
| 103 | 102 |
| 104 DEFINE_NODE_FACTORY(HTMLDialogElement) | 103 DEFINE_NODE_FACTORY(HTMLDialogElement) |
| 105 | 104 |
| 106 void HTMLDialogElement::close(const String& returnValue, ExceptionState& excepti
onState) | 105 void HTMLDialogElement::close(const String& returnValue, ExceptionState& excepti
onState) |
| 107 { | 106 { |
| 108 if (!fastHasAttribute(openAttr)) { | 107 if (!fastHasAttribute(openAttr)) { |
| 109 exceptionState.throwDOMException(InvalidStateError, "The element does no
t have an 'open' attribute, and therefore cannot be closed."); | 108 exceptionState.throwDOMException(InvalidStateError, "The element does no
t have an 'open' attribute, and therefore cannot be closed."); |
| 110 return; | 109 return; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 { | 198 { |
| 200 if (event->type() == EventTypeNames::cancel) { | 199 if (event->type() == EventTypeNames::cancel) { |
| 201 closeDialog(); | 200 closeDialog(); |
| 202 event->setDefaultHandled(); | 201 event->setDefaultHandled(); |
| 203 return; | 202 return; |
| 204 } | 203 } |
| 205 HTMLElement::defaultEventHandler(event); | 204 HTMLElement::defaultEventHandler(event); |
| 206 } | 205 } |
| 207 | 206 |
| 208 } // namespace blink | 207 } // namespace blink |
| OLD | NEW |