OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "Timer.h" | 34 #include "Timer.h" |
35 #include <wtf/Noncopyable.h> | 35 #include <wtf/Noncopyable.h> |
36 #include <wtf/OwnPtr.h> | 36 #include <wtf/OwnPtr.h> |
37 #include <wtf/RefPtr.h> | 37 #include <wtf/RefPtr.h> |
38 #include <wtf/text/WTFString.h> | 38 #include <wtf/text/WTFString.h> |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class FormAssociatedElement; | 42 class FormAssociatedElement; |
43 class HTMLElement; | 43 class HTMLElement; |
| 44 class Node; |
44 | 45 |
45 class ValidationMessage { | 46 class ValidationMessage { |
46 WTF_MAKE_NONCOPYABLE(ValidationMessage); | 47 WTF_MAKE_NONCOPYABLE(ValidationMessage); |
47 public: | 48 public: |
48 static PassOwnPtr<ValidationMessage> create(FormAssociatedElement*); | 49 static PassOwnPtr<ValidationMessage> create(FormAssociatedElement*); |
49 ~ValidationMessage(); | 50 ~ValidationMessage(); |
50 String message() const { return m_message; } | 51 String message() const { return m_message; } |
51 void setMessage(const String&); | 52 void setMessage(const String&); |
52 void requestToHideMessage(); | 53 void requestToHideMessage(); |
| 54 bool shadowTreeContains(Node*) const; |
53 | 55 |
54 private: | 56 private: |
55 ValidationMessage(FormAssociatedElement*); | 57 ValidationMessage(FormAssociatedElement*); |
56 void setMessageDOMAndStartTimer(Timer<ValidationMessage>* = 0); | 58 void setMessageDOMAndStartTimer(Timer<ValidationMessage>* = 0); |
57 void buildBubbleTree(Timer<ValidationMessage>*); | 59 void buildBubbleTree(Timer<ValidationMessage>*); |
58 void deleteBubbleTree(Timer<ValidationMessage>* = 0); | 60 void deleteBubbleTree(Timer<ValidationMessage>* = 0); |
59 | 61 |
60 FormAssociatedElement* m_element; | 62 FormAssociatedElement* m_element; |
61 String m_message; | 63 String m_message; |
62 OwnPtr<Timer<ValidationMessage> > m_timer; | 64 OwnPtr<Timer<ValidationMessage> > m_timer; |
63 RefPtr<HTMLElement> m_bubble; | 65 RefPtr<HTMLElement> m_bubble; |
64 RefPtr<HTMLElement> m_messageHeading; | 66 RefPtr<HTMLElement> m_messageHeading; |
65 RefPtr<HTMLElement> m_messageBody; | 67 RefPtr<HTMLElement> m_messageBody; |
66 }; | 68 }; |
67 | 69 |
68 } // namespace WebCore | 70 } // namespace WebCore |
69 | 71 |
70 #endif // ValidationMessage_h | 72 #endif // ValidationMessage_h |
OLD | NEW |