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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // FIXME: Use transition to show the bubble. | 175 // FIXME: Use transition to show the bubble. |
176 } | 176 } |
177 | 177 |
178 void ValidationMessage::requestToHideMessage() | 178 void ValidationMessage::requestToHideMessage() |
179 { | 179 { |
180 // We must not modify the DOM tree in this context by the same reason as set
Message(). | 180 // We must not modify the DOM tree in this context by the same reason as set
Message(). |
181 m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::de
leteBubbleTree)); | 181 m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::de
leteBubbleTree)); |
182 m_timer->startOneShot(0); | 182 m_timer->startOneShot(0); |
183 } | 183 } |
184 | 184 |
| 185 bool ValidationMessage::shadowTreeContains(Node* node) const |
| 186 { |
| 187 if (!m_bubble) |
| 188 return false; |
| 189 return m_bubble->treeScope() == node->treeScope(); |
| 190 } |
| 191 |
185 void ValidationMessage::deleteBubbleTree(Timer<ValidationMessage>*) | 192 void ValidationMessage::deleteBubbleTree(Timer<ValidationMessage>*) |
186 { | 193 { |
187 if (m_bubble) { | 194 if (m_bubble) { |
188 m_messageHeading = 0; | 195 m_messageHeading = 0; |
189 m_messageBody = 0; | 196 m_messageBody = 0; |
190 HTMLElement* host = toHTMLElement(m_element); | 197 HTMLElement* host = toHTMLElement(m_element); |
191 ExceptionCode ec; | 198 ExceptionCode ec; |
192 host->shadow()->oldestShadowRoot()->removeChild(m_bubble.get(), ec); | 199 host->shadow()->oldestShadowRoot()->removeChild(m_bubble.get(), ec); |
193 m_bubble = 0; | 200 m_bubble = 0; |
194 } | 201 } |
195 m_message = String(); | 202 m_message = String(); |
196 } | 203 } |
197 | 204 |
198 } // namespace WebCore | 205 } // namespace WebCore |
OLD | NEW |