2020-06-05 18:36:02 -03:00
|
|
|
/*
|
2021-04-03 06:43:08 -03:00
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
2020-06-05 18:36:02 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-05 18:36:02 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-05-31 09:59:28 -03:00
|
|
|
#include <LibWeb/HTML/BrowsingContextContainer.h>
|
2020-06-05 18:36:02 -03:00
|
|
|
|
2020-07-28 13:20:36 -03:00
|
|
|
namespace Web::HTML {
|
2020-06-05 18:36:02 -03:00
|
|
|
|
2021-05-31 09:59:28 -03:00
|
|
|
class HTMLIFrameElement final : public BrowsingContextContainer {
|
2022-08-28 08:42:07 -03:00
|
|
|
WEB_PLATFORM_OBJECT(HTMLIFrameElement, BrowsingContextContainer);
|
2020-07-27 01:04:26 -03:00
|
|
|
|
2022-08-28 08:42:07 -03:00
|
|
|
public:
|
2020-06-05 18:36:02 -03:00
|
|
|
virtual ~HTMLIFrameElement() override;
|
|
|
|
|
|
2022-02-05 09:17:01 -03:00
|
|
|
virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
2020-06-05 18:36:02 -03:00
|
|
|
|
2022-09-19 08:34:36 -03: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; }
|
|
|
|
|
|
2020-06-05 18:36:02 -03:00
|
|
|
private:
|
2022-08-28 08:42:07 -03:00
|
|
|
HTMLIFrameElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
|
2021-04-06 13:58:20 -03:00
|
|
|
virtual void inserted() override;
|
2022-03-23 21:13:34 -03:00
|
|
|
virtual void removed_from(Node*) override;
|
2022-04-01 14:58:27 -03:00
|
|
|
virtual void parse_attribute(FlyString const& name, String const& value) override;
|
2020-06-06 10:08:36 -03:00
|
|
|
|
2022-09-19 08:34:36 -03:00
|
|
|
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes
|
|
|
|
|
void process_the_iframe_attributes(bool initial_insertion = false);
|
|
|
|
|
|
2022-04-01 14:58:27 -03:00
|
|
|
void load_src(String const&);
|
2022-09-19 08:34:36 -03:00
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#current-navigation-was-lazy-loaded
|
|
|
|
|
bool m_current_navigation_was_lazy_loaded { false };
|
2020-06-05 18:36:02 -03:00
|
|
|
};
|
|
|
|
|
|
2021-09-25 21:25:02 -03:00
|
|
|
void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
|
|
|
|
|
|
2020-06-05 18:36:02 -03:00
|
|
|
}
|