#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 {
const int kMaxDownloadAttrLength = …;
bool ShouldInterveneDownloadByFramePolicy(LocalFrame* frame) { … }
void EmitDidAnchorElementReceiveMouseEvent(HTMLAnchorElement& anchor_element,
Event& event) { … }
}
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 { … }
}