mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibWeb: Move DOMException from DOM/ to WebIDL/
This commit is contained in:
parent
ad04d7ac9b
commit
bbaa05fcf9
Notes:
sideshowbarker
2024-07-17 06:38:09 +09:00
Author: https://github.com/linusg
Commit: bbaa05fcf9
Pull-request: https://github.com/SerenityOS/serenity/pull/15357
Reviewed-by: https://github.com/awesomekling ✅
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