Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: third_party/WebKit/Source/web/WebDocument.cpp

Issue 1248643004: Test distillability without JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@early
Patch Set: fix browsertest, merge webkit CL, merge http://crrev.com/1403413004 Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebDocument.cpp
diff --git a/third_party/WebKit/Source/web/WebDocument.cpp b/third_party/WebKit/Source/web/WebDocument.cpp
index e10b756e4cdbd1c624d7b2d4aa3bbeab185553f1..be3d67d2f0b322dc8240c937a18c5318883433e2 100644
--- a/third_party/WebKit/Source/web/WebDocument.cpp
+++ b/third_party/WebKit/Source/web/WebDocument.cpp
@@ -38,11 +38,13 @@
#include "core/css/StyleSheetContents.h"
#include "core/dom/CSSSelectorWatch.h"
#include "core/dom/Document.h"
+#include "core/dom/DocumentStatisticsCollector.h"
#include "core/dom/DocumentType.h"
#include "core/dom/Element.h"
#include "core/dom/Fullscreen.h"
#include "core/dom/StyleEngine.h"
#include "core/events/Event.h"
+#include "core/frame/FrameHost.h"
#include "core/html/HTMLAllCollection.h"
#include "core/html/HTMLBodyElement.h"
#include "core/html/HTMLCollection.h"
@@ -56,6 +58,7 @@
#include "modules/accessibility/AXObject.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
#include "platform/weborigin/SecurityOrigin.h"
+#include "public/platform/WebDistillability.h"
#include "public/platform/WebURL.h"
#include "public/web/WebAXObject.h"
#include "public/web/WebDOMEvent.h"
@@ -322,6 +325,19 @@ bool WebDocument::manifestUseCredentials() const
return equalIgnoringCase(linkElement->fastGetAttribute(HTMLNames::crossoriginAttr), "use-credentials");
}
+WebDistillabilityFeatures WebDocument::distillabilityFeatures()
+{
+ return DocumentStatisticsCollector::collectStatistics(*unwrap<Document>());
+}
+
+bool WebDocument::isMobileFriendly()
+{
+ FrameHost* frameHost = unwrap<Document>()->frameHost();
+ if (!frameHost)
+ return false;
+ return frameHost->visualViewport().shouldDisableDesktopWorkarounds();
+}
+
WebDocument::WebDocument(const PassRefPtrWillBeRawPtr<Document>& elem)
: WebNode(elem)
{

Powered by Google App Engine
This is Rietveld 408576698