HTMLIFrameElement.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/HTML/NavigableContainer.h>
  8. namespace Web::HTML {
  9. class HTMLIFrameElement final : public NavigableContainer {
  10. WEB_PLATFORM_OBJECT(HTMLIFrameElement, NavigableContainer);
  11. public:
  12. virtual ~HTMLIFrameElement() override;
  13. virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
  14. // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#will-lazy-load-element-steps
  15. bool will_lazy_load_element() const;
  16. void set_current_navigation_was_lazy_loaded(bool value) { m_current_navigation_was_lazy_loaded = value; }
  17. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  18. private:
  19. HTMLIFrameElement(DOM::Document&, DOM::QualifiedName);
  20. virtual void initialize(JS::Realm&) override;
  21. // ^DOM::Element
  22. virtual void inserted() override;
  23. virtual void removed_from(Node*) override;
  24. virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
  25. virtual i32 default_tab_index_value() const override;
  26. // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes
  27. void process_the_iframe_attributes(bool initial_insertion = false);
  28. // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#current-navigation-was-lazy-loaded
  29. bool m_current_navigation_was_lazy_loaded { false };
  30. };
  31. void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
  32. }