Commit Graph

85 Commits

Author SHA1 Message Date
Shannon Booth
0b7c8e0de5 LibWeb: Port BrowsingContext from ByteString
Also removing an unused m_name member.
2023-12-24 13:26:50 +01:00
Ali Mohammad Pur
5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Shannon Booth
88f8ea7c60 LibWeb: Make BrowsingContex::page() return a Page&
This exposed a whole slew of now-unnecessary null checks. :^)

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-12-05 09:38:32 +01:00
Andreas Kling
bf4c8f4a09 LibWeb: Make BrowsingContext store Page member as NonnullGCPtr
No need to use WeakPtr anymore.

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-12-05 09:38:32 +01:00
Andrew Kaster
0104c8d052 LibWeb: Handle window.open() when passed a navigable name 2023-11-29 23:07:37 +01:00
Andreas Kling
bfd354492e LibWeb: Put most LibWeb GC objects in type-specific heap blocks
With this change, we now have ~1200 CellAllocators across both LibJS and
LibWeb in a normal WebContent instance.

This gives us a minimum heap size of 4.7 MiB in the scenario where we
only have one cell allocated per type. Of course, in practice there will
be many more of each type, so the effective overhead is quite a bit
smaller than that in practice.

I left a few types unconverted to this mechanism because I got tired of
doing this. :^)
2023-11-19 22:00:48 +01:00
Aliaksandr Kalenik
895ec6ad09 LibWeb: Remove unused append_child and remove_child in BrowsingContext
A part of post navigables cleanup.
2023-10-27 07:14:04 +02:00
Aliaksandr Kalenik
46254101f7 LibWeb: Change DOM::Position to be GC-allocated 2023-09-26 21:25:54 +02:00
Andreas Kling
f31b39ca18 LibWeb: Remove unused BrowsingContext::for_each_child() 2023-09-20 18:29:17 +02:00
Andreas Kling
413cc1774e LibWeb: Remove unused BrowsingContext::scroll_offset_did_change() 2023-09-20 18:29:17 +02:00
Andreas Kling
93e4a0de16 LibWeb: Move has_a_rendering_opportunity() to Navigable 2023-09-20 18:29:17 +02:00
Andreas Kling
a02d42dea2 LibWeb: Remove two unused BrowsingContext member variables 2023-09-20 18:29:17 +02:00
Andreas Kling
8e669c14c8 LibWeb: Remove unused BrowsingContext::document_family*() 2023-09-20 18:29:17 +02:00
Andreas Kling
38cb15ff49 LibWeb: Move system visibility state to TraversableNavigable
This no longer belongs in BrowsingContext.
2023-09-20 18:29:17 +02:00
Andreas Kling
046ae7fe86 LibWeb: Remove unused BrowsingContext::scroll_to_anchor() 2023-09-20 18:29:17 +02:00
Andreas Kling
94236c2532 LibWeb: Remove unused "frame nesting" tracking from BrowsingContext 2023-09-20 18:29:17 +02:00
Andreas Kling
51caa14381 LibWeb: Remove FrameLoader
This class is no longer used, now that we've moved to navigables.
2023-09-20 18:29:17 +02:00
Aliaksandr Kalenik
8e832a174e LibWeb: Update determine_the_origin to match the latest spec 2023-09-17 21:08:59 +02:00
Aliaksandr Kalenik
cd75b1de3d LibWeb: Delete discard() in Document and BrowsingContext
Those are not used anymore after moving to navigables.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
180c3e2fef LibWeb: Remove unused BrowsingContext::close()
Was replaced by close_top_level_traversable()
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
bf785fee34 LibWeb: Remove unused BrowsingContext::container_document() 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
1f2ed7effc LibWeb: Remove outdated version of determine_the_origin() 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
7b91f79817 LibWeb: Delete unused BrowsingContext::is_child_of() 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
6942bdcfce LibWeb: Update top_level_browsing_context() to use navigables 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
fda420875d LibWeb: Delete BrowsingContext::set_active_document()
Superseded by Document::make_active()
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
4532584b3a LibWeb: Remove unused BrowsingContext::create_a_new_browsing_context()
Became unused after introducing
create_a_new_browsing_context_and_document() used in navigables.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
6665f0db43 LibWeb: Delete unused document_tree_child_browsing_context_count()
The function is no longer needed with navigables.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
7daa462ef8 LibWeb: Remove BrowsingContext::create_a_new_top_level_browsing_context
This call has been replaced by
`create_a_new_top_level_browsing_context_and_document`
after specification was refactored to use navigables.
2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
24b3e315a0 LibWeb: Remove unused navigation methods in BrowsingContext 2023-09-16 16:53:32 +02:00
Aliaksandr Kalenik
dd7bba66ed LibWeb: Change viewport ownership from BrowsingContext to Navigable 2023-09-16 16:53:32 +02:00
Andrew Kaster
5f0fb84379 LibWeb: Stub out determine_the_creation_sandboxing_flags 2023-08-29 09:39:57 +02:00
Andrew Kaster
a565021147 LibWeb: De-duplicate definition of url_matches_about_blank
We don't need two static methods for this.
2023-08-29 09:39:57 +02:00
Aliaksandr Kalenik
5ff7448fee LibWeb: Move viewport subscriptions from BrowsingContext to Document
With this change, elements that want to receive viewport rect updates
will need to register on document instead of the browsing context.

