diff --git a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp index 5ce6e1ab78b..d0a327571de 100644 --- a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp +++ b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp @@ -779,7 +779,7 @@ Optional KeyframeEffect::pseudo_element_type } // https://www.w3.org/TR/web-animations-1/#dom-keyframeeffect-getkeyframes -WebIDL::ExceptionOr> KeyframeEffect::get_keyframes() +WebIDL::ExceptionOr> KeyframeEffect::get_keyframes() { if (m_keyframe_objects.size() != m_keyframes.size()) { auto& vm = this->vm(); @@ -814,7 +814,10 @@ WebIDL::ExceptionOr> KeyframeEffect::get_keyframes() } } - return m_keyframe_objects; + JS::MarkedVector keyframes { heap() }; + for (auto const& keyframe : m_keyframe_objects) + keyframes.append(keyframe); + return keyframes; } // https://www.w3.org/TR/web-animations-1/#dom-keyframeeffect-setkeyframes diff --git a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h index 2d2408d8ee2..698ffe552b4 100644 --- a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h +++ b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.h @@ -97,7 +97,7 @@ public: Bindings::CompositeOperation composite() const { return m_composite; } void set_composite(Bindings::CompositeOperation value) { m_composite = value; } - WebIDL::ExceptionOr> get_keyframes(); + WebIDL::ExceptionOr> get_keyframes(); WebIDL::ExceptionOr set_keyframes(Optional> const&); KeyFrameSet const* key_frame_set() { return m_key_frame_set; } @@ -130,7 +130,7 @@ private: Vector m_keyframes {}; // A cached version of m_keyframes suitable for returning from get_keyframes() - Vector m_keyframe_objects {}; + Vector> m_keyframe_objects {}; RefPtr m_key_frame_set {}; diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index 27159491ed6..1b7ed4eef08 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -714,7 +714,7 @@ bool fast_matches(CSS::Selector const& selector, Optional element; ssize_t compound_selector_index = 0; } backtrack_state; diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.h b/Userland/Libraries/LibWeb/CSS/StyleProperties.h index 6ec795f5145..86478853681 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.h +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,7 @@ public: struct StyleAndSourceDeclaration { RefPtr style; - CSS::CSSStyleDeclaration const* declaration = nullptr; + JS::GCPtr declaration; Important important { Important::No }; Inherited inherited { Inherited::No }; }; diff --git a/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp b/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp index 5783f5e5c6f..cc485d8a4f2 100644 --- a/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp +++ b/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.cpp @@ -384,7 +384,7 @@ JS::ThrowCompletionOr> EcKeyGenParams::from_value // https://w3c.github.io/webcrypto/#rsa-oaep-operations WebIDL::ExceptionOr> RSAOAEP::encrypt(AlgorithmParams const& params, JS::NonnullGCPtr key, ByteBuffer const& plaintext) { - auto& realm = m_realm; + auto& realm = *m_realm; auto& vm = realm.vm(); auto const& normalized_algorithm = static_cast(params); @@ -412,7 +412,7 @@ WebIDL::ExceptionOr> RSAOAEP::encrypt(Algorith // https://w3c.github.io/webcrypto/#rsa-oaep-operations WebIDL::ExceptionOr> RSAOAEP::decrypt(AlgorithmParams const& params, JS::NonnullGCPtr key, AK::ByteBuffer const& ciphertext) { - auto& realm = m_realm; + auto& realm = *m_realm; auto& vm = realm.vm(); auto const& normalized_algorithm = static_cast(params); @@ -508,7 +508,7 @@ WebIDL::ExceptionOr, JS::NonnullGCPtr> RSAOAEP::import_key(Web::Crypto::AlgorithmParams const& params, Bindings::KeyFormat key_format, CryptoKey::InternalKeyData key_data, bool extractable, Vector const& usages) { - auto& realm = m_realm; + auto& realm = *m_realm; // 1. Let keyData be the key data to be imported. @@ -678,7 +678,7 @@ WebIDL::ExceptionOr> RSAOAEP::import_key(Web::Crypto // 2. If normalizedHash is not equal to the hash member of normalizedAlgorithm, throw a DataError. if (normalized_hash.parameter->name != TRY(normalized_algorithm.hash.visit([](String const& name) -> JS::ThrowCompletionOr { return name; }, [&](JS::Handle const& obj) -> JS::ThrowCompletionOr { auto name_property = TRY(obj->get("name")); - return name_property.to_string(m_realm.vm()); }))) + return name_property.to_string(m_realm->vm()); }))) return WebIDL::DataError::create(m_realm, "Invalid hash"_fly_string); } @@ -771,7 +771,7 @@ WebIDL::ExceptionOr> RSAOAEP::import_key(Web::Crypto // https://w3c.github.io/webcrypto/#rsa-oaep-operations WebIDL::ExceptionOr> RSAOAEP::export_key(Bindings::KeyFormat format, JS::NonnullGCPtr key) { - auto& realm = m_realm; + auto& realm = *m_realm; auto& vm = realm.vm(); // 1. Let key be the key to be exported. @@ -1104,7 +1104,7 @@ WebIDL::ExceptionOr, JS::NonnullGCPtr> ECDSA::sign(AlgorithmParams const& params, JS::NonnullGCPtr key, ByteBuffer const& message) { - auto& realm = m_realm; + auto& realm = *m_realm; auto& vm = realm.vm(); auto const& normalized_algorithm = static_cast(params); @@ -1142,7 +1142,7 @@ WebIDL::ExceptionOr> ECDSA::sign(AlgorithmPara // https://w3c.github.io/webcrypto/#ecdsa-operations WebIDL::ExceptionOr ECDSA::verify(AlgorithmParams const& params, JS::NonnullGCPtr key, ByteBuffer const& signature, ByteBuffer const& message) { - auto& realm = m_realm; + auto& realm = *m_realm; auto const& normalized_algorithm = static_cast(params); // 1. If the [[type]] internal slot of key is not "public", then throw an InvalidAccessError. @@ -1154,7 +1154,7 @@ WebIDL::ExceptionOr ECDSA::verify(AlgorithmParams const& params, JS:: [](String const& name) -> JS::ThrowCompletionOr { return name; }, [&](JS::Handle const& obj) -> JS::ThrowCompletionOr { auto name_property = TRY(obj->get("name")); - return name_property.to_string(m_realm.vm()); })); + return name_property.to_string(m_realm->vm()); })); // 3. Let M be the result of performing the digest operation specified by hashAlgorithm using message. ::Crypto::Hash::HashKind hash_kind; @@ -1314,7 +1314,7 @@ WebIDL::ExceptionOr, JS::NonnullGCPtr> ED25519::sign([[maybe_unused]] AlgorithmParams const& params, JS::NonnullGCPtr key, ByteBuffer const& message) { - auto& realm = m_realm; + auto& realm = *m_realm; auto& vm = realm.vm(); // 1. If the [[type]] internal slot of key is not "private", then throw an InvalidAccessError. @@ -1348,7 +1348,7 @@ WebIDL::ExceptionOr> ED25519::sign([[maybe_unu WebIDL::ExceptionOr ED25519::verify([[maybe_unused]] AlgorithmParams const& params, JS::NonnullGCPtr key, ByteBuffer const& signature, ByteBuffer const& message) { - auto& realm = m_realm; + auto& realm = *m_realm; // 1. If the [[type]] internal slot of key is not "public", then throw an InvalidAccessError. if (key->type() != Bindings::KeyType::Public) @@ -1378,7 +1378,7 @@ WebIDL::ExceptionOr ED25519::verify([[maybe_unused]] AlgorithmParams WebIDL::ExceptionOr> PBKDF2::derive_bits(AlgorithmParams const& params, JS::NonnullGCPtr key, Optional length_optional) { - auto& realm = m_realm; + auto& realm = *m_realm; auto const& normalized_algorithm = static_cast(params); // 1. If length is null or zero, or is not a multiple of 8, then throw an OperationError. @@ -1396,7 +1396,7 @@ WebIDL::ExceptionOr> PBKDF2::derive_bits(Algor [](String const& name) -> JS::ThrowCompletionOr { return name; }, [&](JS::Handle const& obj) -> JS::ThrowCompletionOr { auto name_property = TRY(obj->get("name")); - return name_property.to_string(m_realm.vm()); })); + return name_property.to_string(m_realm->vm()); })); // 4. Let result be the result of performing the PBKDF2 operation defined in Section 5.2 of [RFC8018] // using prf as the pseudo-random function, PRF, diff --git a/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.h b/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.h index d2237a8c94b..d9f901eb68e 100644 --- a/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.h +++ b/Userland/Libraries/LibWeb/Crypto/CryptoAlgorithms.h @@ -210,7 +210,7 @@ protected: { } - JS::Realm& m_realm; + JS::NonnullGCPtr m_realm; }; class RSAOAEP : public AlgorithmMethods { diff --git a/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h b/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h index e806797bd7b..a51f5c3c406 100644 --- a/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h +++ b/Userland/Libraries/LibWeb/Crypto/KeyAlgorithms.h @@ -38,7 +38,7 @@ private: JS_DECLARE_NATIVE_FUNCTION(name_getter); String m_name; - JS::Realm& m_realm; + JS::NonnullGCPtr m_realm; }; // https://w3c.github.io/webcrypto/#RsaKeyAlgorithm-dictionary diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index cb0e5d03752..6fe237669b2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -888,7 +888,7 @@ void HTMLFormElement::plan_to_navigate_to(URL::URL url, Variant m_planned_navigation; }; } diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.cpp index 831743a2862..cf5ac9898db 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.cpp @@ -13,16 +13,16 @@ TemporaryExecutionContext::TemporaryExecutionContext(EnvironmentSettingsObject& : m_environment_settings(environment_settings) , m_callbacks_enabled(callbacks_enabled) { - m_environment_settings.prepare_to_run_script(); + m_environment_settings->prepare_to_run_script(); if (m_callbacks_enabled == CallbacksEnabled::Yes) - m_environment_settings.prepare_to_run_callback(); + m_environment_settings->prepare_to_run_callback(); } TemporaryExecutionContext::~TemporaryExecutionContext() { - m_environment_settings.clean_up_after_running_script(); + m_environment_settings->clean_up_after_running_script(); if (m_callbacks_enabled == CallbacksEnabled::Yes) - m_environment_settings.clean_up_after_running_callback(); + m_environment_settings->clean_up_after_running_callback(); } } diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.h b/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.h index e331efe9f3b..88dc90f7c4e 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/TemporaryExecutionContext.h @@ -24,7 +24,7 @@ public: ~TemporaryExecutionContext(); private: - EnvironmentSettingsObject& m_environment_settings; + JS::NonnullGCPtr m_environment_settings; CallbacksEnabled m_callbacks_enabled { CallbacksEnabled::No }; }; diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 00f3f93f1e7..c69bc9ad424 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -1128,7 +1128,7 @@ BlockFormattingContext::SpaceUsedAndContainingMarginForFloats BlockFormattingCon + floating_box.used_values.content_width() + floating_box.used_values.margin_box_right(); space_and_containing_margin.left_total_containing_margin = offset_from_containing_block_chain_margins_between_here_and_root; - space_and_containing_margin.matching_left_float_box = floating_box.box.ptr(); + space_and_containing_margin.matching_left_float_box = floating_box.box; break; } } diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.h b/Userland/Libraries/LibWeb/Layout/FormattingContext.h index f3caedb6493..de41eb7be66 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.h @@ -128,7 +128,7 @@ protected: // Each block in the containing chain adds its own margin and we store the total here. CSSPixels left_total_containing_margin; CSSPixels right_total_containing_margin; - Box const* matching_left_float_box { nullptr }; + JS::GCPtr matching_left_float_box; }; struct ShrinkToFitResult { diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp index d0c9fbeecb1..2f079d5f773 100644 --- a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp @@ -31,14 +31,14 @@ LayoutState::~LayoutState() LayoutState::UsedValues& LayoutState::get_mutable(NodeWithStyle const& node) { - if (auto* used_values = used_values_per_layout_node.get(&node).value_or(nullptr)) + if (auto* used_values = used_values_per_layout_node.get(node).value_or(nullptr)) return *used_values; for (auto const* ancestor = m_parent; ancestor; ancestor = ancestor->m_parent) { - if (auto* ancestor_used_values = ancestor->used_values_per_layout_node.get(&node).value_or(nullptr)) { + if (auto* ancestor_used_values = ancestor->used_values_per_layout_node.get(node).value_or(nullptr)) { auto cow_used_values = adopt_own(*new UsedValues(*ancestor_used_values)); auto* cow_used_values_ptr = cow_used_values.ptr(); - used_values_per_layout_node.set(&node, move(cow_used_values)); + used_values_per_layout_node.set(node, move(cow_used_values)); return *cow_used_values_ptr; } } @@ -48,17 +48,17 @@ LayoutState::UsedValues& LayoutState::get_mutable(NodeWithStyle const& node) auto new_used_values = adopt_own(*new UsedValues); auto* new_used_values_ptr = new_used_values.ptr(); new_used_values->set_node(const_cast(node), containing_block_used_values); - used_values_per_layout_node.set(&node, move(new_used_values)); + used_values_per_layout_node.set(node, move(new_used_values)); return *new_used_values_ptr; } LayoutState::UsedValues const& LayoutState::get(NodeWithStyle const& node) const { - if (auto const* used_values = used_values_per_layout_node.get(&node).value_or(nullptr)) + if (auto const* used_values = used_values_per_layout_node.get(node).value_or(nullptr)) return *used_values; for (auto const* ancestor = m_parent; ancestor; ancestor = ancestor->m_parent) { - if (auto const* ancestor_used_values = ancestor->used_values_per_layout_node.get(&node).value_or(nullptr)) + if (auto const* ancestor_used_values = ancestor->used_values_per_layout_node.get(node).value_or(nullptr)) return *ancestor_used_values; } @@ -67,7 +67,7 @@ LayoutState::UsedValues const& LayoutState::get(NodeWithStyle const& node) const auto new_used_values = adopt_own(*new UsedValues); auto* new_used_values_ptr = new_used_values.ptr(); new_used_values->set_node(const_cast(node), containing_block_used_values); - const_cast(this)->used_values_per_layout_node.set(&node, move(new_used_values)); + const_cast(this)->used_values_per_layout_node.set(node, move(new_used_values)); return *new_used_values_ptr; } diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.h b/Userland/Libraries/LibWeb/Layout/LayoutState.h index 19088e7d53e..4771cc87e4b 100644 --- a/Userland/Libraries/LibWeb/Layout/LayoutState.h +++ b/Userland/Libraries/LibWeb/Layout/LayoutState.h @@ -176,7 +176,7 @@ struct LayoutState { // NOTE: get() will not CoW the UsedValues. UsedValues const& get(NodeWithStyle const&) const; - HashMap> used_values_per_layout_node; + HashMap, NonnullOwnPtr> used_values_per_layout_node; // We cache intrinsic sizes once determined, as they will not change over the course of a full layout. // This avoids computing them several times while performing flex layout. diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h index 69c8443aeb3..d0a1d7d5c81 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h @@ -138,7 +138,7 @@ private: }; struct ConflictingEdge { - Node const* element; + JS::GCPtr element; Painting::PaintableBox::ConflictingElementKind element_kind; ConflictingSide side; Optional row; @@ -166,12 +166,12 @@ private: void collect_table_box_conflicting_edges(Vector&, Cell const&, ConflictingSide) const; struct RowGroupInfo { - Node const* row_group; + JS::GCPtr row_group; size_t start_index; size_t row_count; }; - Vector m_col_elements_by_index; + Vector> m_col_elements_by_index; Vector> m_row_group_elements_by_index; TableFormattingContext const* m_context; }; diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp index 4e18f160857..6e09d50d292 100644 --- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp @@ -207,15 +207,15 @@ void StackingContext::paint_internal(PaintContext& context) const // Draw positioned descendants with z-index `0` or `auto` in tree order. (step 8) // FIXME: There's more to this step that we have yet to understand and implement. for (auto const& paintable : m_positioned_descendants_with_stack_level_0_and_stacking_contexts) { - if (!paintable.is_positioned()) + if (!paintable->is_positioned()) continue; // At this point, `paintable_box` is a positioned descendant with z-index: auto. // FIXME: This is basically duplicating logic found elsewhere in this same function. Find a way to make this more elegant. - auto* parent_paintable = paintable.parent(); + auto* parent_paintable = paintable->parent(); if (parent_paintable) parent_paintable->before_children_paint(context, PaintPhase::Foreground); - if (auto* child = paintable.stacking_context()) { + if (auto* child = paintable->stacking_context()) { paint_child(context, *child); } else { paint_node_as_stacking_context(paintable, context); @@ -354,11 +354,11 @@ TraversalDecision StackingContext::hit_test(CSSPixelPoint position, HitTestType // 6. the child stacking contexts with stack level 0 and the positioned descendants with stack level 0. for (auto const& paintable : m_positioned_descendants_with_stack_level_0_and_stacking_contexts.in_reverse()) { - if (paintable.stacking_context()) { - if (paintable.stacking_context()->hit_test(transformed_position, type, callback) == TraversalDecision::Break) + if (paintable->stacking_context()) { + if (paintable->stacking_context()->hit_test(transformed_position, type, callback) == TraversalDecision::Break) return TraversalDecision::Break; } else { - if (paintable.hit_test(transformed_position, type, callback) == TraversalDecision::Break) + if (paintable->hit_test(transformed_position, type, callback) == TraversalDecision::Break) return TraversalDecision::Break; } } @@ -375,7 +375,7 @@ TraversalDecision StackingContext::hit_test(CSSPixelPoint position, HitTestType // 4. the non-positioned floats. for (auto const& paintable : m_non_positioned_floating_descendants.in_reverse()) { - if (paintable.hit_test(transformed_position, type, callback) == TraversalDecision::Break) + if (paintable->hit_test(transformed_position, type, callback) == TraversalDecision::Break) return TraversalDecision::Break; } diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.h b/Userland/Libraries/LibWeb/Painting/StackingContext.h index 79bdaa4b4eb..deca6e999e4 100644 --- a/Userland/Libraries/LibWeb/Painting/StackingContext.h +++ b/Userland/Libraries/LibWeb/Painting/StackingContext.h @@ -52,8 +52,8 @@ private: Vector m_children; size_t m_index_in_tree_order { 0 }; - Vector m_positioned_descendants_with_stack_level_0_and_stacking_contexts; - Vector m_non_positioned_floating_descendants; + Vector> m_positioned_descendants_with_stack_level_0_and_stacking_contexts; + Vector> m_non_positioned_floating_descendants; static void paint_child(PaintContext&, StackingContext const&); void paint_internal(PaintContext&) const; diff --git a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp index d6e102c3014..3f35835fabf 100644 --- a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.cpp @@ -72,7 +72,7 @@ void ViewportPaintable::assign_scroll_frames() if (paintable_box.has_scrollable_overflow()) { auto scroll_frame = adopt_ref(*new ScrollFrame()); scroll_frame->id = next_id++; - scroll_state.set(&paintable_box, move(scroll_frame)); + scroll_state.set(paintable_box, move(scroll_frame)); } return TraversalDecision::Continue; }); @@ -102,7 +102,7 @@ void ViewportPaintable::assign_clip_frames() auto has_hidden_overflow = overflow_x != CSS::Overflow::Visible && overflow_y != CSS::Overflow::Visible; if (has_hidden_overflow || paintable_box.get_clip_rect().has_value()) { auto clip_frame = adopt_ref(*new ClipFrame()); - clip_state.set(&paintable_box, move(clip_frame)); + clip_state.set(paintable_box, move(clip_frame)); } return TraversalDecision::Continue; }); diff --git a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h index 7aac4fd71cc..5f828bf129a 100644 --- a/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/ViewportPaintable.h @@ -20,11 +20,11 @@ public: void paint_all_phases(PaintContext&); void build_stacking_context_tree_if_needed(); - HashMap> scroll_state; + HashMap, RefPtr> scroll_state; void assign_scroll_frames(); void refresh_scroll_state(); - HashMap> clip_state; + HashMap, RefPtr> clip_state; void assign_clip_frames(); void refresh_clip_state(); diff --git a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h index 9fc0fdeeee9..3925c5f00ab 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h +++ b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h @@ -61,16 +61,16 @@ public: virtual ~SVGPageClient() override = default; - Page& m_host_page; - Page* m_svg_page { nullptr }; + JS::NonnullGCPtr m_host_page; + JS::GCPtr m_svg_page; virtual Page& page() override { return *m_svg_page; } virtual Page const& page() const override { return *m_svg_page; } virtual bool is_connection_open() const override { return false; } - virtual Gfx::Palette palette() const override { return m_host_page.client().palette(); } + virtual Gfx::Palette palette() const override { return m_host_page->client().palette(); } virtual DevicePixelRect screen_rect() const override { return {}; } virtual double device_pixels_per_css_pixel() const override { return 1.0; } - virtual CSS::PreferredColorScheme preferred_color_scheme() const override { return m_host_page.client().preferred_color_scheme(); } + virtual CSS::PreferredColorScheme preferred_color_scheme() const override { return m_host_page->client().preferred_color_scheme(); } virtual void request_file(FileRequest) override { } virtual void paint(DevicePixelRect const&, Gfx::Bitmap&, Web::PaintOptions = {}) override { } virtual void schedule_repaint() override { } diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp index 1c923911ca8..b32ee26193f 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp @@ -100,7 +100,7 @@ private: } JS::NonnullGCPtr m_realm; - WebIDL::Promise& m_promise; + JS::NonnullGCPtr m_promise; }; // https://streams.spec.whatwg.org/#byob-reader-read diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp index a9677644f90..7c2e3107af4 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp @@ -148,7 +148,7 @@ private: } JS::NonnullGCPtr m_realm; - WebIDL::Promise& m_promise; + JS::NonnullGCPtr m_promise; }; // https://streams.spec.whatwg.org/#default-reader-read