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 20 matching lines...) Expand all Loading... |
31 #include "config.h" | 31 #include "config.h" |
32 #include "public/web/WebDocument.h" | 32 #include "public/web/WebDocument.h" |
33 | 33 |
34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
35 #include "bindings/core/v8/ScriptState.h" | 35 #include "bindings/core/v8/ScriptState.h" |
36 #include "bindings/core/v8/ScriptValue.h" | 36 #include "bindings/core/v8/ScriptValue.h" |
37 #include "bindings/core/v8/V8ElementRegistrationOptions.h" | 37 #include "bindings/core/v8/V8ElementRegistrationOptions.h" |
38 #include "core/css/StyleSheetContents.h" | 38 #include "core/css/StyleSheetContents.h" |
39 #include "core/dom/CSSSelectorWatch.h" | 39 #include "core/dom/CSSSelectorWatch.h" |
40 #include "core/dom/Document.h" | 40 #include "core/dom/Document.h" |
| 41 #include "core/dom/DocumentStatisticsCollector.h" |
41 #include "core/dom/DocumentType.h" | 42 #include "core/dom/DocumentType.h" |
42 #include "core/dom/Element.h" | 43 #include "core/dom/Element.h" |
43 #include "core/dom/Fullscreen.h" | 44 #include "core/dom/Fullscreen.h" |
44 #include "core/dom/StyleEngine.h" | 45 #include "core/dom/StyleEngine.h" |
45 #include "core/events/Event.h" | 46 #include "core/events/Event.h" |
| 47 #include "core/frame/FrameHost.h" |
46 #include "core/html/HTMLAllCollection.h" | 48 #include "core/html/HTMLAllCollection.h" |
47 #include "core/html/HTMLBodyElement.h" | 49 #include "core/html/HTMLBodyElement.h" |
48 #include "core/html/HTMLCollection.h" | 50 #include "core/html/HTMLCollection.h" |
49 #include "core/html/HTMLElement.h" | 51 #include "core/html/HTMLElement.h" |
50 #include "core/html/HTMLFormElement.h" | 52 #include "core/html/HTMLFormElement.h" |
51 #include "core/html/HTMLHeadElement.h" | 53 #include "core/html/HTMLHeadElement.h" |
52 #include "core/html/HTMLLinkElement.h" | 54 #include "core/html/HTMLLinkElement.h" |
53 #include "core/layout/LayoutObject.h" | 55 #include "core/layout/LayoutObject.h" |
54 #include "core/layout/LayoutView.h" | 56 #include "core/layout/LayoutView.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/weborigin/SecurityOrigin.h" | 60 #include "platform/weborigin/SecurityOrigin.h" |
| 61 #include "public/platform/WebDistillability.h" |
59 #include "public/platform/WebURL.h" | 62 #include "public/platform/WebURL.h" |
60 #include "public/web/WebAXObject.h" | 63 #include "public/web/WebAXObject.h" |
61 #include "public/web/WebDOMEvent.h" | 64 #include "public/web/WebDOMEvent.h" |
62 #include "public/web/WebDocumentType.h" | 65 #include "public/web/WebDocumentType.h" |
63 #include "public/web/WebElement.h" | 66 #include "public/web/WebElement.h" |
64 #include "public/web/WebElementCollection.h" | 67 #include "public/web/WebElementCollection.h" |
65 #include "public/web/WebFormElement.h" | 68 #include "public/web/WebFormElement.h" |
66 #include "public/web/WebNodeList.h" | 69 #include "public/web/WebNodeList.h" |
67 #include "web/WebLocalFrameImpl.h" | 70 #include "web/WebLocalFrameImpl.h" |
68 #include "wtf/PassRefPtr.h" | 71 #include "wtf/PassRefPtr.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 318 |
316 bool WebDocument::manifestUseCredentials() const | 319 bool WebDocument::manifestUseCredentials() const |
317 { | 320 { |
318 const Document* document = constUnwrap<Document>(); | 321 const Document* document = constUnwrap<Document>(); |
319 HTMLLinkElement* linkElement = document->linkManifest(); | 322 HTMLLinkElement* linkElement = document->linkManifest(); |
320 if (!linkElement) | 323 if (!linkElement) |
321 return false; | 324 return false; |
322 return equalIgnoringCase(linkElement->fastGetAttribute(HTMLNames::crossorigi
nAttr), "use-credentials"); | 325 return equalIgnoringCase(linkElement->fastGetAttribute(HTMLNames::crossorigi
nAttr), "use-credentials"); |
323 } | 326 } |
324 | 327 |
| 328 WebDistillabilityFeatures WebDocument::distillabilityFeatures() |
| 329 { |
| 330 return DocumentStatisticsCollector::collectStatistics(*unwrap<Document>()); |
| 331 } |
| 332 |
| 333 bool WebDocument::isMobileFriendly() |
| 334 { |
| 335 FrameHost* frameHost = unwrap<Document>()->frameHost(); |
| 336 if (!frameHost) |
| 337 return false; |
| 338 return frameHost->visualViewport().shouldDisableDesktopWorkarounds(); |
| 339 } |
| 340 |
325 WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem) | 341 WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem) |
326 : WebNode(elem) | 342 : WebNode(elem) |
327 { | 343 { |
328 } | 344 } |
329 | 345 |
330 DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, constUnwrap<Node>()->isDocumentNode()); | 346 DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, constUnwrap<Node>()->isDocumentNode()); |
331 | 347 |
332 WebDocument& WebDocument::operator=(const PassRefPtrWillBeRawPtr<Document>& elem
) | 348 WebDocument& WebDocument::operator=(const PassRefPtrWillBeRawPtr<Document>& elem
) |
333 { | 349 { |
334 m_private = elem; | 350 m_private = elem; |
335 return *this; | 351 return *this; |
336 } | 352 } |
337 | 353 |
338 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const | 354 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const |
339 { | 355 { |
340 return toDocument(m_private.get()); | 356 return toDocument(m_private.get()); |
341 } | 357 } |
342 | 358 |
343 } // namespace blink | 359 } // namespace blink |
OLD | NEW |