
With this change, we now have ~1200 CellAllocators across both LibJS and LibWeb in a normal WebContent instance. This gives us a minimum heap size of 4.7 MiB in the scenario where we only have one cell allocated per type. Of course, in practice there will be many more of each type, so the effective overhead is quite a bit smaller than that in practice. I left a few types unconverted to this mechanism because I got tired of doing this. :^)
55 lines
2.1 KiB
C++
55 lines
2.1 KiB
C++
/*
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/HTML/NavigableContainer.h>
|
|
|
|
namespace Web::HTML {
|
|
|
|
class HTMLIFrameElement final : public NavigableContainer {
|
|
WEB_PLATFORM_OBJECT(HTMLIFrameElement, NavigableContainer);
|
|
JS_DECLARE_ALLOCATOR(HTMLIFrameElement);
|
|
|
|
public:
|
|
virtual ~HTMLIFrameElement() override;
|
|
|
|
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
|
|
|
// 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; }
|
|
|
|
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; }
|
|
|
|
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
|
|
|
private:
|
|
HTMLIFrameElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
// ^DOM::Element
|
|
virtual void inserted() override;
|
|
virtual void removed_from(Node*) override;
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& value) override;
|
|
virtual i32 default_tab_index_value() const override;
|
|
|
|
// 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 };
|
|
|
|
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#iframe-pending-resource-timing-start-time
|
|
Optional<HighResolutionTime::DOMHighResTimeStamp> m_pending_resource_start_time = {};
|
|
};
|
|
|
|
void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
|
|
|
|
}
|