Commit Graph

58960 Commits

Author SHA1 Message Date
Ali Mohammad Pur
bc301b6f40 AK+LibXML+JSSpecCompiler: Move LineTrackingLexer to AK
This is a simple extension of GenericLexer, and is used in more than
just LibXML, so let's move it into AK.
The move also resolves a FIXME, which is removed in this commit.
2024-02-16 15:26:43 +01:00
Tommy van der Vorst
08c02ad888 LibWeb: Only dump layout and text tree for the desired URL
Before this change, the rebaseline script would generate reference
based on 'about:blank' (at least running it on my macOS system).
This commit allows 'about:blank' through the assertion and only dumps
the layout tree when theloaded URL matches the one we are interested
in.
2024-02-16 15:05:30 +01:00
Nico Weber
17b22250b6 LibGfx/OpenType: Replace a magic number with a calculation
Makes this code look like the corresponding code in the ScaledFont ctor.

Similar to the last commit on #20084.

No behavior change.
2024-02-15 22:53:24 -05:00
Nico Weber
073e2bffcb LibGfx: Move POINTS_PER_INCH, DEFAULT_DPI to VectorFont.h
...so we can use it in OpenType/Font.cpp.

No behavior change.
2024-02-15 22:53:24 -05:00
Tim Ledbetter
c24652bd2e LibWeb: Implement document.scrollingElement
This returns a reference to the element that scrolls the document. In
standards mode it is equivalent to `document.documentElement`.
2024-02-15 22:51:15 -05:00
Gurkirat Singh
fc8f6c07b4 Utilities/pkg: Integrate LibSemVer for update information
Along with this, Port.h is include which helps generalising common
information for the port package, like it's name and version. With
SemVer complaint versions, it is possible to show positive change
(upgrade) or negative change (downgrade) in the installed ports.

However, for some non-complaint versions (eg. using git commit hash),
non-equality (`!=`) is used to notify upgrade. Since there is no
algorithm (without git history) to check the order of commits, it is
not possible to inform whether it is an upgrade or downgrade.
2024-02-15 18:23:05 +01:00
Gurkirat Singh
ee639fa1df Libraries: Implement SemVer for version parsing and comparisons
Semantic Versioning (SemVer) is a versioning scheme for software that
uses MAJOR.MINOR.PATCH format. MAJOR for significant, possibly
breaking changes; MINOR for backward-compatible additions; PATCH for
bug fixes. It aids communication, compatibility prediction, and
dependency management. In apps dependent on specific library versions,
SemVer guides parsing and validates compatibility, ensuring apps use
appropriate dependencies.

    <valid semver> ::= <version core>
                     | <version core> "-" <pre-release>
                     | <version core> "+" <build>
                     | <version core> "-" <pre-release> "+" <build>
2024-02-15 18:23:05 +01:00
Matthew Olsson
14200de80b LibWeb: Set DocumentTimeline origin time to zero
The current time should be used to set the timeline's new current time,
not its origin time
2024-02-15 12:34:19 +01:00
Matthew Olsson
727a9a6472 LibWeb: Run pending play tasks when the timeline time changes
Note that the timeline time changes every animation frame when the
Document sends out animation events
2024-02-15 12:34:19 +01:00
Matthew Olsson
daaaaec2d0 LibWeb: Add the Animatable IDL object 2024-02-15 12:34:19 +01:00
Matthew Olsson
4792dc294b LibWeb: Implement Animation::play 2024-02-15 12:34:19 +01:00
Matthew Olsson
88518c29ca LibWeb: Combine "pending" and "ASAP" animation task states
It seems that the difference between pending and ASAP in the spec is
only to allow the implementation to perform implementation-defined
operations between the two states. We don't need to distinguish the two
states, so lets just combine them for now.
2024-02-15 12:34:19 +01:00
Jelle Raaijmakers
66859c8cd8 Ports/SDL2: Support ShowMessageBox before VideoInit
An SDL2 application is allowed to show a message box before the video
subsystem is initialized. This change makes sure GUI::Application is
initialized.

