mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:17:45 +00:00
LibWeb: Fix various spec comment inconsistencies
- Don't add multiple numbers to nested steps, just the innermost one (as rendered in the HTML document) - "Otherwise" comments go before the else, not after it - "FIXME:" goes before step number, not between it and the comment text - Always add a period between number and comment text The majority of these were introduced in #13756, but some unrelated ones have been updated as well.
This commit is contained in:
parent
bf16061142
commit
95541d7064
7 changed files with 133 additions and 131 deletions
|
@ -43,7 +43,7 @@ void HTMLIFrameElement::inserted()
|
|||
// 1. Create a new nested browsing context for element.
|
||||
create_new_nested_browsing_context();
|
||||
|
||||
// 2. FIXME: If element has a sandbox attribute, then parse the sandboxing directive given the attribute's value and element's iframe sandboxing flag set.
|
||||
// FIXME: 2. If element has a sandbox attribute, then parse the sandboxing directive given the attribute's value and element's iframe sandboxing flag set.
|
||||
|
||||
// 3. Process the iframe attributes for element, with initialInsertion set to true.
|
||||
load_src(attribute(HTML::AttributeNames::src));
|
||||
|
|
|
@ -77,7 +77,7 @@ bool HTMLObjectElement::has_ancestor_media_element_or_object_element_not_showing
|
|||
void HTMLObjectElement::queue_element_task_to_run_object_representation_steps()
|
||||
{
|
||||
queue_an_element_task(HTML::Task::Source::DOMManipulation, [&]() {
|
||||
// 1. FIXME: If the user has indicated a preference that this object element's fallback content be shown instead of the element's usual behavior, then jump to the step below labeled fallback.
|
||||
// FIXME: 1. If the user has indicated a preference that this object element's fallback content be shown instead of the element's usual behavior, then jump to the step below labeled fallback.
|
||||
|
||||
// 2. If the element has an ancestor media element, or has an ancestor object element that is not showing its fallback content, or if the element is not in a document whose browsing context is non-null, or if the element's node document is not fully active, or if the element is still in the stack of open elements of an HTML parser or XML parser, or if the element is not being rendered, then jump to the step below labeled fallback.
|
||||
if (!document().browsing_context() || !document().is_fully_active())
|
||||
|
@ -85,7 +85,7 @@ void HTMLObjectElement::queue_element_task_to_run_object_representation_steps()
|
|||
if (has_ancestor_media_element_or_object_element_not_showing_fallback_content())
|
||||
return run_object_representation_fallback_steps();
|
||||
|
||||
// 3. FIXME: If the classid attribute is present, and has a value that isn't the empty string, then: if the user agent can find a plugin suitable according to the value of the classid attribute, and plugins aren't being sandboxed, then that plugin should be used, and the value of the data attribute, if any, should be passed to the plugin. If no suitable plugin can be found, or if the plugin reports an error, jump to the step below labeled fallback.
|
||||
// FIXME: 3. If the classid attribute is present, and has a value that isn't the empty string, then: if the user agent can find a plugin suitable according to the value of the classid attribute, and plugins aren't being sandboxed, then that plugin should be used, and the value of the data attribute, if any, should be passed to the plugin. If no suitable plugin can be found, or if the plugin reports an error, jump to the step below labeled fallback.
|
||||
|
||||
// 4. If the data attribute is present and its value is not the empty string, then:
|
||||
if (auto data = attribute(HTML::AttributeNames::data); !data.is_empty()) {
|
||||
|
@ -135,8 +135,8 @@ void HTMLObjectElement::resource_did_load()
|
|||
// 1. Let the resource type be unknown.
|
||||
Optional<String> resource_type;
|
||||
|
||||
// 2. FIXME: If the user agent is configured to strictly obey Content-Type headers for this resource, and the resource has associated Content-Type metadata, then let the resource type be the type specified in the resource's Content-Type metadata, and jump to the step below labeled handler.
|
||||
// 3. FIXME: If there is a type attribute present on the object element, and that attribute's value is not a type that the user agent supports, but it is a type that a plugin supports, then let the resource type be the type specified in that type attribute, and jump to the step below labeled handler.
|
||||
// FIXME: 2. If the user agent is configured to strictly obey Content-Type headers for this resource, and the resource has associated Content-Type metadata, then let the resource type be the type specified in the resource's Content-Type metadata, and jump to the step below labeled handler.
|
||||
// FIXME: 3. If there is a type attribute present on the object element, and that attribute's value is not a type that the user agent supports, but it is a type that a plugin supports, then let the resource type be the type specified in that type attribute, and jump to the step below labeled handler.
|
||||
|
||||
// 4. Run the appropriate set of steps from the following list:
|
||||
// * If the resource has associated Content-Type metadata
|
||||
|
@ -144,7 +144,7 @@ void HTMLObjectElement::resource_did_load()
|
|||
// 1. Let binary be false.
|
||||
bool binary = false;
|
||||
|
||||
// 2. FIXME: If the type specified in the resource's Content-Type metadata is "text/plain", and the result of applying the rules for distinguishing if a resource is text or binary to the resource is that the resource is not text/plain, then set binary to true.
|
||||
// FIXME: 2. If the type specified in the resource's Content-Type metadata is "text/plain", and the result of applying the rules for distinguishing if a resource is text or binary to the resource is that the resource is not text/plain, then set binary to true.
|
||||
|
||||
// 3. If the type specified in the resource's Content-Type metadata is "application/octet-stream", then set binary to true.
|
||||
if (it->value == "application/octet-stream"sv)
|
||||
|
@ -183,7 +183,7 @@ void HTMLObjectElement::resource_did_load()
|
|||
resource_type = move(tentative_type);
|
||||
}
|
||||
|
||||
// 5. FIXME: If applying the URL parser algorithm to the URL of the specified resource (after any redirects) results in a URL record whose path component matches a pattern that a plugin supports, then let resource type be the type that that plugin can handle.
|
||||
// FIXME: 5. If applying the URL parser algorithm to the URL of the specified resource (after any redirects) results in a URL record whose path component matches a pattern that a plugin supports, then let resource type be the type that that plugin can handle.
|
||||
|
||||
run_object_representation_handler_steps(move(resource_type));
|
||||
}
|
||||
|
|
|
@ -204,13 +204,13 @@ i32 Window::run_timer_initialization_steps(Bindings::TimerHandler handler, i32 t
|
|||
// 2. If previousId was given, let id be previousId; otherwise, let id be an implementation-defined integer that is greater than zero and does not already exist in global's map of active timers.
|
||||
auto id = previous_id.has_value() ? previous_id.value() : m_timer_id_allocator.allocate();
|
||||
|
||||
// 3. FIXME: If the surrounding agent's event loop's currently running task is a task that was created by this algorithm, then let nesting level be the task's timer nesting level. Otherwise, let nesting level be zero.
|
||||
// FIXME: 3. If the surrounding agent's event loop's currently running task is a task that was created by this algorithm, then let nesting level be the task's timer nesting level. Otherwise, let nesting level be zero.
|
||||
|
||||
// 4. If timeout is less than 0, then set timeout to 0.
|
||||
if (timeout < 0)
|
||||
timeout = 0;
|
||||
|
||||
// 5. FIXME: If nesting level is greater than 5, and timeout is less than 4, then set timeout to 4.
|
||||
// FIXME: 5. If nesting level is greater than 5, and timeout is less than 4, then set timeout to 4.
|
||||
|
||||
// 6. Let callerRealm be the current Realm Record, and calleeRealm be global's relevant Realm.
|
||||
// FIXME: Implement this when step 9.2 is implemented.
|
||||
|
@ -237,7 +237,7 @@ i32 Window::run_timer_initialization_steps(Bindings::TimerHandler handler, i32 t
|
|||
// 3. Otherwise:
|
||||
[&](String const& source) {
|
||||
// 1. Assert: handler is a string.
|
||||
// 2. FIXME: Perform HostEnsureCanCompileStrings(callerRealm, calleeRealm). If this throws an exception, catch it, report the exception, and abort these steps.
|
||||
// FIXME: 2. Perform HostEnsureCanCompileStrings(callerRealm, calleeRealm). If this throws an exception, catch it, report the exception, and abort these steps.
|
||||
|
||||
// 3. Let settings object be global's relevant settings object.
|
||||
auto& settings_object = window->associated_document().relevant_settings_object();
|
||||
|
@ -272,8 +272,8 @@ i32 Window::run_timer_initialization_steps(Bindings::TimerHandler handler, i32 t
|
|||
}
|
||||
};
|
||||
|
||||
// 10. FIXME: Increment nesting level by one.
|
||||
// 11. FIXME: Set task's timer nesting level to nesting level.
|
||||
// FIXME: 10. Increment nesting level by one.
|
||||
// FIXME: 11. Set task's timer nesting level to nesting level.
|
||||
|
||||
// 12. Let completionStep be an algorithm step which queues a global task on the timer task source given global to run task.
|
||||
auto completion_step = [weak_window = make_weak_ptr(), task = move(task)]() mutable {
|
||||
|
|
|
@ -34,15 +34,15 @@ DOM::ExceptionOr<void> WorkerGlobalScope::import_scripts(Vector<String> urls)
|
|||
// which if provided will be used when invoking fetch a classic worker-imported script.
|
||||
// NOTE: Service Workers is an example of a specification that runs this algorithm with its own options for the perform the fetch hook.
|
||||
|
||||
// 1. FIXME: If worker global scope's type is "module", throw a TypeError exception.
|
||||
// 2. FIXME: Let settings object be the current settings object.
|
||||
// FIXME: 1. If worker global scope's type is "module", throw a TypeError exception.
|
||||
// FIXME: 2. Let settings object be the current settings object.
|
||||
|
||||
// 3. If urls is empty, return.
|
||||
if (urls.is_empty())
|
||||
return {};
|
||||
|
||||
// 4. FIXME: Parse each value in urls relative to settings object. If any fail, throw a "SyntaxError" DOMException.
|
||||
// 5. FIXME: For each url in the resulting URL records, run these substeps:
|
||||
// FIXME: 4. Parse each value in urls relative to settings object. If any fail, throw a "SyntaxError" DOMException.
|
||||
// FIXME: 5. For each url in the resulting URL records, run these substeps:
|
||||
// 1. Fetch a classic worker-imported script given url and settings object, passing along any custom perform the fetch steps provided.
|
||||
// If this succeeds, let script be the result. Otherwise, rethrow the exception.
|
||||
// 2. Run the classic script script, with the rethrow errors argument set to true.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue