| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 PassRefPtr<HTMLDialogElement> HTMLDialogElement::create(const QualifiedName& tag
Name, Document* document) | 53 PassRefPtr<HTMLDialogElement> HTMLDialogElement::create(const QualifiedName& tag
Name, Document* document) |
| 54 { | 54 { |
| 55 return adoptRef(new HTMLDialogElement(tagName, document)); | 55 return adoptRef(new HTMLDialogElement(tagName, document)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void HTMLDialogElement::close(ExceptionCode& ec) | 58 void HTMLDialogElement::close(ExceptionCode& ec) |
| 59 { | 59 { |
| 60 if (!fastHasAttribute(openAttr)) { | 60 if (!fastHasAttribute(openAttr)) { |
| 61 ec = INVALID_STATE_ERR; | 61 ec = InvalidStateError; |
| 62 return; | 62 return; |
| 63 } | 63 } |
| 64 setBooleanAttribute(openAttr, false); | 64 setBooleanAttribute(openAttr, false); |
| 65 document()->removeFromTopLayer(this); | 65 document()->removeFromTopLayer(this); |
| 66 m_topIsValid = false; | 66 m_topIsValid = false; |
| 67 } | 67 } |
| 68 | 68 |
| 69 PassRefPtr<RenderStyle> HTMLDialogElement::customStyleForRenderer() | 69 PassRefPtr<RenderStyle> HTMLDialogElement::customStyleForRenderer() |
| 70 { | 70 { |
| 71 RefPtr<RenderStyle> originalStyle = originalStyleForRenderer(); | 71 RefPtr<RenderStyle> originalStyle = originalStyleForRenderer(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 { | 104 { |
| 105 if (fastHasAttribute(openAttr)) | 105 if (fastHasAttribute(openAttr)) |
| 106 return; | 106 return; |
| 107 setBooleanAttribute(openAttr, true); | 107 setBooleanAttribute(openAttr, true); |
| 108 reposition(); | 108 reposition(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void HTMLDialogElement::showModal(ExceptionCode& ec) | 111 void HTMLDialogElement::showModal(ExceptionCode& ec) |
| 112 { | 112 { |
| 113 if (fastHasAttribute(openAttr) || !inDocument()) { | 113 if (fastHasAttribute(openAttr) || !inDocument()) { |
| 114 ec = INVALID_STATE_ERR; | 114 ec = InvalidStateError; |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 document()->addToTopLayer(this); | 117 document()->addToTopLayer(this); |
| 118 setBooleanAttribute(openAttr, true); | 118 setBooleanAttribute(openAttr, true); |
| 119 reposition(); | 119 reposition(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool HTMLDialogElement::isPresentationAttribute(const QualifiedName& name) const | 122 bool HTMLDialogElement::isPresentationAttribute(const QualifiedName& name) const |
| 123 { | 123 { |
| 124 // FIXME: Workaround for <https://bugs.webkit.org/show_bug.cgi?id=91058>: mo
difying an attribute for which there is an attribute selector | 124 // FIXME: Workaround for <https://bugs.webkit.org/show_bug.cgi?id=91058>: mo
difying an attribute for which there is an attribute selector |
| 125 // in html.css sometimes does not trigger a style recalc. | 125 // in html.css sometimes does not trigger a style recalc. |
| 126 if (name == openAttr) | 126 if (name == openAttr) |
| 127 return true; | 127 return true; |
| 128 | 128 |
| 129 return HTMLElement::isPresentationAttribute(name); | 129 return HTMLElement::isPresentationAttribute(name); |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty
le) const | 132 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty
le) const |
| 133 { | 133 { |
| 134 if (style && style->position() == AbsolutePosition) | 134 if (style && style->position() == AbsolutePosition) |
| 135 return true; | 135 return true; |
| 136 return Element::shouldBeReparentedUnderRenderView(style); | 136 return Element::shouldBeReparentedUnderRenderView(style); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace WebCore | 139 } // namespace WebCore |
| OLD | NEW |