An example of this is SRB2: the process forks itself to let the child
process install itself as the signal handler and deal with errors. This
child process could try to show a message box long after the video
subsystem was initialized, but since it is a forked process there is no
static state for GUI::Application or the connection to the window
server and the process would crash because of a null dereference.
2024-02-15 12:33:23 +01:00
Nico Weber
1d1e406b3a LibPDF/CFF: Implement some special handling for CID-keyed fonts
* FDArray, FDSelect must be present
* Encoding must not be present
* Charset maps from GID (Glyph ID) to CID (Character ID),
  instead of to character name
2024-02-15 12:32:31 +01:00
Nico Weber
7494f24430 LibPDF/CFF: Store if a font program is CID-keyed
...and reject CID-keyed font programs for Type1 fonts.
2024-02-15 12:32:31 +01:00
Nico Weber
bb7d29d007 LibPDF/CFF: Read font dicts pointed to by the fdarray offset
The fdselect array (that we already read) maps eachs glyph ID
to an fdarray index. The font dict at that index then stores
information for that glyph.

In practice, this is used to assign different defaultWidthX /
nominalWidthX values to blocks of glyphs in CID-keyed fonts.

We don't do anything yet with the data, and we also don't send
data of CID-keyed CFFs into this parser either, so no behavior
change.
2024-02-15 12:32:31 +01:00
Nico Weber
524a4f6256 LibPDF/CFF: Make parse_top_dict() return all top dicts
This happens for CFFs that contain multiple fonts. This doesn't
happen in practice, but the same code will be used for fdarray
parsing, which will contain several dicts.

No behavior change.
2024-02-15 12:32:31 +01:00
Nico Weber
9f1cf8babc LibPDF/CFF: Extract parse_top_dict() function
Pure code move, no behavior change.
2024-02-15 12:32:31 +01:00
Lucas CHOLLET
1f62984301 LibAudio/Wav: Always use u32 for the sample rate 2024-02-14 22:21:44 -05:00
Lucas CHOLLET
901baf31ff LibAudio/Wav: Remove unused methods 2024-02-14 22:21:44 -05:00
Tim Ledbetter
0ecbdc4627 LibWeb: Add support for form submission method 'dialog' 2024-02-14 22:20:44 -05:00
Tim Ledbetter
151cd11b5b LibWeb: Implement HTMLDialogElement::show() 2024-02-14 22:20:44 -05:00
Tim Ledbetter
8042558805 LibWeb: Implement HTMLDialogElement::close() for non-modal dialogs 2024-02-14 22:20:44 -05:00
Tim Ledbetter
cfbd14b958 Userland: Use MUST() to unwrap String values 2024-02-14 17:46:06 -05:00
Tim Ledbetter
2331d2bafa Userland: Propagate errors with TRY() where possible 2024-02-14 17:46:06 -05:00
Tim Ledbetter
3ffa2a39bc Tests: Propagate errors with TRY_OR_FAIL() where possible 2024-02-14 17:46:06 -05:00
Tim Ledbetter
532f2b644c Kernel: Propagate errors with TRY() where possible 2024-02-14 17:46:06 -05:00
Tim Ledbetter
89c0e3541e Fuzzers: Add PAM fuzzer 2024-02-14 19:58:46 +01:00
Sönke Holz
570480c7d5 Kernel/riscv64: Add missing include in Delay.cpp
This include was missed in 4409b33145.
RISC-V should build again now.
2024-02-14 10:32:45 -07:00
Jelle Raaijmakers
2a749525e0 LibGL: Add API stubs
- glBlendEquation
- glGetShaderInfoLog
- glGetUniformLocation
- glUniform*

This gives us full API coverage for the SRB2 port.
2024-02-14 15:09:53 +01:00
Jelle Raaijmakers
e18bc2a748 LibGL: Combine glLightModel definitions
Create a single definition with two variants for `glLightModeli` and
`glLightModelf`.
2024-02-14 15:09:53 +01:00
Jelle Raaijmakers
60bd458ed2 LibGL: Allow function name override in API definitions
Instead of limiting ourselves to the key of the property in the JSON,
allow overriding the function name so we can generate completely
different function signatures with very similar names to other existing
API methods (e.g. `glUniform*` vs `glUniform*v`).
2024-02-14 15:09:53 +01:00
Nico Weber
eb4632e08a LibPDF: Give CFF built-in encoding and charset arrays an underlying type
These arrays store SIDs ("String IDs"), so give them that type now
that we have to_array() and it's easy to do.

