mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
LibWeb/HTML: Remove uneeded FIXMEs about global being a Window
The spec only refers to this property as something that is on a Window object, and as far as I can tell this API is only ever exposed on a Window object anyhow.
This commit is contained in:
parent
1db568d06f
commit
319b447fdd
Notes:
github-actions[bot]
2025-01-30 20:57:22 +00:00
Author: https://github.com/shannonbooth
Commit: 319b447fdd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3373
Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 4 additions and 8 deletions
|
@ -380,11 +380,8 @@ void HTMLSelectElement::show_the_picker_if_applicable()
|
|||
// To show the picker, if applicable for a select element:
|
||||
|
||||
// 1. If element's relevant global object does not have transient activation, then return.
|
||||
auto& global_object = relevant_global_object(*this);
|
||||
if (!is<HTML::Window>(global_object))
|
||||
return;
|
||||
auto& relevant_global_object = static_cast<HTML::Window&>(global_object);
|
||||
if (!relevant_global_object.has_transient_activation())
|
||||
auto& relevant_global = as<HTML::Window>(relevant_global_object(*this));
|
||||
if (!relevant_global.has_transient_activation())
|
||||
return;
|
||||
|
||||
// 2. If element is not mutable, then return.
|
||||
|
@ -392,7 +389,7 @@ void HTMLSelectElement::show_the_picker_if_applicable()
|
|||
return;
|
||||
|
||||
// 3. Consume user activation given element's relevant global object.
|
||||
relevant_global_object.consume_user_activation();
|
||||
relevant_global.consume_user_activation();
|
||||
|
||||
// 4. If element's type attribute is in the File Upload state, then run these steps in parallel:
|
||||
// Not Applicable to select elements
|
||||
|
@ -454,9 +451,8 @@ WebIDL::ExceptionOr<void> HTMLSelectElement::show_picker()
|
|||
}
|
||||
|
||||
// 3. If this's relevant global object does not have transient activation, then throw a "NotAllowedError" DOMException.
|
||||
// FIXME: The global object we get here should probably not need casted to Window to check for transient activation
|
||||
auto& global_object = relevant_global_object(*this);
|
||||
if (!is<HTML::Window>(global_object) || !static_cast<HTML::Window&>(global_object).has_transient_activation()) {
|
||||
if (!as<HTML::Window>(global_object).has_transient_activation()) {
|
||||
return WebIDL::NotAllowedError::create(realm(), "Too long since user activation to show picker"_string);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue