mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +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
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(NodeIterator);
|
||||
GC_DEFINE_ALLOCATOR(NodeIterator);
|
||||
|
||||
NodeIterator::NodeIterator(Node& root)
|
||||
: PlatformObject(root.realm())
|
||||
|
@ -48,7 +48,7 @@ void NodeIterator::visit_edges(Cell::Visitor& visitor)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-document-createnodeiterator
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<NodeIterator>> NodeIterator::create(Node& root, unsigned what_to_show, JS::GCPtr<NodeFilter> filter)
|
||||
WebIDL::ExceptionOr<GC::Ref<NodeIterator>> NodeIterator::create(Node& root, unsigned what_to_show, GC::Ptr<NodeFilter> filter)
|
||||
{
|
||||
// 1. Let iterator be a new NodeIterator object.
|
||||
// 2. Set iterator’s root and iterator’s reference to root.
|
||||
|
@ -74,13 +74,13 @@ void NodeIterator::detach()
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-nodeiterator-traverse
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> NodeIterator::traverse(Direction direction)
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> NodeIterator::traverse(Direction direction)
|
||||
{
|
||||
// 1. Let node be iterator’s reference.
|
||||
// 2. Let beforeNode be iterator’s pointer before reference.
|
||||
m_traversal_pointer = m_reference;
|
||||
|
||||
JS::GCPtr<Node> candidate;
|
||||
GC::Ptr<Node> candidate;
|
||||
|
||||
// 3. While true:
|
||||
while (true) {
|
||||
|
@ -175,13 +175,13 @@ JS::ThrowCompletionOr<NodeFilter::Result> NodeIterator::filter(Node& node)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-nodeiterator-nextnode
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> NodeIterator::next_node()
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> NodeIterator::next_node()
|
||||
{
|
||||
return traverse(Direction::Next);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-nodeiterator-previousnode
|
||||
JS::ThrowCompletionOr<JS::GCPtr<Node>> NodeIterator::previous_node()
|
||||
JS::ThrowCompletionOr<GC::Ptr<Node>> NodeIterator::previous_node()
|
||||
{
|
||||
return traverse(Direction::Previous);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue