mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
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:
parent
ce23efc5f6
commit
f87041bf3a
Notes:
github-actions[bot]
2024-11-15 13:50:17 +00:00
Author: https://github.com/shannonbooth
Commit: f87041bf3a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2345
1722 changed files with 9939 additions and 9906 deletions
|
@ -13,25 +13,25 @@ namespace Web::DOM {
|
|||
// https://dom.spec.whatwg.org/#treewalker
|
||||
class TreeWalker final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(TreeWalker, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(TreeWalker);
|
||||
GC_DECLARE_ALLOCATOR(TreeWalker);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<TreeWalker> create(Node& root, unsigned what_to_show, JS::GCPtr<NodeFilter>);
|
||||
[[nodiscard]] static GC::Ref<TreeWalker> create(Node& root, unsigned what_to_show, GC::Ptr<NodeFilter>);
|
||||
|
||||
virtual ~TreeWalker() override;
|
||||
|
||||
JS::NonnullGCPtr<Node> current_node() const;
|
||||
GC::Ref<Node> current_node() const;
|
||||
void set_current_node(Node&);
|
||||
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> parent_node();
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> first_child();
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> last_child();
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> previous_sibling();
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> next_sibling();
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> previous_node();
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> next_node();
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> parent_node();
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> first_child();
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> last_child();
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> previous_sibling();
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> next_sibling();
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> previous_node();
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> next_node();
|
||||
|
||||
JS::NonnullGCPtr<Node> root() { return m_root; }
|
||||
GC::Ref<Node> root() { return m_root; }
|
||||
|
||||
NodeFilter* filter() { return m_filter.ptr(); }
|
||||
|
||||
|
@ -47,27 +47,27 @@ private:
|
|||
First,
|
||||
Last,
|
||||
};
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> traverse_children(ChildTraversalType);
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> traverse_children(ChildTraversalType);
|
||||
|
||||
enum class SiblingTraversalType {
|
||||
Next,
|
||||
Previous,
|
||||
};
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> traverse_siblings(SiblingTraversalType);
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> traverse_siblings(SiblingTraversalType);
|
||||
|
||||
JS::ThrowCompletionOr<NodeFilter::Result> filter(Node&);
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-traversal-root
|
||||
JS::NonnullGCPtr<Node> m_root;
|
||||
GC::Ref<Node> m_root;
|
||||
|
||||
// https://dom.spec.whatwg.org/#treewalker-current
|
||||
JS::NonnullGCPtr<Node> m_current;
|
||||
GC::Ref<Node> m_current;
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-traversal-whattoshow
|
||||
unsigned m_what_to_show { 0 };
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-traversal-filter
|
||||
JS::GCPtr<NodeFilter> m_filter;
|
||||
GC::Ptr<NodeFilter> m_filter;
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-traversal-active
|
||||
bool m_active { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue