HTMLIFrameElement.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/BrowsingContextContainer.h>
  8. namespace Web::HTML {
  9. class HTMLIFrameElement final : public BrowsingContextContainer {
  10. WEB_PLATFORM_OBJECT(HTMLIFrameElement, BrowsingContextContainer);
  11. public:
  12. virtual ~HTMLIFrameElement() override;
  13. virtual RefPtr<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. private:
  18. HTMLIFrameElement(DOM::Document&, DOM::QualifiedName);
  19. virtual void inserted() override;
  20. virtual void removed_from(Node*) override;
  21. virtual void parse_attribute(FlyString const& name, String const& value) override;
  22. // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes
  23. void process_the_iframe_attributes(bool initial_insertion = false);
  24. void load_src(String const&);
  25. // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#current-navigation-was-lazy-loaded
  26. bool m_current_navigation_was_lazy_loaded { false };
  27. };
  28. void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
  29. }