chromium/third_party/blink/renderer/core/dom/document_statistics_collector.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/dom/document_statistics_collector.h"

#include "base/trace_event/trace_event.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_distillability.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/html_head_element.h"
#include "third_party/blink/renderer/core/html/html_meta_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/input_type_names.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"

namespace blink {

FormControlType;

namespace {

// Saturate the length of a paragraph to save time.
const int kTextContentLengthSaturation =;

// Filter out short P elements. The threshold is set to around 2 English
// sentences.
const unsigned kParagraphLengthThreshold =;

// Saturate the scores to save time. The max is the score of 6 long paragraphs.
// 6 * sqrt(kTextContentLengthSaturation - kParagraphLengthThreshold)
const double kMozScoreSaturation =;
// 6 * sqrt(kTextContentLengthSaturation);
const double kMozScoreAllSqrtSaturation =;
const double kMozScoreAllLinearSaturation =;

unsigned TextContentLengthSaturated(const Element& root) {}

bool IsVisible(const Element& element) {}

bool MatchAttributes(const Element& element, const Vector<String>& words) {}

bool IsGoodForScoring(const WebDistillabilityFeatures& features,
                      const Element& element) {}

// underListItem denotes that at least one of the ancesters is <li> element.
void CollectFeatures(Element& root,
                     WebDistillabilityFeatures& features,
                     bool under_list_item = false) {}

bool HasOpenGraphArticle(const Element& head) {}

bool IsMobileFriendly(Document& document) {}

}  // namespace

WebDistillabilityFeatures DocumentStatisticsCollector::CollectStatistics(
    Document& document) {}

}  // namespace blink