chromium/third_party/blink/renderer/core/html/fenced_frame/html_fenced_frame_element.cc

// Copyright 2021 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/html/fenced_frame/html_fenced_frame_element.h"

#include "base/metrics/histogram_macros.h"
#include "base/types/pass_key.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/fenced_frame/fenced_frame_utils.h"
#include "third_party/blink/public/common/frame/fenced_frame_sandbox_flags.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom-blink.h"
#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-blink.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/event_type_names.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
#include "third_party/blink/renderer/core/frame/csp/csp_directive_list.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/remote_frame.h"
#include "third_party/blink/renderer/core/frame/screen.h"
#include "third_party/blink/renderer/core/geometry/dom_rect_read_only.h"
#include "third_party/blink/renderer/core/html/fenced_frame/document_fenced_frames.h"
#include "third_party/blink/renderer/core/html/fenced_frame/fenced_frame_ad_sizes.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/html/html_style_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/layout/layout_iframe.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/resize_observer/resize_observer_entry.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"

namespace blink {

namespace {

PhysicalRect ToPhysicalRect(const DOMRectReadOnly& rect) {}

String DeprecatedFencedFrameModeToString(
    blink::FencedFrame::DeprecatedFencedFrameMode mode) {}

// Helper function that returns whether the mode of the parent tree is different
// than the mode given to the function. Note that this function will return
// false if there is no mode set in the parent tree (i.e. not in a fenced frame
// tree).
bool ParentModeIsDifferent(
    blink::FencedFrame::DeprecatedFencedFrameMode current_mode,
    LocalFrame& frame) {}

bool HasDifferentModeThanParent(HTMLFencedFrameElement& outer_element) {}

// Returns whether `requested_size` is exactly the same size as `allowed_size`.
// `requested_size` and `allowed_size` should both be in CSS pixel units.
bool SizeMatchesExactly(const PhysicalSize& requested_size,
                        const gfx::Size& allowed_size) {}

// Returns a loss score (higher is worse) comparing the fit between
// `requested_size` and `allowed_size`.
// Both sizes should be in CSS pixel units.
double ComputeSizeLossFunction(const PhysicalSize& requested_size,
                               const gfx::Size& allowed_size) {}

std::optional<WTF::AtomicString> ConvertEventTypeToFencedEventType(
    const WTF::String& event_type) {}

}  // namespace

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

HTMLFencedFrameElement::~HTMLFencedFrameElement() = default;

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

DOMTokenList* HTMLFencedFrameElement::sandbox() const {}

void HTMLFencedFrameElement::DisconnectContentFrame() {}

ParsedPermissionsPolicy HTMLFencedFrameElement::ConstructContainerPolicy()
    const {}

void HTMLFencedFrameElement::SetCollapsed(bool collapse) {}

void HTMLFencedFrameElement::DidChangeContainerPolicy() {}

HTMLIFrameElement* HTMLFencedFrameElement::InnerIFrameElement() const {}

void HTMLFencedFrameElement::setConfig(FencedFrameConfig* config) {}

// static
bool HTMLFencedFrameElement::canLoadOpaqueURL(ScriptState* script_state) {}

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

void HTMLFencedFrameElement::DidNotifySubtreeInsertionsToDocument() {}

void HTMLFencedFrameElement::RemovedFrom(ContainerNode& node) {}

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

bool HTMLFencedFrameElement::IsPresentationAttribute(
    const QualifiedName& name) const {}

void HTMLFencedFrameElement::CollectStyleForPresentationAttribute(
    const QualifiedName& name,
    const AtomicString& value,
    MutableCSSPropertyValueSet* style) {}

void HTMLFencedFrameElement::Navigate(
    const KURL& url,
    std::optional<bool> deprecated_should_freeze_initial_size,
    std::optional<gfx::Size> container_size,
    std::optional<gfx::Size> content_size,
    String embedder_shared_storage_context) {}

void HTMLFencedFrameElement::NavigateToConfig() {}

void HTMLFencedFrameElement::CreateDelegateAndNavigate() {}

void HTMLFencedFrameElement::AttachLayoutTree(AttachContext& context) {}

bool HTMLFencedFrameElement::LayoutObjectIsNeeded(
    const DisplayStyle& style) const {}

LayoutObject* HTMLFencedFrameElement::CreateLayoutObject(const ComputedStyle&) {}

FocusableState HTMLFencedFrameElement::SupportsFocus(UpdateBehavior) const {}

PhysicalSize HTMLFencedFrameElement::CoerceFrameSize(
    const PhysicalSize& requested_size) {}

const std::optional<PhysicalSize> HTMLFencedFrameElement::FrozenFrameSize()
    const {}

void HTMLFencedFrameElement::UnfreezeFrameSize() {}

void HTMLFencedFrameElement::FreezeCurrentFrameSize() {}

void HTMLFencedFrameElement::SetContainerSize(const gfx::Size& size) {}

void HTMLFencedFrameElement::FreezeFrameSize(const PhysicalSize& size,
                                             bool should_coerce_size) {}

void HTMLFencedFrameElement::StartResizeObserver() {}

void HTMLFencedFrameElement::ResizeObserverDelegate::OnResize(
    const HeapVector<Member<ResizeObserverEntry>>& entries) {}

void HTMLFencedFrameElement::OnResize(const PhysicalRect& content_rect) {}

void HTMLFencedFrameElement::DispatchFencedEvent(
    const WTF::String& event_type) {}

// START HTMLFencedFrameElement::FencedFrameDelegate

// static
HTMLFencedFrameElement::FencedFrameDelegate*
HTMLFencedFrameElement::FencedFrameDelegate::Create(
    HTMLFencedFrameElement* outer_element) {}

HTMLFencedFrameElement::FencedFrameDelegate::FencedFrameDelegate(
    HTMLFencedFrameElement* outer_element)
    :{}

void HTMLFencedFrameElement::FencedFrameDelegate::Navigate(
    const KURL& url,
    const String& embedder_shared_storage_context) {}

void HTMLFencedFrameElement::FencedFrameDelegate::Dispose() {}

void HTMLFencedFrameElement::FencedFrameDelegate::AttachLayoutTree() {}

bool HTMLFencedFrameElement::FencedFrameDelegate::SupportsFocus() {}

void HTMLFencedFrameElement::FencedFrameDelegate::MarkFrozenFrameSizeStale() {}

void HTMLFencedFrameElement::FencedFrameDelegate::MarkContainerSizeStale() {}

void HTMLFencedFrameElement::FencedFrameDelegate::DidChangeFramePolicy(
    const FramePolicy& frame_policy) {}

void HTMLFencedFrameElement::FencedFrameDelegate::Trace(
    Visitor* visitor) const {}

// END HTMLFencedFrameElement::FencedFrameDelegate

}  // namespace blink