mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Make Document::page() return a Page&
Now that Document always has a Page, and always keeps it alive, we can make this return a Page&, exposing various unnecessary null checks.
This commit is contained in:
parent
70193c0009
commit
7c95ebc302
Notes:
sideshowbarker
2024-07-17 00:53:02 +09:00
Author: https://github.com/awesomekling
Commit: 7c95ebc302
Pull-request: https://github.com/SerenityOS/serenity/pull/22299
Issue: https://github.com/SerenityOS/serenity/issues/22290
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/Lubrsi
17 changed files with 43 additions and 78 deletions
|
@ -292,7 +292,7 @@ bool EnvironmentSettingsObject::is_scripting_enabled() const
|
|||
// The user has not disabled scripting for settings at this time. (User agents may provide users with the option to disable scripting globally, or in a finer-grained manner, e.g., on a per-origin basis, down to the level of individual environment settings objects.)
|
||||
auto document = const_cast<EnvironmentSettingsObject&>(*this).responsible_document();
|
||||
VERIFY(document);
|
||||
if (!document->page() || !document->page()->is_scripting_enabled())
|
||||
if (!document->page().is_scripting_enabled())
|
||||
return false;
|
||||
|
||||
// FIXME: Either settings's global object is not a Window object, or settings's global object's associated Document's active sandboxing flag set does not have its sandboxed scripts browsing context flag set.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue