| 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 25 matching lines...) Expand all Loading... |
| 36 class QualifiedName; | 36 class QualifiedName; |
| 37 | 37 |
| 38 class HTMLDialogElement FINAL : public HTMLElement { | 38 class HTMLDialogElement FINAL : public HTMLElement { |
| 39 public: | 39 public: |
| 40 static PassRefPtr<HTMLDialogElement> create(Document&); | 40 static PassRefPtr<HTMLDialogElement> create(Document&); |
| 41 | 41 |
| 42 void close(const String& returnValue, ExceptionState&); | 42 void close(const String& returnValue, ExceptionState&); |
| 43 void closeDialog(const String& returnValue = String()); | 43 void closeDialog(const String& returnValue = String()); |
| 44 void show(); | 44 void show(); |
| 45 void showModal(ExceptionState&); | 45 void showModal(ExceptionState&); |
| 46 bool isModal() { return m_modal; } |
| 47 void setModal(bool modal) { m_modal = modal; } |
| 46 | 48 |
| 47 enum CenteringMode { Uninitialized, Centered, NotCentered }; | 49 enum CenteringMode { Uninitialized, Centered, NotCentered }; |
| 48 CenteringMode centeringMode() const { return m_centeringMode; } | 50 CenteringMode centeringMode() const { return m_centeringMode; } |
| 49 LayoutUnit centeredPosition() const | 51 LayoutUnit centeredPosition() const |
| 50 { | 52 { |
| 51 ASSERT(m_centeringMode == Centered); | 53 ASSERT(m_centeringMode == Centered); |
| 52 return m_centeredPosition; | 54 return m_centeredPosition; |
| 53 } | 55 } |
| 54 void setCentered(LayoutUnit centeredPosition); | 56 void setCentered(LayoutUnit centeredPosition); |
| 55 void setNotCentered(); | 57 void setNotCentered(); |
| 56 | 58 |
| 57 String returnValue() const { return m_returnValue; } | 59 String returnValue() const { return m_returnValue; } |
| 58 void setReturnValue(const String& returnValue) { m_returnValue = returnValue
; } | 60 void setReturnValue(const String& returnValue) { m_returnValue = returnValue
; } |
| 59 | 61 |
| 60 private: | 62 private: |
| 61 explicit HTMLDialogElement(Document&); | 63 explicit HTMLDialogElement(Document&); |
| 62 | 64 |
| 63 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 65 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; |
| 64 virtual void defaultEventHandler(Event*) OVERRIDE; | 66 virtual void defaultEventHandler(Event*) OVERRIDE; |
| 67 virtual void removedFrom(ContainerNode*) OVERRIDE; |
| 65 | 68 |
| 66 void forceLayoutForCentering(); | 69 void forceLayoutForCentering(); |
| 67 | 70 |
| 68 CenteringMode m_centeringMode; | 71 CenteringMode m_centeringMode; |
| 69 LayoutUnit m_centeredPosition; | 72 LayoutUnit m_centeredPosition; |
| 70 String m_returnValue; | 73 String m_returnValue; |
| 74 bool m_modal; |
| 71 }; | 75 }; |
| 72 | 76 |
| 73 inline bool isHTMLDialogElement(const Node& node) | 77 inline bool isHTMLDialogElement(const Node& node) |
| 74 { | 78 { |
| 75 ASSERT_WITH_SECURITY_IMPLICATION(RuntimeEnabledFeatures::dialogElementEnable
d()); | 79 ASSERT_WITH_SECURITY_IMPLICATION(RuntimeEnabledFeatures::dialogElementEnable
d()); |
| 76 return node.hasTagName(HTMLNames::dialogTag); | 80 return node.hasTagName(HTMLNames::dialogTag); |
| 77 } | 81 } |
| 78 | 82 |
| 79 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLDialogElement); | 83 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLDialogElement); |
| 80 | 84 |
| 81 } // namespace WebCore | 85 } // namespace WebCore |
| 82 | 86 |
| 83 #endif | 87 #endif |
| OLD | NEW |