2020-06-05 23:36:02 +02:00
|
|
|
/*
|
2021-04-03 11:43:08 +02:00
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
2020-06-05 23:36:02 +02:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-05 23:36:02 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-12 12:20:02 +01:00
|
|
|
#include <LibWeb/HTML/NavigableContainer.h>
|
2020-06-05 23:36:02 +02:00
|
|
|
|
2020-07-28 18:20:36 +02:00
|
|
|
namespace Web::HTML {
|
2020-06-05 23:36:02 +02:00
|
|
|
|
2022-12-12 12:20:02 +01:00
|
|
|
class HTMLIFrameElement final : public NavigableContainer {
|
|
|
|
WEB_PLATFORM_OBJECT(HTMLIFrameElement, NavigableContainer);
|
2023-11-19 19:47:52 +01:00
|
|
|
JS_DECLARE_ALLOCATOR(HTMLIFrameElement);
|
2020-07-27 05:04:26 +01:00
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
public:
|
2020-06-05 23:36:02 +02:00
|
|
|
virtual ~HTMLIFrameElement() override;
|
|
|
|
|
2022-10-17 14:41:50 +02:00
|
|
|
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
2020-06-05 23:36:02 +02:00
|
|
|
|
2022-09-19 13:34:36 +02:00
|
|
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#will-lazy-load-element-steps
|
|
|
|
bool will_lazy_load_element() const;
|
|
|
|
|
|
|
|
void set_current_navigation_was_lazy_loaded(bool value) { m_current_navigation_was_lazy_loaded = value; }
|
|
|
|
|
2023-09-21 13:47:19 -06:00
|
|
|
Optional<HighResolutionTime::DOMHighResTimeStamp> const& pending_resource_start_time() const { return m_pending_resource_start_time; }
|
|
|
|
void set_pending_resource_start_time(Optional<HighResolutionTime::DOMHighResTimeStamp> time) { m_pending_resource_start_time = time; }
|
|
|
|
|
2022-10-10 17:22:30 +01:00
|
|
|
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
|
|
|
|
2020-06-05 23:36:02 +02:00
|
|
|
private:
|
2022-08-28 13:42:07 +02:00
|
|
|
HTMLIFrameElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2022-11-05 03:58:14 +00:00
|
|
|
// ^DOM::Element
|
2021-04-06 17:58:20 +01:00
|
|
|
virtual void inserted() override;
|
2022-03-23 20:13:34 -04:00
|
|
|
virtual void removed_from(Node*) override;
|
2023-11-19 18:10:36 +13:00
|
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override;
|
2022-11-05 03:58:14 +00:00
|
|
|
virtual i32 default_tab_index_value() const override;
|
2020-06-06 15:08:36 +02:00
|
|
|
|
2022-09-19 13:34:36 +02:00
|
|
|
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes
|
|
|
|
void process_the_iframe_attributes(bool initial_insertion = false);
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#current-navigation-was-lazy-loaded
|
|
|
|
bool m_current_navigation_was_lazy_loaded { false };
|
2023-09-21 13:47:19 -06:00
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#iframe-pending-resource-timing-start-time
|
|
|
|
Optional<HighResolutionTime::DOMHighResTimeStamp> m_pending_resource_start_time = {};
|
2020-06-05 23:36:02 +02:00
|
|
|
};
|
|
|
|
|
2021-09-26 02:25:02 +02:00
|
|
|
void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
|
|
|
|
|
2020-06-05 23:36:02 +02:00
|
|
|
}
|