瀏覽代碼

LibWeb: Don't implement bogus assertion in prepare-the-script-element

The HTML spec is asking us to make a possibly-bogus assertion, so let's
disable it for now.

Spec bug: https://github.com/whatwg/html/issues/8534
Andreas Kling 2 年之前
父節點
當前提交
e54ae1bd11
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp

+ 2 - 3
Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp

@@ -394,10 +394,9 @@ void HTMLScriptElement::prepare_script()
     }
 
     // 32. If el's type is "classic" and el has a src attribute, or el's type is "module":
-    if ((m_script_type == ScriptType::Classic && has_attribute(HTML::AttributeNames::src))
-        || m_script_type == ScriptType::Module) {
+    if ((m_script_type == ScriptType::Classic && has_attribute(HTML::AttributeNames::src)) || m_script_type == ScriptType::Module) {
         // 1. Assert: el's result is "uninitialized".
-        VERIFY(m_result.has<ResultState::Uninitialized>());
+        // FIXME: I believe this step to be a spec bug, and it should be removed: https://github.com/whatwg/html/issues/8534
 
         // 2. If el has an async attribute or el's force async is true:
         if (has_attribute(HTML::AttributeNames::async) || m_force_async) {