mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:58:10 +00:00
LibWeb: Don't crash in offset_parent() if no ancestor element found
The specification says the final step of this algorithm is to return null. Previously, the browser would crash if the content of an iframe was appended to the document before its offsetParent property was queried.
This commit is contained in:
parent
3da6916383
commit
5b4533cab8
3 changed files with 25 additions and 1 deletions
|
@ -205,7 +205,8 @@ JS::GCPtr<DOM::Element> HTMLElement::offset_parent() const
|
|||
return const_cast<Element*>(ancestor);
|
||||
}
|
||||
|
||||
VERIFY_NOT_REACHED();
|
||||
// 3. Return null.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-view-1/#dom-htmlelement-offsettop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue