Changeset 123193 in webkit
- Timestamp:
- Jul 20, 2012 1:28:37 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r123192 r123193 1 2012-07-20 Matt Falkenhagen <falken@chromium.org> 2 3 Show or hide <dialog> depending on the open attribute 4 https://bugs.webkit.org/show_bug.cgi?id=90931 5 6 Reviewed by Kent Tamura. 7 8 * fast/dom/HTMLDialogElement/dialog-open-expected.txt: Added. 9 * fast/dom/HTMLDialogElement/dialog-open.html: Added. 10 1 11 2012-07-20 Shinya Kawanaka <shinyak@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r123192 r123193 1 2012-07-20 Matt Falkenhagen <falken@chromium.org> 2 3 Show or hide <dialog> depending on the open attribute 4 https://bugs.webkit.org/show_bug.cgi?id=90931 5 6 Reviewed by Kent Tamura. 7 8 Test: fast/dom/HTMLDialogElement/dialog-open.html 9 10 * css/html.css: Add CSS for dialog. This is copied verbatim from the HTML5 spec: http://www.whatwg.org/specs/web-apps/current-work/#flow-content-1 11 (dialog:not([open])): 12 (dialog): 13 * html/HTMLDialogElement.cpp: 14 (WebCore::HTMLDialogElement::close): Set open to false, to hide the dialog. 15 (WebCore::HTMLDialogElement::show): Set open to true, to show the dialog. 16 (WebCore): 17 (WebCore::HTMLDialogElement::isPresentationAttribute): Make openAttr a presentation attribute, to work around bug 91058 18 * html/HTMLDialogElement.h: 19 (HTMLDialogElement): 20 * html/HTMLDialogElement.idl: 21 1 22 2012-07-20 Shinya Kawanaka <shinyak@chromium.org> 2 23 -
trunk/Source/WebCore/css/html.css
r122824 r123193 141 141 } 142 142 143 #if defined(ENABLE_DIALOG_ELEMENT) && ENABLE_DIALOG_ELEMENT 144 dialog:not([open]) { display: none; } 145 dialog { 146 position: absolute; 147 left: 0; right: 0; 148 margin: auto; 149 border: solid; 150 padding: 1em; 151 background: white; 152 color: black; 153 } 154 #endif 155 143 156 /* heading elements */ 144 157 -
trunk/Source/WebCore/html/HTMLDialogElement.cpp
r122195 r123193 29 29 #if ENABLE(DIALOG_ELEMENT) 30 30 31 #include "ExceptionCode.h" 32 31 33 namespace WebCore { 32 34 … … 44 46 } 45 47 46 void HTMLDialogElement::close( )48 void HTMLDialogElement::close(ExceptionCode& ec) 47 49 { 48 // FIXME: Implement. 50 if (!fastHasAttribute(openAttr)) { 51 ec = INVALID_STATE_ERR; 52 return; 53 } 54 setBooleanAttribute(openAttr, false); 49 55 } 50 56 51 57 void HTMLDialogElement::show() 52 58 { 53 // FIXME: Implement. 59 if (fastHasAttribute(openAttr)) 60 return; 61 setBooleanAttribute(openAttr, true); 62 } 63 64 bool HTMLDialogElement::isPresentationAttribute(const QualifiedName& name) const 65 { 66 // FIXME: Workaround for <https://bugs.webkit.org/show_bug.cgi?id=91058>: modifying an attribute for which there is an attribute selector 67 // in html.css sometimes does not trigger a style recalc. 68 if (name == openAttr) 69 return true; 70 71 return HTMLElement::isPresentationAttribute(name); 54 72 } 55 73 -
trunk/Source/WebCore/html/HTMLDialogElement.h
r122195 r123193 40 40 static PassRefPtr<HTMLDialogElement> create(const QualifiedName&, Document*); 41 41 42 void close( );42 void close(ExceptionCode&); 43 43 void show(); 44 44 45 45 private: 46 46 HTMLDialogElement(const QualifiedName&, Document*); 47 48 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; 47 49 }; 48 50 -
trunk/Source/WebCore/html/HTMLDialogElement.idl
r122195 r123193 30 30 ] HTMLDialogElement : HTMLElement { 31 31 attribute [Reflect] boolean open; 32 void close() ;32 void close() raises(DOMException); 33 33 void show(); 34 34 };
Note: See TracChangeset
for help on using the changeset viewer.