Commit Graph

32520 Commits

Author SHA1 Message Date
Timothy Flynn
245489e68c Browser: Implement history state change mechanics
We now appropriately update the current history item or create a new
history item in the chrome process.
2024-03-29 08:52:01 -04:00
Timothy Flynn
8b1ad5c496 LibWeb+LibWebView+WebContent: Add a new IPC for modifying history state
Let's not re-invoke the "page did start loading" IPC when the history
state is pushed/replaced. It's a bit misleading (the change does not
actually load the new URL), but also the chromes may do more work than
we want when we change the URL.

Instead, add a new IPC for the history object to invoke.
2024-03-29 08:52:01 -04:00
Timothy Flynn
1767f405dc LibWeb+LibWebView+WebContent: Convert URL declarations to east-const 2024-03-29 08:52:01 -04:00
Matthew Olsson
291871e0cc LibWeb: Associate InternalAnimationTimeline with a DOM::Document 2024-03-29 06:59:37 +01:00
Matthew Olsson
c33f6b2ff6 LibWeb: Ensure requestAnimationFrame callbacks run in the proper order
From https://html.spec.whatwg.org/#list-of-animation-frame-callbacks:

    Each target object has a map of animation frame callbacks, which is
    an ordered map that must be initially empty, and an animation frame
    callback identifier, which is a number that must initially be zero.
2024-03-29 06:59:37 +01:00
Matthew Olsson
ffc648196a LibWeb: Dispatch animation events before requestAnimationFrame callbacks
Most of the time there won't be any animation frame callbacks, and we
can keep our behavior of dispatching events in the animation timer.
2024-03-29 06:59:37 +01:00
Matthew Olsson
4dc8492155 LibWeb: Move animation event dispatch into update_animations_and_...()
This will be important for the next commit
2024-03-29 06:59:37 +01:00
Aliaksandr Kalenik
ca363f0024 LibWeb: Add basic "top layer" support
Implements the "top layer" concept from "CSS Positioned Layout Module
Level 4" specification.

- The tree builder is modified to ensure that layout nodes created by
  top layer elements are children of the viewport.
- Implements missing steps in `showModal()` to add an element top top
  layer.
- Implements missing steps in `close()` to remove an element from top
  layer.

Further steps could be:
- Add support for `::backdrop` pseudo-element.
- Implement the "inert" concept from HTML spec to block hit-testing
  when element from top layer is displayed.