No behavior change.
2024-02-14 06:56:43 +01:00
Aliaksandr Kalenik
5bea99367a LibWeb: Add hit-testing test for SVG path
Adds a test for <rect> to ensure we have at least some hit-testing
coverage for SVGs.
2024-02-14 06:56:22 +01:00
Aliaksandr Kalenik
88ad871e2b LibWeb: Do paint-order traversal in Document::element_from_point()
Specify callback for hit-test function to identify closest DOM element,
excluding text nodes. Add a previously failing test case.
2024-02-14 06:56:22 +01:00
Aliaksandr Kalenik
9d2809146f LibWeb: Do paint-order traversal in Document::elements_from_point()
Elements are now collected according to paint order as spec says,
replacing the depth-first traversal of the paint tree with hit-testing
on each box.

This change resolves a FIXME in an existing test and adds a new
previously non-working test.
2024-02-14 06:56:22 +01:00
Aliaksandr Kalenik
9c99182b1e LibWeb: Change StackingContext::hit_test() to accept callback
This change modifies hit_test() to no longer return the first paintable
encountered at a specified position. Instead, this function accepts a
callback that is invoked for each paintable located at a position, in
hit-testing order.

This modification will allow us to reuse this call for
`Document.elementsFromPoint()` in upcoming changes.
2024-02-14 06:56:22 +01:00
Lucas CHOLLET
15d151ee66 LibGfx/ICO: Remove unused parameter 2024-02-14 06:56:03 +01:00
Andrew Kaster
aef188207c CI: Add debug logging to WPT run to see if we are overusing /tmp 2024-02-14 06:55:40 +01:00
Andrew Kaster
e64aa7da7a Tests: Add patch to WPT to let our metadata update script work again 2024-02-14 06:55:40 +01:00
Andrew Kaster
52f1eaefa0 Tests: Update WPT metadata for current state of Ladybird 2024-02-14 06:55:40 +01:00
Andrew Kaster
2819067370 Tests: Pass WPT certificate to WebDriver when running CI tests 2024-02-14 06:55:40 +01:00
Andrew Kaster
ff9eb62f3d WebDriver: Add commandline option to pass extra certificates
This is useful for running WPT
2024-02-14 06:55:40 +01:00
Jelle Raaijmakers
96675e61cd Kernel/TTY: Support non-blocking reads with termios VMIN == 0
In a TTY's non-canonical mode, data availability can be configured by
setting VMIN and VTIME to determine the minimum amount of bytes to read
and the timeout between bytes, respectively. Some ports (such as SRB2)
set VMIN to 0 which effectively makes reading a TTY such as stdin a
non-blocking read. We didn't support this, causing ports to hang as soon
as they try to read stdin without any data available.

Add a very duct-tapey implementation for the case where VMIN == 0 by
overwriting the TTY's description's blocking status; 3 FIXMEs are
included to make sure we clean this up some day.
2024-02-13 19:48:39 +01:00
Tim Ledbetter
877641f626 LibWeb: Display an IBeam cursor by default when mousing over a text node
We now check the type of the layout node at the current mouse position
when determining which cursor to display during a mouse move event.
2024-02-13 19:47:39 +01:00
Nico Weber
ddbcd901d1 LibPDF: Separate Type0 CMap errors
No behavior change, just more granular "not implemented" diagnostics.
2024-02-13 19:46:31 +01:00
Nico Weber
8e50bbc9fb LibPDF: Add string drawing code for Type0Fonts
This is very similar to SimpleFont::draw_string() for now, but
it'll become a bit different when we add support for vertical
text.

CIDFontType now only needs to draw single glyphs. Neither of the
subclasses can do that yet, so no behavior change yet.
2024-02-13 19:46:18 +01:00
Andrew Kaster
9077fe15ac WebContent: Tolerate invalid page_ids in ConnectionFromClient
When a tab or nested traversable navigable is closed, there might be
messages still in the pipe from the UI process that we need to
gracefully drop, rather than crash trying to access an invalid pointer.
2024-02-13 19:46:10 +01:00
Andrew Kaster
3d6c515bae WebContent: Jump through less hoops to access top level traversable 2024-02-13 19:46:10 +01:00
Andrew Kaster
bc87a48e0b WebDriver: Mark current window handle as invalid after close_window() 2024-02-13 19:46:10 +01:00