| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 , m_returnValue("") | 77 , m_returnValue("") |
| 78 { | 78 { |
| 79 ScriptWrappable::init(this); | 79 ScriptWrappable::init(this); |
| 80 } | 80 } |
| 81 | 81 |
| 82 PassRefPtr<HTMLDialogElement> HTMLDialogElement::create(Document& document) | 82 PassRefPtr<HTMLDialogElement> HTMLDialogElement::create(Document& document) |
| 83 { | 83 { |
| 84 return adoptRef(new HTMLDialogElement(document)); | 84 return adoptRef(new HTMLDialogElement(document)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void HTMLDialogElement::close(const String& returnValue, ExceptionState& es) | 87 void HTMLDialogElement::close(const String& returnValue, ExceptionState& excepti
onState) |
| 88 { | 88 { |
| 89 if (!fastHasAttribute(openAttr)) { | 89 if (!fastHasAttribute(openAttr)) { |
| 90 es.throwUninformativeAndGenericDOMException(InvalidStateError); | 90 exceptionState.throwUninformativeAndGenericDOMException(InvalidStateErro
r); |
| 91 return; | 91 return; |
| 92 } | 92 } |
| 93 closeDialog(returnValue); | 93 closeDialog(returnValue); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void HTMLDialogElement::closeDialog(const String& returnValue) | 96 void HTMLDialogElement::closeDialog(const String& returnValue) |
| 97 { | 97 { |
| 98 if (!fastHasAttribute(openAttr)) | 98 if (!fastHasAttribute(openAttr)) |
| 99 return; | 99 return; |
| 100 setBooleanAttribute(openAttr, false); | 100 setBooleanAttribute(openAttr, false); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 119 } | 119 } |
| 120 | 120 |
| 121 void HTMLDialogElement::show() | 121 void HTMLDialogElement::show() |
| 122 { | 122 { |
| 123 if (fastHasAttribute(openAttr)) | 123 if (fastHasAttribute(openAttr)) |
| 124 return; | 124 return; |
| 125 setBooleanAttribute(openAttr, true); | 125 setBooleanAttribute(openAttr, true); |
| 126 forceLayoutForCentering(); | 126 forceLayoutForCentering(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void HTMLDialogElement::showModal(ExceptionState& es) | 129 void HTMLDialogElement::showModal(ExceptionState& exceptionState) |
| 130 { | 130 { |
| 131 if (fastHasAttribute(openAttr) || !inDocument()) { | 131 if (fastHasAttribute(openAttr) || !inDocument()) { |
| 132 es.throwUninformativeAndGenericDOMException(InvalidStateError); | 132 exceptionState.throwUninformativeAndGenericDOMException(InvalidStateErro
r); |
| 133 return; | 133 return; |
| 134 } | 134 } |
| 135 document().addToTopLayer(this); | 135 document().addToTopLayer(this); |
| 136 setBooleanAttribute(openAttr, true); | 136 setBooleanAttribute(openAttr, true); |
| 137 | 137 |
| 138 runAutofocus(this); | 138 runAutofocus(this); |
| 139 forceLayoutForCentering(); | 139 forceLayoutForCentering(); |
| 140 inertSubtreesChanged(document()); | 140 inertSubtreesChanged(document()); |
| 141 } | 141 } |
| 142 | 142 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty
le) const | 176 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty
le) const |
| 177 { | 177 { |
| 178 if (style && style->position() == AbsolutePosition) | 178 if (style && style->position() == AbsolutePosition) |
| 179 return true; | 179 return true; |
| 180 return Element::shouldBeReparentedUnderRenderView(style); | 180 return Element::shouldBeReparentedUnderRenderView(style); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace WebCore | 183 } // namespace WebCore |
| OLD | NEW |