LibGC+Everywhere: Factor out a LibGC from LibJS

Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
This commit is contained in:
Shannon Booth 2024-11-15 04:01:23 +13:00 committed by Andreas Kling
parent ce23efc5f6
commit f87041bf3a
Notes: github-actions[bot] 2024-11-15 13:50:17 +00:00
1722 changed files with 9939 additions and 9906 deletions

View file

@ -32,28 +32,28 @@ struct IntersectionObserverEntryInit {
double intersection_ratio { 0.0 };
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-target
JS::Handle<DOM::Element> target;
GC::Root<DOM::Element> target;
};
class IntersectionObserverEntry final : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(IntersectionObserverEntry, Bindings::PlatformObject);
JS_DECLARE_ALLOCATOR(IntersectionObserverEntry);
GC_DECLARE_ALLOCATOR(IntersectionObserverEntry);
public:
static WebIDL::ExceptionOr<JS::NonnullGCPtr<IntersectionObserverEntry>> construct_impl(JS::Realm&, IntersectionObserverEntryInit const& options);
static WebIDL::ExceptionOr<GC::Ref<IntersectionObserverEntry>> construct_impl(JS::Realm&, IntersectionObserverEntryInit const& options);
virtual ~IntersectionObserverEntry() override;
HighResolutionTime::DOMHighResTimeStamp time() const { return m_time; }
JS::GCPtr<Geometry::DOMRectReadOnly> root_bounds() const { return m_root_bounds; }
JS::NonnullGCPtr<Geometry::DOMRectReadOnly> bounding_client_rect() const { return m_bounding_client_rect; }
JS::NonnullGCPtr<Geometry::DOMRectReadOnly> intersection_rect() const { return m_intersection_rect; }
GC::Ptr<Geometry::DOMRectReadOnly> root_bounds() const { return m_root_bounds; }
GC::Ref<Geometry::DOMRectReadOnly> bounding_client_rect() const { return m_bounding_client_rect; }
GC::Ref<Geometry::DOMRectReadOnly> intersection_rect() const { return m_intersection_rect; }
bool is_intersecting() const { return m_is_intersecting; }
double intersection_ratio() const { return m_intersection_ratio; }
JS::NonnullGCPtr<DOM::Element> target() const { return m_target; }
GC::Ref<DOM::Element> target() const { return m_target; }
private:
IntersectionObserverEntry(JS::Realm&, HighResolutionTime::DOMHighResTimeStamp time, JS::GCPtr<Geometry::DOMRectReadOnly> root_bounds, JS::NonnullGCPtr<Geometry::DOMRectReadOnly> bounding_client_rect, JS::NonnullGCPtr<Geometry::DOMRectReadOnly> intersection_rect, bool is_intersecting, double intersection_ratio, JS::NonnullGCPtr<DOM::Element> target);
IntersectionObserverEntry(JS::Realm&, HighResolutionTime::DOMHighResTimeStamp time, GC::Ptr<Geometry::DOMRectReadOnly> root_bounds, GC::Ref<Geometry::DOMRectReadOnly> bounding_client_rect, GC::Ref<Geometry::DOMRectReadOnly> intersection_rect, bool is_intersecting, double intersection_ratio, GC::Ref<DOM::Element> target);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(JS::Cell::Visitor&) override;
@ -62,13 +62,13 @@ private:
HighResolutionTime::DOMHighResTimeStamp m_time { 0.0 };
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-rootbounds
JS::GCPtr<Geometry::DOMRectReadOnly> m_root_bounds;
GC::Ptr<Geometry::DOMRectReadOnly> m_root_bounds;
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-boundingclientrect
JS::NonnullGCPtr<Geometry::DOMRectReadOnly> m_bounding_client_rect;
GC::Ref<Geometry::DOMRectReadOnly> m_bounding_client_rect;
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-intersectionrect
JS::NonnullGCPtr<Geometry::DOMRectReadOnly> m_intersection_rect;
GC::Ref<Geometry::DOMRectReadOnly> m_intersection_rect;
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-isintersecting
bool m_is_intersecting { false };
@ -77,7 +77,7 @@ private:
double m_intersection_ratio { 0.0 };
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-target
JS::NonnullGCPtr<DOM::Element> m_target;
GC::Ref<DOM::Element> m_target;
};
}