mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:37:35 +00:00
LibWeb: Move DOMException from DOM/ to WebIDL/
This commit is contained in:
parent
ad04d7ac9b
commit
bbaa05fcf9
49 changed files with 206 additions and 203 deletions
|
@ -27,10 +27,10 @@ WebIDL::ExceptionOr<StaticRange*> StaticRange::create_with_global_object(HTML::W
|
|||
{
|
||||
// 1. If init["startContainer"] or init["endContainer"] is a DocumentType or Attr node, then throw an "InvalidNodeTypeError" DOMException.
|
||||
if (is<DocumentType>(*init.start_container) || is<Attr>(*init.start_container))
|
||||
return DOM::InvalidNodeTypeError::create(window, "startContainer cannot be a DocumentType or Attribute node.");
|
||||
return WebIDL::InvalidNodeTypeError::create(window, "startContainer cannot be a DocumentType or Attribute node.");
|
||||
|
||||
if (is<DocumentType>(*init.end_container) || is<Attr>(*init.end_container))
|
||||
return DOM::InvalidNodeTypeError::create(window, "endContainer cannot be a DocumentType or Attribute node.");
|
||||
return WebIDL::InvalidNodeTypeError::create(window, "endContainer cannot be a DocumentType or Attribute node.");
|
||||
|
||||
// 2. Set this’s start to (init["startContainer"], init["startOffset"]) and end to (init["endContainer"], init["endOffset"]).
|
||||
return window.heap().allocate<StaticRange>(window.realm(), *init.start_container, init.start_offset, *init.end_container, init.end_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue