chromium/third_party/blink/renderer/core/html/parser/html_element_stack.cc

/*
 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
 * Copyright (C) 2011 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GOOGLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/core/html/parser/html_element_stack.h"

#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_control_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_head_element.h"
#include "third_party/blink/renderer/core/html/html_html_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/mathml_names.h"
#include "third_party/blink/renderer/core/svg_names.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"

namespace blink {

HTMLTag;

namespace {

// The following macro is used in switch statements for common types. It is
// defined so that it looks like a normal case statement, e.g.:
//   case FOO_CASES:

// Disable formatting as it mangles the formatting.
// clang-format off

#define SCOPE_MARKER_CASES

// clang-format on

inline bool IsRootNode(HTMLStackItem* item) {}

inline bool IsScopeMarkerNonHTML(HTMLStackItem* item) {}

inline bool IsScopeMarker(HTMLStackItem* item) {}

inline bool IsListItemScopeMarker(HTMLStackItem* item) {}

inline bool IsTableScopeMarker(HTMLStackItem* item) {}

inline bool IsTableBodyScopeMarker(HTMLStackItem* item) {}

inline bool IsTableRowScopeMarker(HTMLStackItem* item) {}

inline bool IsForeignContentScopeMarker(HTMLStackItem* item) {}

inline bool IsButtonScopeMarker(HTMLStackItem* item) {}

inline bool IsSelectScopeMarker(HTMLStackItem* item) {}

}  // namespace

HTMLElementStack::HTMLElementStack()
    :{}

bool HTMLElementStack::HasOnlyOneElement() const {}

bool HTMLElementStack::SecondElementIsHTMLBodyElement() const {}

void HTMLElementStack::PopHTMLHeadElement() {}

void HTMLElementStack::PopHTMLBodyElement() {}

void HTMLElementStack::PopAll() {}

void HTMLElementStack::Pop() {}

void HTMLElementStack::PopUntil(html_names::HTMLTag tag) {}

void HTMLElementStack::PopUntilPopped(html_names::HTMLTag tag) {}

void HTMLElementStack::PopUntilNumberedHeaderElementPopped() {}

void HTMLElementStack::PopUntil(Element* element) {}

void HTMLElementStack::PopUntilPopped(Element* element) {}

void HTMLElementStack::PopUntilTableScopeMarker() {}

void HTMLElementStack::PopUntilTableBodyScopeMarker() {}

void HTMLElementStack::PopUntilTableRowScopeMarker() {}

// http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#mathml-text-integration-point
bool HTMLElementStack::IsMathMLTextIntegrationPoint(HTMLStackItem* item) {}

// http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#html-integration-point
bool HTMLElementStack::IsHTMLIntegrationPoint(HTMLStackItem* item) {}

void HTMLElementStack::PopUntilForeignContentScopeMarker() {}

void HTMLElementStack::PushRootNode(HTMLStackItem* root_item) {}

void HTMLElementStack::PushHTMLHtmlElement(HTMLStackItem* item) {}

void HTMLElementStack::PushRootNodeCommon(HTMLStackItem* root_item) {}

void HTMLElementStack::PushHTMLHeadElement(HTMLStackItem* item) {}

void HTMLElementStack::PushHTMLBodyElement(HTMLStackItem* item) {}

void HTMLElementStack::Push(HTMLStackItem* item) {}

void HTMLElementStack::InsertAbove(HTMLStackItem* item,
                                   HTMLStackItem* item_below) {}

HTMLStackItem* HTMLElementStack::OneBelowTop() const {}

void HTMLElementStack::RemoveHTMLHeadElement(Element* element) {}

void HTMLElementStack::Remove(Element* element) {}

HTMLStackItem* HTMLElementStack::Find(Element* element) const {}

HTMLStackItem* HTMLElementStack::Topmost(html_names::HTMLTag tag) const {}

bool HTMLElementStack::Contains(Element* element) const {}

template <bool isMarker(HTMLStackItem*)>
bool InScopeCommon(HTMLStackItem* top, html_names::HTMLTag tag) {}

bool HTMLElementStack::HasNumberedHeaderElementInScope() const {}

bool HTMLElementStack::InScope(Element* target_element) const {}

bool HTMLElementStack::InScope(html_names::HTMLTag tag) const {}

bool HTMLElementStack::InListItemScope(html_names::HTMLTag tag) const {}

bool HTMLElementStack::InTableScope(html_names::HTMLTag tag) const {}

bool HTMLElementStack::InButtonScope(html_names::HTMLTag tag) const {}

bool HTMLElementStack::InSelectScope(html_names::HTMLTag tag) const {}

bool HTMLElementStack::HasTemplateInHTMLScope() const {}

Element* HTMLElementStack::HtmlElement() const {}

Element* HTMLElementStack::HeadElement() const {}

Element* HTMLElementStack::BodyElement() const {}

ContainerNode* HTMLElementStack::RootNode() const {}

void HTMLElementStack::PushCommon(HTMLStackItem* item) {}

void HTMLElementStack::PopCommon() {}

void HTMLElementStack::RemoveNonTopCommon(Element* element) {}

HTMLStackItem* HTMLElementStack::FurthestBlockForFormattingElement(
    Element* formatting_element) const {}

void HTMLElementStack::Replace(HTMLStackItem* old_item,
                               HTMLStackItem* new_item) {}

void HTMLElementStack::Trace(Visitor* visitor) const {}

#ifndef NDEBUG

void HTMLElementStack::Show() {}

#endif

}  // namespace blink