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

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

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fileapi/FileReader.cpp ('k') | Source/core/html/HTMLElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 PassRefPtr<HTMLDialogElement> HTMLDialogElement::create(const QualifiedName& tag Name, Document& document) 55 PassRefPtr<HTMLDialogElement> HTMLDialogElement::create(const QualifiedName& tag Name, Document& document)
56 { 56 {
57 return adoptRef(new HTMLDialogElement(tagName, document)); 57 return adoptRef(new HTMLDialogElement(tagName, document));
58 } 58 }
59 59
60 void HTMLDialogElement::close(const String& returnValue, ExceptionState& es) 60 void HTMLDialogElement::close(const String& returnValue, ExceptionState& es)
61 { 61 {
62 if (!fastHasAttribute(openAttr)) { 62 if (!fastHasAttribute(openAttr)) {
63 es.throwDOMException(InvalidStateError); 63 es.throwUninformativeAndGenericDOMException(InvalidStateError);
64 return; 64 return;
65 } 65 }
66 closeDialog(returnValue); 66 closeDialog(returnValue);
67 } 67 }
68 68
69 void HTMLDialogElement::closeDialog(const String& returnValue) 69 void HTMLDialogElement::closeDialog(const String& returnValue)
70 { 70 {
71 setBooleanAttribute(openAttr, false); 71 setBooleanAttribute(openAttr, false);
72 document().removeFromTopLayer(this); 72 document().removeFromTopLayer(this);
73 m_topIsValid = false; 73 m_topIsValid = false;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 { 116 {
117 if (fastHasAttribute(openAttr)) 117 if (fastHasAttribute(openAttr))
118 return; 118 return;
119 setBooleanAttribute(openAttr, true); 119 setBooleanAttribute(openAttr, true);
120 reposition(); 120 reposition();
121 } 121 }
122 122
123 void HTMLDialogElement::showModal(ExceptionState& es) 123 void HTMLDialogElement::showModal(ExceptionState& es)
124 { 124 {
125 if (fastHasAttribute(openAttr) || !inDocument()) { 125 if (fastHasAttribute(openAttr) || !inDocument()) {
126 es.throwDOMException(InvalidStateError); 126 es.throwUninformativeAndGenericDOMException(InvalidStateError);
127 return; 127 return;
128 } 128 }
129 document().addToTopLayer(this); 129 document().addToTopLayer(this);
130 setBooleanAttribute(openAttr, true); 130 setBooleanAttribute(openAttr, true);
131 reposition(); 131 reposition();
132 } 132 }
133 133
134 bool HTMLDialogElement::isPresentationAttribute(const QualifiedName& name) const 134 bool HTMLDialogElement::isPresentationAttribute(const QualifiedName& name) const
135 { 135 {
136 // FIXME: Workaround for <https://bugs.webkit.org/show_bug.cgi?id=91058>: mo difying an attribute for which there is an attribute selector 136 // FIXME: Workaround for <https://bugs.webkit.org/show_bug.cgi?id=91058>: mo difying an attribute for which there is an attribute selector
(...skipping 15 matching lines...) Expand all
152 } 152 }
153 153
154 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty le) const 154 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty le) const
155 { 155 {
156 if (style && style->position() == AbsolutePosition) 156 if (style && style->position() == AbsolutePosition)
157 return true; 157 return true;
158 return Element::shouldBeReparentedUnderRenderView(style); 158 return Element::shouldBeReparentedUnderRenderView(style);
159 } 159 }
160 160
161 } // namespace WebCore 161 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/fileapi/FileReader.cpp ('k') | Source/core/html/HTMLElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698