This change solves the problem where a browsing context for a document
is guaranteed to exist only while the document is active so browsing
context might not exit by the time DOM node that want to register is
constructed.

This is a part of preparation work before switching to navigables where
this issue becomes more visible.
2023-08-23 20:14:20 +02:00
Aliaksandr Kalenik
b2b99aba95 LibWeb: Use Core::Timer for cursor blink timer in BrowsingContext
Using `Core::Timer` that doesn't implicitly convert callback to
`JS::SafeFunction` fixes the bug when `BrowsingContext` is never
destroyed because of cyclic dependency between callback and
`BrowsingContext`.
2023-08-19 16:41:53 +02:00
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Andreas Kling
6ae208dbf6 LibWeb: Broadcast the viewport rect to clients immediately after layout
This lets elements figure out if they're visible within the viewport or
not, so they take appropriate action.

Fixes the issues with animations not starting until the viewport was
resized or scrolled.
2023-05-09 09:48:49 +02:00
Aliaksandr Kalenik
3b00636288 LibWeb: Implement "create a new browsing context and document"
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-04-24 07:57:15 +02:00
Andreas Kling
6871fbce9f LibWeb: Implement the "top-level traversable" of a browsing context 2023-04-24 07:57:15 +02:00
Andreas Kling
65467021e2 LibWeb: Add updated version of "determine the origin" AO from HTML spec
The old version is still around since it has many users, so we can't
remove it until everything has been updated to use the new version.
2023-04-24 07:57:15 +02:00
Aliaksandr Kalenik
9f691b7fe4 LibWeb: Convert navigationId from DeprecatedString to String 2023-04-24 07:55:20 +02:00
Andreas Kling
d8ccc2d54e LibWeb: Rename BrowsingContextContainer => NavigableContainer
The "browsing context container" concept in the HTML spec has been
replaced with "navigable container". Renaming this is the first step of
many towards implementing the new world.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-19 18:26:45 +02:00
Andreas Kling
3b0e5a87db LibWeb: Make SessionHistoryEntry GC-allocated
These will need to float around more than they're currently able to.
Put them on the GC heap to prepare for that.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-04-15 14:05:00 +02:00
Timothy Flynn
2a410f8985 LibWeb: Change "popup"-related storage types to named enums 2023-03-22 00:12:53 +01:00
Timothy Flynn
1b811191cd LibWeb+WebContent: Change the "noopener" storage type to a named enum 2023-03-22 00:12:53 +01:00
Timothy Flynn
e6fc35897f WebContent+Everywhere: Add an option to not activate new tabs over IPC
WebDriver, for example, will want to create new tabs without activating
them.
2023-03-21 09:39:49 +00:00
Aliaksandr Kalenik
40ec976781 LibWeb: Inherit BrowsingContext from AbstractBrowsingContext 2023-03-16 13:17:37 -04:00
Aliaksandr Kalenik
6d91d2fa50 WebContent: Add IPC call to set window handle from WebContent client 2023-03-16 13:17:37 -04:00
Aliaksandr Kalenik
d87a207ca9 LibWeb: Add handle member in BrowsingContext
`handle` is uuid that is going to be used in WebDriver to identify
browsing context.
2023-03-16 13:17:37 -04:00
Luke Wilde
2ca8cf49ca LibWeb: Use browsing context creator URL for about:blank documents
In about:blank documents, we should use the browsing context's creator
URL as the base URL, if it exists and there is no <base> element.
This means that any about:blank frames will have URLs parse relative to
their parent frame's URL.

Fixes #17394.
2023-02-21 18:52:46 +01:00
Sam Atkins
affc8a22ca LibWeb+WebContent: Convert BrowsingContext to new pixel units
This fixes a few glitches. We no longer give the page double the width
it should have, and we mark the correct area of the page as needing
repainting.
2023-01-05 17:42:31 +01:00