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
|
@ -24,7 +24,7 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(HTMLTableRowElement);
|
||||
GC_DEFINE_ALLOCATOR(HTMLTableRowElement);
|
||||
|
||||
HTMLTableRowElement::HTMLTableRowElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: HTMLElement(document, move(qualified_name))
|
||||
|
@ -68,7 +68,7 @@ void HTMLTableRowElement::visit_edges(Cell::Visitor& visitor)
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/tables.html#dom-tr-cells
|
||||
JS::NonnullGCPtr<DOM::HTMLCollection> HTMLTableRowElement::cells() const
|
||||
GC::Ref<DOM::HTMLCollection> HTMLTableRowElement::cells() const
|
||||
{
|
||||
// The cells attribute must return an HTMLCollection rooted at this tr element,
|
||||
// whose filter matches only td and th elements that are children of the tr element.
|
||||
|
@ -87,7 +87,7 @@ int HTMLTableRowElement::row_index() const
|
|||
// or a parent tbody, thead, or tfoot element and a grandparent table element,
|
||||
// return the index of this tr element in that table element's rows collection.
|
||||
// If there is no such table element, then the attribute must return −1.
|
||||
auto rows_collection = [&]() -> JS::GCPtr<DOM::HTMLCollection> {
|
||||
auto rows_collection = [&]() -> GC::Ptr<DOM::HTMLCollection> {
|
||||
if (!parent())
|
||||
return nullptr;
|
||||
if (is<HTMLTableElement>(*parent()))
|
||||
|
@ -112,7 +112,7 @@ int HTMLTableRowElement::section_row_index() const
|
|||
// return the index of the tr element in the parent element's rows collection
|
||||
// (for tables, that's HTMLTableElement's rows collection; for table sections, that's HTMLTableSectionElement's rows collection).
|
||||
// If there is no such parent element, then the attribute must return −1.
|
||||
auto rows_collection = [&]() -> JS::GCPtr<DOM::HTMLCollection> {
|
||||
auto rows_collection = [&]() -> GC::Ptr<DOM::HTMLCollection> {
|
||||
if (!parent())
|
||||
return nullptr;
|
||||
if (is<HTMLTableElement>(*parent()))
|
||||
|
@ -132,7 +132,7 @@ int HTMLTableRowElement::section_row_index() const
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/tables.html#dom-tr-insertcell
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableCellElement>> HTMLTableRowElement::insert_cell(i32 index)
|
||||
WebIDL::ExceptionOr<GC::Ref<HTMLTableCellElement>> HTMLTableRowElement::insert_cell(i32 index)
|
||||
{
|
||||
auto cells_collection = cells();
|
||||
auto cells_collection_size = static_cast<i32>(cells_collection->length());
|
||||
|
@ -153,7 +153,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLTableCellElement>> HTMLTableRowElement:
|
|||
insert_before(table_cell, cells_collection->item(index));
|
||||
|
||||
// 5. Return table cell.
|
||||
return JS::NonnullGCPtr(table_cell);
|
||||
return GC::Ref(table_cell);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/tables.html#dom-tr-deletecell
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue