chromium/third_party/blink/renderer/core/html/html_anchor_element.cc

/*
 * Copyright (C) 1999 Lars Knoll ([email protected])
 *           (C) 1999 Antti Koivisto ([email protected])
 *           (C) 2000 Simon Hausmann <[email protected]>
 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
 * reserved.
 *           (C) 2006 Graham Dennis ([email protected])
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#include "third_party/blink/renderer/core/html/html_anchor_element.h"

#include <utility>

#include "base/metrics/histogram_macros.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/navigation/impression.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/web/web_link_preview_triggerer.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/events/mouse_event.h"
#include "third_party/blink/renderer/core/events/pointer_event.h"
#include "third_party/blink/renderer/core/events/web_input_event_conversion.h"
#include "third_party/blink/renderer/core/frame/ad_tracker.h"
#include "third_party/blink/renderer/core/frame/attribution_src_loader.h"
#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/anchor_element_metrics_sender.h"
#include "third_party/blink/renderer/core/html/anchor_element_observer_for_service_worker.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/loader/anchor_element_interaction_tracker.h"
#include "third_party/blink/renderer/core/loader/frame_load_request.h"
#include "third_party/blink/renderer/core/loader/navigation_policy.h"
#include "third_party/blink/renderer/core/loader/ping_loader.h"
#include "third_party/blink/renderer/core/loader/render_blocking_resource_manager.h"
#include "third_party/blink/renderer/core/navigation_api/navigation_api.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/timer.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
#include "ui/events/event_constants.h"
#include "ui/gfx/geometry/point_conversions.h"

namespace blink {

namespace {

// The download attribute specifies a filename, and an excessively long one can
// crash the browser process. Filepaths probably can't be longer than 4096
// characters, but this is enough to prevent the browser process from becoming
// unresponsive or crashing.
const int kMaxDownloadAttrLength =;

// Note: Here it covers download originated from clicking on <a download> link
// that results in direct download. Features in this method can also be logged
// from browser for download due to navigations to non-web-renderable content.
bool ShouldInterveneDownloadByFramePolicy(LocalFrame* frame) {}

void EmitDidAnchorElementReceiveMouseEvent(HTMLAnchorElement& anchor_element,
                                           Event& event) {}

}  // namespace

HTMLAnchorElement::HTMLAnchorElement(Document& document)
    :{}

HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tag_name,
                                     Document& document)
    :{}

HTMLAnchorElement::~HTMLAnchorElement() = default;

FocusableState HTMLAnchorElement::SupportsFocus(
    UpdateBehavior update_behavior) const {}

bool HTMLAnchorElement::ShouldHaveFocusAppearance() const {}

FocusableState HTMLAnchorElement::IsFocusableState(
    UpdateBehavior update_behavior) const {}

bool HTMLAnchorElement::IsKeyboardFocusable(
    UpdateBehavior update_behavior) const {}

static void AppendServerMapMousePosition(StringBuilder& url, Event* event) {}

void HTMLAnchorElement::DefaultEventHandler(Event& event) {}

bool HTMLAnchorElement::HasActivationBehavior() const {}

void HTMLAnchorElement::SetActive(bool active) {}

void HTMLAnchorElement::AttributeChanged(
    const AttributeModificationParams& params) {}

void HTMLAnchorElement::ParseAttribute(
    const AttributeModificationParams& params) {}

bool HTMLAnchorElement::IsURLAttribute(const Attribute& attribute) const {}

bool HTMLAnchorElement::HasLegalLinkAttribute(const QualifiedName& name) const {}

void HTMLAnchorElement::FinishParsingChildren() {}

bool HTMLAnchorElement::CanStartSelection() const {}

bool HTMLAnchorElement::draggable() const {}

KURL HTMLAnchorElement::Href() const {}

void HTMLAnchorElement::SetHref(const AtomicString& value) {}

KURL HTMLAnchorElement::Url() const {}

void HTMLAnchorElement::SetURL(const KURL& url) {}

String HTMLAnchorElement::Input() const {}

void HTMLAnchorElement::setHref(const String& value) {}

bool HTMLAnchorElement::HasRel(uint32_t relation) const {}

void HTMLAnchorElement::SetRel(const AtomicString& value) {}

const AtomicString& HTMLAnchorElement::GetName() const {}

const AtomicString& HTMLAnchorElement::GetEffectiveTarget() const {}

int HTMLAnchorElement::DefaultTabIndex() const {}

bool HTMLAnchorElement::IsLiveLink() const {}

void HTMLAnchorElement::SendPings(const KURL& destination_url) const {}

void HTMLAnchorElement::NavigateToHyperlink(ResourceRequest request,
                                            NavigationPolicy navigation_policy,
                                            bool is_trusted,
                                            base::TimeTicks platform_time_stamp,
                                            KURL completed_url) {}

void HTMLAnchorElement::SetHovered(bool hovered) {}

Element* HTMLAnchorElement::interestTargetElement() {}

AtomicString HTMLAnchorElement::interestAction() const {}

void HTMLAnchorElement::HandleClick(MouseEvent& event) {}

bool IsEnterKeyKeydownEvent(Event& event) {}

bool IsLinkClick(Event& event) {}

bool HTMLAnchorElement::WillRespondToMouseClickEvents() {}

bool HTMLAnchorElement::IsInteractiveContent() const {}

Node::InsertionNotificationRequest HTMLAnchorElement::InsertedInto(
    ContainerNode& insertion_point) {}

void HTMLAnchorElement::RemovedFrom(ContainerNode& insertion_point) {}

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

}  // namespace blink