1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

LibWeb: Move DOMException from DOM/ to WebIDL/

This commit is contained in:
Linus Groh 2022-09-25 17:28:46 +01:00
parent ad04d7ac9b
commit bbaa05fcf9
49 changed files with 206 additions and 203 deletions

View file

@ -55,7 +55,7 @@ WebIDL::ExceptionOr<unsigned> CSSRuleList::insert_a_css_rule(Variant<StringView,
// 2. If index is greater than length, then throw an IndexSizeError exception.
if (index > length)
return DOM::IndexSizeError::create(global_object(), "CSS rule index out of bounds.");
return WebIDL::IndexSizeError::create(global_object(), "CSS rule index out of bounds.");
// 3. Set new rule to the results of performing parse a CSS rule on argument rule.
// NOTE: The insert-a-css-rule spec expects `rule` to be a string, but the CSSStyleSheet.insertRule()
@ -72,7 +72,7 @@ WebIDL::ExceptionOr<unsigned> CSSRuleList::insert_a_css_rule(Variant<StringView,
// 4. If new rule is a syntax error, throw a SyntaxError exception.
if (!new_rule)
return DOM::SyntaxError::create(global_object(), "Unable to parse CSS rule.");
return WebIDL::SyntaxError::create(global_object(), "Unable to parse CSS rule.");
// FIXME: 5. If new rule cannot be inserted into list at the zero-index position index due to constraints specified by CSS, then throw a HierarchyRequestError exception. [CSS21]
@ -93,7 +93,7 @@ WebIDL::ExceptionOr<void> CSSRuleList::remove_a_css_rule(u32 index)
// 2. If index is greater than or equal to length, then throw an IndexSizeError exception.
if (index >= length)
return DOM::IndexSizeError::create(global_object(), "CSS rule index out of bounds.");
return WebIDL::IndexSizeError::create(global_object(), "CSS rule index out of bounds.");
// 3. Set old rule to the indexth item in list.
CSSRule& old_rule = m_rules[index];