chromium/third_party/blink/renderer/core/editing/element_inner_text.cc

// Copyright 2018 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/element.h"

#include <algorithm>

#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/node_traversal.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/dom/text_visitor.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/html/forms/html_opt_group_element.h"
#include "third_party/blink/renderer/core/html/forms/html_option_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/html/html_br_element.h"
#include "third_party/blink/renderer/core/html/html_paragraph_element.h"
#include "third_party/blink/renderer/core/layout/inline/inline_node.h"
#include "third_party/blink/renderer/core/layout/inline/inline_node_data.h"
#include "third_party/blink/renderer/core/layout/inline/offset_mapping.h"
#include "third_party/blink/renderer/core/layout/layout_text_fragment.h"
#include "third_party/blink/renderer/core/layout/table/layout_table_cell.h"
#include "third_party/blink/renderer/core/layout/table/layout_table_row.h"
#include "third_party/blink/renderer/core/layout/table/layout_table_section.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"

namespace blink {

namespace {

// The implementation of Element#innerText algorithm[1].
// [1]
// https://html.spec.whatwg.org/C/#the-innertext-idl-attribute
class ElementInnerTextCollector final {};

String ElementInnerTextCollector::RunOn(const Element& element) {}

// static
bool ElementInnerTextCollector::HasDisplayContentsStyle(const Node& node) {}

// An element is *being rendered* if it has any associated CSS layout boxes,
// SVG layout boxes, or some equivalent in other styling languages.
// Note: Just being off-screen does not mean the element is not being rendered.
// The presence of the "hidden" attribute normally means the element is not
// being rendered, though this might be overridden by the style sheets.
// From https://html.spec.whatwg.org/C/#being-rendered
// static
bool ElementInnerTextCollector::IsBeingRendered(const Node& node) {}

// static
bool ElementInnerTextCollector::IsDisplayBlockLevel(const Node& node) {}

// static
bool ElementInnerTextCollector::ShouldEmitNewlineForTableRow(
    const LayoutTableRow& table_row) {}

const OffsetMapping* ElementInnerTextCollector::GetOffsetMapping(
    const LayoutText& layout_text) {}

void ElementInnerTextCollector::ProcessChildren(const Node& container) {}

void ElementInnerTextCollector::ProcessChildrenWithRequiredLineBreaks(
    const Node& node,
    int required_line_break_count) {}

void ElementInnerTextCollector::ProcessLayoutText(const LayoutText& layout_text,
                                                  const Text& text_node) {}

// The "inner text collection steps".
void ElementInnerTextCollector::ProcessNode(const Node& node) {}

void ElementInnerTextCollector::ProcessOptionElement(
    const HTMLOptionElement& option_element) {}

void ElementInnerTextCollector::ProcessSelectElement(
    const HTMLSelectElement& select_element) {}

void ElementInnerTextCollector::ProcessTextNode(const Text& node) {}

// ----

void ElementInnerTextCollector::Result::EmitNewline() {}

void ElementInnerTextCollector::Result::EmitRequiredLineBreak(int count) {}

void ElementInnerTextCollector::Result::EmitTab() {}

void ElementInnerTextCollector::Result::EmitText(const StringView& text) {}

String ElementInnerTextCollector::Result::Finish() {}

void ElementInnerTextCollector::Result::FlushRequiredLineBreak() {}

}  // anonymous namespace

String Element::innerText(TextVisitor* visitor) {}

// Used for callers that must ensure no document lifecycle rewind.
String Element::GetInnerTextWithoutUpdate(TextVisitor* visitor) {}

}  // namespace blink