OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "bindings/core/v8/ExceptionState.h" | 33 #include "bindings/core/v8/ExceptionState.h" |
34 #include "bindings/core/v8/ScriptValue.h" | 34 #include "bindings/core/v8/ScriptValue.h" |
35 #include "bindings/core/v8/V8ElementRegistrationOptions.h" | 35 #include "bindings/core/v8/V8ElementRegistrationOptions.h" |
36 #include "core/css/StyleSheetContents.h" | 36 #include "core/css/StyleSheetContents.h" |
37 #include "core/dom/CSSSelectorWatch.h" | 37 #include "core/dom/CSSSelectorWatch.h" |
38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
39 #include "core/dom/DocumentStatisticsCollector.h" | 39 #include "core/dom/DocumentStatisticsCollector.h" |
40 #include "core/dom/DocumentType.h" | 40 #include "core/dom/DocumentType.h" |
41 #include "core/dom/Element.h" | 41 #include "core/dom/Element.h" |
| 42 #include "core/dom/FormElementObserver.h" |
42 #include "core/dom/StyleEngine.h" | 43 #include "core/dom/StyleEngine.h" |
43 #include "core/events/Event.h" | 44 #include "core/events/Event.h" |
44 #include "core/frame/WebLocalFrameBase.h" | 45 #include "core/frame/WebLocalFrameBase.h" |
45 #include "core/html/HTMLAllCollection.h" | 46 #include "core/html/HTMLAllCollection.h" |
46 #include "core/html/HTMLBodyElement.h" | 47 #include "core/html/HTMLBodyElement.h" |
47 #include "core/html/HTMLCollection.h" | 48 #include "core/html/HTMLCollection.h" |
48 #include "core/html/HTMLElement.h" | 49 #include "core/html/HTMLElement.h" |
49 #include "core/html/HTMLFormElement.h" | 50 #include "core/html/HTMLFormElement.h" |
50 #include "core/html/HTMLHeadElement.h" | 51 #include "core/html/HTMLHeadElement.h" |
| 52 #include "core/html/HTMLInputElement.h" |
51 #include "core/html/HTMLLinkElement.h" | 53 #include "core/html/HTMLLinkElement.h" |
52 #include "core/layout/LayoutObject.h" | 54 #include "core/layout/LayoutObject.h" |
53 #include "core/layout/api/LayoutAPIShim.h" | 55 #include "core/layout/api/LayoutAPIShim.h" |
54 #include "core/layout/api/LayoutViewItem.h" | 56 #include "core/layout/api/LayoutViewItem.h" |
55 #include "core/loader/DocumentLoader.h" | 57 #include "core/loader/DocumentLoader.h" |
56 #include "modules/accessibility/AXObject.h" | 58 #include "modules/accessibility/AXObject.h" |
57 #include "modules/accessibility/AXObjectCacheImpl.h" | 59 #include "modules/accessibility/AXObjectCacheImpl.h" |
58 #include "platform/bindings/ScriptState.h" | 60 #include "platform/bindings/ScriptState.h" |
59 #include "platform/weborigin/SecurityOrigin.h" | 61 #include "platform/weborigin/SecurityOrigin.h" |
60 #include "platform/wtf/PassRefPtr.h" | 62 #include "platform/wtf/PassRefPtr.h" |
61 #include "public/platform/WebDistillability.h" | 63 #include "public/platform/WebDistillability.h" |
62 #include "public/platform/WebURL.h" | 64 #include "public/platform/WebURL.h" |
63 #include "public/web/WebAXObject.h" | 65 #include "public/web/WebAXObject.h" |
64 #include "public/web/WebDOMEvent.h" | 66 #include "public/web/WebDOMEvent.h" |
65 #include "public/web/WebElement.h" | 67 #include "public/web/WebElement.h" |
66 #include "public/web/WebElementCollection.h" | 68 #include "public/web/WebElementCollection.h" |
67 #include "public/web/WebFormElement.h" | 69 #include "public/web/WebFormElement.h" |
| 70 #include "public/web/WebFormElementObserverCallback.h" |
| 71 #include "public/web/WebInputElement.h" |
68 #include "v8/include/v8.h" | 72 #include "v8/include/v8.h" |
69 | 73 |
70 namespace blink { | 74 namespace blink { |
71 | 75 |
72 WebURL WebDocument::Url() const { | 76 WebURL WebDocument::Url() const { |
73 return ConstUnwrap<Document>()->Url(); | 77 return ConstUnwrap<Document>()->Url(); |
74 } | 78 } |
75 | 79 |
76 WebSecurityOrigin WebDocument::GetSecurityOrigin() const { | 80 WebSecurityOrigin WebDocument::GetSecurityOrigin() const { |
77 if (!ConstUnwrap<Document>()) | 81 if (!ConstUnwrap<Document>()) |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 return false; | 286 return false; |
283 return EqualIgnoringASCIICase( | 287 return EqualIgnoringASCIICase( |
284 link_element->FastGetAttribute(HTMLNames::crossoriginAttr), | 288 link_element->FastGetAttribute(HTMLNames::crossoriginAttr), |
285 "use-credentials"); | 289 "use-credentials"); |
286 } | 290 } |
287 | 291 |
288 WebDistillabilityFeatures WebDocument::DistillabilityFeatures() { | 292 WebDistillabilityFeatures WebDocument::DistillabilityFeatures() { |
289 return DocumentStatisticsCollector::CollectStatistics(*Unwrap<Document>()); | 293 return DocumentStatisticsCollector::CollectStatistics(*Unwrap<Document>()); |
290 } | 294 } |
291 | 295 |
| 296 void WebDocument::ObserveFormElement( |
| 297 WebFormElement& element, |
| 298 std::unique_ptr<WebFormElementObserverCallback> callback) { |
| 299 Unwrap<Document>()->GetFormElementObserver()->Observe( |
| 300 *element.Unwrap<HTMLFormElement>(), std::move(callback)); |
| 301 } |
| 302 |
| 303 void WebDocument::ObserveFormElement( |
| 304 WebInputElement& element, |
| 305 std::unique_ptr<WebFormElementObserverCallback> callback) { |
| 306 Unwrap<Document>()->GetFormElementObserver()->Observe( |
| 307 *element.Unwrap<HTMLInputElement>(), std::move(callback)); |
| 308 } |
| 309 |
292 WebDocument::WebDocument(Document* elem) : WebNode(elem) {} | 310 WebDocument::WebDocument(Document* elem) : WebNode(elem) {} |
293 | 311 |
294 DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, ConstUnwrap<Node>()->IsDocumentNode()); | 312 DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, ConstUnwrap<Node>()->IsDocumentNode()); |
295 | 313 |
296 WebDocument& WebDocument::operator=(Document* elem) { | 314 WebDocument& WebDocument::operator=(Document* elem) { |
297 private_ = elem; | 315 private_ = elem; |
298 return *this; | 316 return *this; |
299 } | 317 } |
300 | 318 |
301 WebDocument::operator Document*() const { | 319 WebDocument::operator Document*() const { |
302 return ToDocument(private_.Get()); | 320 return ToDocument(private_.Get()); |
303 } | 321 } |
304 | 322 |
305 } // namespace blink | 323 } // namespace blink |
OLD | NEW |