2024-03-29 06:57:07 +01:00
Cubic Love
41d5fa2b07 Base+ImageViewer: Restore correct app icon
Restore ImageViewer's new application icon, which was accidentally
changed back to using the filetype icon by e800605.
Additionally, use the correct icon in the ImageViewer manpage.
2024-03-28 22:32:03 -04:00
Matthew Olsson
560b07dda3 LibWeb: Use the timeline time when saving animation play/pause time 2024-03-28 21:08:32 +01:00
Matthew Olsson
a1f4d1875e LibWeb: Add an InternalAnimationTimeline object
This will allow fine grained control over animation times, which will
allow us to write timing tests that can reliably pass on the much slower
CI machines.
2024-03-28 21:08:32 +01:00
Timothy Flynn
59fb811159 Browser: Display an audio button on tabs that are playing audio
When audio begins playing, add a button to the left of the favicon with
a speaker icon to indicate which tab is playing audio. This button is
currently disabled, but in the future may be used to mute the tab.
2024-03-28 21:08:23 +01:00
Timothy Flynn
06d1477312 Browser: Display a default favicon and title
This ensures we consistently show a favicon and that we update the title
to at least display the page URL when there isn't a <title> tag. We
would otherwise continue displaying the previous page's title.
2024-03-28 21:08:23 +01:00
Timothy Flynn
099f18faff LibGUI: Add initial support for an action icon in the tab widget bar
An action icon will be a button-like component to the left of the tab
icon. This initial patch just adds support for rendering an icon. In
the future, we will want to accept an action to be triggered when the
action icon is clicked, and to paint the icon like a button.
2024-03-28 21:08:23 +01:00
Timothy Flynn
40c0dd81d2 LibWeb+LibWebView+WebContent: Inform chromes when audio is played/paused
Most browsers have some indicator when audio is playing in a tab, which
makes it easier to find that tab and mute unwanted audio. This adds an
IPC to allow the Ladybird chromes to do something similar.
2024-03-28 21:08:23 +01:00
Timothy Flynn
5424135d81 LibWeb: Remove unnecessary trailing semi-colons from Page.h
These should be caught by clang-format (via the RemoveSemicolon option),
but it does not seem to get these.
2024-03-28 21:08:23 +01:00
Aliaksandr Kalenik
220088480b LibWeb: Bring "apply the history step" up to date with the spec
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-03-28 15:34:52 +01:00
Aliaksandr Kalenik
18cfbb5cb4 LibWeb: Bring initialize_navigable() up to date with the spec 2024-03-28 15:34:52 +01:00
Aliaksandr Kalenik
ffd3639b17 LibWeb: Pass navigation params by const-ref to load_document() 2024-03-28 15:34:52 +01:00
Aliaksandr Kalenik
39f74d3437 LibWeb: Bring HistoryHandlingBehavior up to date with the specification
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-03-28 15:34:52 +01:00
ronak69
b6cf62d00a Shell: Correctly auto format command lines consisting of only whitespace
When the command line consists of only whitespace characters, the auto
formatter basically tries to trim the trailing whitespace. But due to a
subtle bug of decrementing an iterator (which is an unsigned integer)
past 0 (or the start of the buffer), that operation resulted in an index
out of bounds error and a crash.
2024-03-28 08:49:49 +01:00
ronak69
9454346341 headless-browser: Don't forget to load webpage before taking screenshot
For the normal non-test use case of headless-browser, the function
`load_page_for_screenshot_and_exit()` didn't actually load the requested
webpage in the `WebView`, resulting in an all white pixels screenshot.
2024-03-28 08:01:33 +01:00
Aliaksandr Kalenik
ce325a9912 LibWeb: Add SessionHistoryEntry::document()
No behaviour change intended.
2024-03-27 18:07:07 +01:00
Aliaksandr Kalenik
b590d1b48b LibWeb: Transform SessionHistoryEntry from a struct to a class
No behaviour change intended.
2024-03-27 18:07:07 +01:00
Nico Weber
5a43fc83bd LibGfx/JBIG2Loader: Add a short comment with spec history
I found this interesting, and it also explains e.g. why some
of the step numbers in 6.4 Text Region Decoding Procedure are off --
they added step 3) for COLEXTFLAG and forgot to update step references
to later steps.
2024-03-27 11:55:09 -04:00
Andreas Kling
d37c0a2cab LibWeb: Don't make flex layout responsible for flex container cross size
Although the flex algorithm as specified does say to determine the cross
size of the flex container, this is not how our layout engine works.

The parent formatting context is responsible for sizing its children,
and since that's already happening, we can simply remove the cross
sizing step from FFC.
2024-03-27 16:43:04 +01:00
Andreas Kling
ead341738e LibWeb: Don't use stretch-fit width for inline boxes with aspect ratio 2024-03-27 16:43:04 +01:00
Andreas Kling
1cfd8b3ac0 LibWeb: Retain size definiteness when transferred through aspect ratio
If a box has definite width and a preferred aspect ratio, we can
determine its height without performing layout. Hence, its height should
also be considered definite. And the other way around for width from
height as well.
2024-03-27 16:43:04 +01:00
Andreas Kling
ca53eefe11 LibWeb: Compute height early when possible for floating boxes
This is preparation for the next commit, which will make flex layout
relinquish control of the flex container cross size to the parent
formatting context.
2024-03-27 16:43:04 +01:00
Andreas Kling
aa59419529 LibWeb: Remove unnecessary check that BFC isn't clearing a flex item
A block-level box in BFC will never be a flex item. It may be a flex
container, but not an item. Hence this check was unnecessary.
2024-03-27 16:43:04 +01:00
Andreas Kling
a0ed8bdb57 LibWeb: Remove outdated comment about definite calc() sizes
We already do determine whether calc() sizes are definite, so this
comment was not necessary.
2024-03-27 16:43:04 +01:00
Matthew Olsson
e4dba9d932 LibWeb: Cache the last CSS play-state value on KeyframeEffect
This way we can just leave it alone if the property hasn't changed.
Notably, if the play-state property has been set to 'paused', and then
the user gets the animation with JS and calls .play() on it, it should
start playing despite the play-state property value.
2024-03-27 09:40:05 -06:00
Daniel La Rocque
1e1906865c LibJS: Remove ToTemporalDateTimeRoundingIncrement
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/aca38be
2024-03-26 17:22:46 -04:00
Nico Weber
2e6626ae3b LibGfx/JBIG2: Tweak spec comment quote characters 2024-03-26 17:21:47 -04:00
Nico Weber
6842299959 LibGfx/JBIG2: Fix a comment typo 2024-03-26 17:21:47 -04:00
Nico Weber
6ff446fd30 LibGfx/JBIG2: Fix a comment typo 2024-03-26 17:21:47 -04:00
Nico Weber
a2a5fc76aa LibGfx/JBIG2: Don't assert on unexpected OOB values in the bitstream
This should only happen on either invalid inputs or if our code has
a bug (gasp!). Printing an error instead of asserting seems nicer.
2024-03-26 17:21:47 -04:00
Nico Weber
b3c423e4ca LibGfx/ISOBMFF: Implement JPEG2000DefaultDisplayResolutionBox
Found e.g. in http://opf-labs.org/format-corpus/jp2k-formats/balloon.jpf
2024-03-26 17:19:03 -04:00
Nico Weber
a9ef2fac01 LibGfx/ISOBMFF: Introduce JPEG2000ResolutionSubboxBase
No behavior change.
2024-03-26 17:19:03 -04:00
Nico Weber
a971625c49 LibGfx/ISOBMFF: Implement UserExtensionBox
.jpf (JPEG2000) files written by Photoshop contain a whole bunch of
these boxes.

