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 {} | |
46 void WillBeDestroyed() override {} | 44 void WillBeDestroyed() override {} |
47 DEFINE_INLINE_VIRTUAL_TRACE() { | 45 DEFINE_INLINE_VIRTUAL_TRACE() { |
48 visitor->Trace(anchor_); | 46 visitor->Trace(anchor_); |
49 ValidationMessageClient::Trace(visitor); | 47 ValidationMessageClient::Trace(visitor); |
50 } | 48 } |
51 | 49 |
52 private: | 50 private: |
53 Member<const Element> anchor_; | 51 Member<const Element> anchor_; |
54 }; | 52 }; |
55 } | 53 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 Page::OrdinaryPages().insert(&GetPage()); | 131 Page::OrdinaryPages().insert(&GetPage()); |
134 | 132 |
135 HTMLInputElement* input = | 133 HTMLInputElement* input = |
136 toHTMLInputElement(GetDocument().getElementById("input")); | 134 toHTMLInputElement(GetDocument().getElementById("input")); |
137 ScopedPageSuspender suspender; // print() suspends the page. | 135 ScopedPageSuspender suspender; // print() suspends the page. |
138 input->reportValidity(); | 136 input->reportValidity(); |
139 EXPECT_FALSE(validation_message_client->IsValidationMessageVisible(*input)); | 137 EXPECT_FALSE(validation_message_client->IsValidationMessageVisible(*input)); |
140 } | 138 } |
141 | 139 |
142 } // namespace blink | 140 } // namespace blink |
OLD | NEW |