OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/html/HTMLFormControlElement.h" | 5 #include "core/html/HTMLFormControlElement.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/LocalFrameView.h" | 9 #include "core/frame/LocalFrameView.h" |
10 #include "core/html/HTMLInputElement.h" | 10 #include "core/html/HTMLInputElement.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 void HideValidationMessage(const Element& anchor) override { | 35 void HideValidationMessage(const Element& anchor) override { |
36 if (anchor_ == &anchor) | 36 if (anchor_ == &anchor) |
37 anchor_ = nullptr; | 37 anchor_ = nullptr; |
38 } | 38 } |
39 | 39 |
40 bool IsValidationMessageVisible(const Element& anchor) override { | 40 bool IsValidationMessageVisible(const Element& anchor) override { |
41 return anchor_ == &anchor; | 41 return anchor_ == &anchor; |
42 } | 42 } |
43 | 43 |
| 44 void WillUnloadDocument(const Document&) override {} |
| 45 void DocumentDetached(const Document&) override {} |
44 void WillBeDestroyed() override {} | 46 void WillBeDestroyed() override {} |
45 DEFINE_INLINE_VIRTUAL_TRACE() { | 47 DEFINE_INLINE_VIRTUAL_TRACE() { |
46 visitor->Trace(anchor_); | 48 visitor->Trace(anchor_); |
47 ValidationMessageClient::Trace(visitor); | 49 ValidationMessageClient::Trace(visitor); |
48 } | 50 } |
49 | 51 |
50 private: | 52 private: |
51 Member<const Element> anchor_; | 53 Member<const Element> anchor_; |
52 }; | 54 }; |
53 } | 55 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 Page::OrdinaryPages().insert(&GetPage()); | 133 Page::OrdinaryPages().insert(&GetPage()); |
132 | 134 |
133 HTMLInputElement* input = | 135 HTMLInputElement* input = |
134 toHTMLInputElement(GetDocument().getElementById("input")); | 136 toHTMLInputElement(GetDocument().getElementById("input")); |
135 ScopedPageSuspender suspender; // print() suspends the page. | 137 ScopedPageSuspender suspender; // print() suspends the page. |
136 input->reportValidity(); | 138 input->reportValidity(); |
137 EXPECT_FALSE(validation_message_client->IsValidationMessageVisible(*input)); | 139 EXPECT_FALSE(validation_message_client->IsValidationMessageVisible(*input)); |
138 } | 140 } |
139 | 141 |
140 } // namespace blink | 142 } // namespace blink |
OLD | NEW |