/src/serenity/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> |
3 | | * Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org> |
4 | | * |
5 | | * SPDX-License-Identifier: BSD-2-Clause |
6 | | */ |
7 | | |
8 | | #pragma once |
9 | | |
10 | | #include <LibWeb/HTML/LazyLoadingElement.h> |
11 | | #include <LibWeb/HTML/NavigableContainer.h> |
12 | | |
13 | | namespace Web::HTML { |
14 | | |
15 | | class HTMLIFrameElement final |
16 | | : public NavigableContainer |
17 | | , public LazyLoadingElement<HTMLIFrameElement> { |
18 | | |
19 | | WEB_PLATFORM_OBJECT(HTMLIFrameElement, NavigableContainer); |
20 | | LAZY_LOADING_ELEMENT(HTMLIFrameElement); |
21 | | JS_DECLARE_ALLOCATOR(HTMLIFrameElement); |
22 | | |
23 | | public: |
24 | | virtual ~HTMLIFrameElement() override; |
25 | | |
26 | | virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override; |
27 | | |
28 | | void set_current_navigation_was_lazy_loaded(bool value); |
29 | | |
30 | 0 | Optional<HighResolutionTime::DOMHighResTimeStamp> const& pending_resource_start_time() const { return m_pending_resource_start_time; } |
31 | 0 | void set_pending_resource_start_time(Optional<HighResolutionTime::DOMHighResTimeStamp> time) { m_pending_resource_start_time = time; } |
32 | | |
33 | | virtual void visit_edges(Cell::Visitor&) override; |
34 | | |
35 | | private: |
36 | | HTMLIFrameElement(DOM::Document&, DOM::QualifiedName); |
37 | | |
38 | | virtual void initialize(JS::Realm&) override; |
39 | | |
40 | | // ^DOM::Element |
41 | | virtual void inserted() override; |
42 | | virtual void removed_from(Node*) override; |
43 | | virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value) override; |
44 | | virtual i32 default_tab_index_value() const override; |
45 | | |
46 | | // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:dimension-attributes |
47 | 0 | virtual bool supports_dimension_attributes() const override { return true; } |
48 | | |
49 | | // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes |
50 | | void process_the_iframe_attributes(bool initial_insertion = false); |
51 | | |
52 | | // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#current-navigation-was-lazy-loaded |
53 | | bool m_current_navigation_was_lazy_loaded { false }; |
54 | | |
55 | | // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#iframe-pending-resource-timing-start-time |
56 | | Optional<HighResolutionTime::DOMHighResTimeStamp> m_pending_resource_start_time = {}; |
57 | | }; |
58 | | |
59 | | void run_iframe_load_event_steps(HTML::HTMLIFrameElement&); |
60 | | |
61 | | } |