fileformats.archiveteam.org/wiki/Boxes/atoms_format lists a few
UUID types. Of those 3, these are in Photoshop-written .jpf files:

* 0537cdab-9d0c-4431-a72a-fa561f2a113e Exif
* 2c4c0100-8504-40b9-a03e-562148d6dfeb Photoshop Image Resource
* be7acfcb-97a9-42e8-9c71-999491e3afac XMP
2024-03-26 17:19:03 -04:00
Timothy Flynn
45fa6249df LibJS: Do not unnecessarily revalidate a TypedArray
No effective change, as ValidateTypedArray would call the validation AO
that the spec wants us to call manually. But no need to do it twice.
2024-03-26 17:11:26 -04:00
Ali Mohammad Pur
ea692338c2 LibCrypto: Allow CMS padding to span an entire block
This is in line with what the spec states, the previous implementation
excluded the case where the original message's length is a multiple of
block_size, which would lead to a full block of padding.
2024-03-26 19:39:03 +00:00
Timothy Flynn
d74059580c LibWeb: Return the correct substring when parsing an HTTP quoted string
We were off-by-one when returning the result of parsing a quoted string
in Web::Fetch::Infrastructure::collect_an_http_quoted_string. Instead of
backtracking the lexer and consuming the backtracked string, do a simple
substring operation.
2024-03-26 19:19:13 +00:00
Timothy Flynn
576c2f4f4d LibURL+LibUnicode+LibWebView: Handle punycode directly in LibURL
We had defined punycode handling in LibUnicode when LibURL (AK at the
time) was unable to depend on LibUnicode. This is no longer the case.
2024-03-26 12:25:21 -04:00
Timothy Flynn
5ddfcfd07e LibCore+LibTimeZone: Move TZDB utilities from LibTimeZone to LibCore
We had weakly defined a couple utilities needed by Core::DateTime when
LibCore was unable to depend on LibTimeZone. This is no longer the case.
2024-03-26 12:25:21 -04:00
Timothy Flynn
9b1b91f98a LibFileSystem: Depend on the minimal LibCore source set 2024-03-26 12:25:21 -04:00
Timothy Flynn
f7ddcb1f98 LibCore: Separate some LibCore sources into a minimal object library
We have been dancing around circular dependencies between LibCore and
generated sources. For example, LibURL currently cannot depend on
LibUnicode because the LibUnicode generators depend on LibCore, and
LibCore depends on LibURL. LibTimeZone is in a similar situation.

To alleviate this, we can define the minimal sources that the code
generators need as an object library. This will allow the generators to
depend on this library, rather than the full LibCore.
2024-03-26 12:25:21 -04:00
Timothy Flynn
4c08a1e0c0 Meta: Remove serenity_lib_static() CMake helper function
Its one user (LibMain) can now just specify a STATIC library type in an
invocation of serenity_lib().
2024-03-26 12:25:21 -04:00
Timothy Flynn
c8febe5169 LibCore: Update FIXME in LibCore's CMakeLists.txt
We have a FileWatcher implementation for macOS.
2024-03-26 12:25:21 -04:00
Tim Ledbetter
8e6e938167 LibWeb: Remove AbortSignal::follow()
This no longer has any callers.
`AbortSignal::create_dependent_abort_signal()` should be used instead.
2024-03-26 11:42:40 +01:00