mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 09:18:52 +00:00
LibWeb: Allow setting HTMLTableElement.caption to null value
This takes care of 2 FIXMEs :^)
This commit is contained in:
parent
6e127f62d7
commit
2d791cf90f
Notes:
sideshowbarker
2024-07-17 03:06:38 +09:00
Author: https://github.com/awesomekling
Commit: 2d791cf90f
Pull-request: https://github.com/SerenityOS/serenity/pull/16517
1 changed files with 5 additions and 6 deletions
|
@ -62,16 +62,15 @@ JS::GCPtr<HTMLTableCaptionElement> HTMLTableElement::caption()
|
|||
return first_child_of_type<HTMLTableCaptionElement>();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/tables.html#dom-table-caption
|
||||
void HTMLTableElement::set_caption(HTMLTableCaptionElement* caption)
|
||||
{
|
||||
// FIXME: This is not always the case, but this function is currently written in a way that assumes non-null.
|
||||
VERIFY(caption);
|
||||
|
||||
// FIXME: The spec requires deleting the current caption if caption is null
|
||||
// Currently the wrapper generator doesn't send us a nullable value
|
||||
// On setting, the first caption element child of the table element, if any, must be removed,
|
||||
// and the new value, if not null, must be inserted as the first node of the table element.
|
||||
delete_caption();
|
||||
|
||||
MUST(pre_insert(*caption, first_child()));
|
||||
if (caption)
|
||||
MUST(pre_insert(*caption, first_child()));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<HTMLTableCaptionElement> HTMLTableElement::create_caption()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue