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...) 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() const { return m_modal; } | |
47 | 46 |
48 enum CenteringMode { Uninitialized, Centered, NotCentered }; | 47 enum CenteringMode { Uninitialized, Centered, NotCentered }; |
49 CenteringMode centeringMode() const { return m_centeringMode; } | 48 CenteringMode centeringMode() const { return m_centeringMode; } |
50 LayoutUnit centeredPosition() const | 49 LayoutUnit centeredPosition() const |
51 { | 50 { |
52 ASSERT(m_centeringMode == Centered); | 51 ASSERT(m_centeringMode == Centered); |
53 return m_centeredPosition; | 52 return m_centeredPosition; |
54 } | 53 } |
55 void setCentered(LayoutUnit centeredPosition); | 54 void setCentered(LayoutUnit centeredPosition); |
56 void setNotCentered(); | 55 void setNotCentered(); |
57 | 56 |
58 String returnValue() const { return m_returnValue; } | 57 String returnValue() const { return m_returnValue; } |
59 void setReturnValue(const String& returnValue) { m_returnValue = returnValue
; } | 58 void setReturnValue(const String& returnValue) { m_returnValue = returnValue
; } |
60 | 59 |
61 private: | 60 private: |
62 explicit HTMLDialogElement(Document&); | 61 explicit HTMLDialogElement(Document&); |
63 | 62 |
64 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 63 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; |
65 virtual void defaultEventHandler(Event*) OVERRIDE; | 64 virtual void defaultEventHandler(Event*) OVERRIDE; |
66 virtual void removedFrom(ContainerNode*) OVERRIDE; | |
67 | 65 |
68 void forceLayoutForCentering(); | 66 void forceLayoutForCentering(); |
69 | 67 |
70 CenteringMode m_centeringMode; | 68 CenteringMode m_centeringMode; |
71 LayoutUnit m_centeredPosition; | 69 LayoutUnit m_centeredPosition; |
72 String m_returnValue; | 70 String m_returnValue; |
73 bool m_modal; | |
74 }; | 71 }; |
75 | 72 |
76 inline bool isHTMLDialogElement(const Node& node) | 73 inline bool isHTMLDialogElement(const Node& node) |
77 { | 74 { |
78 ASSERT_WITH_SECURITY_IMPLICATION(RuntimeEnabledFeatures::dialogElementEnable
d()); | 75 ASSERT_WITH_SECURITY_IMPLICATION(RuntimeEnabledFeatures::dialogElementEnable
d()); |
79 return node.hasTagName(HTMLNames::dialogTag); | 76 return node.hasTagName(HTMLNames::dialogTag); |
80 } | 77 } |
81 | 78 |
82 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLDialogElement); | 79 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLDialogElement); |
83 | 80 |
84 } // namespace WebCore | 81 } // namespace WebCore |
85 | 82 |
86 #endif | 83 #endif |
OLD | NEW |