Commit graph

635 commits

Author SHA1 Message Date
Noah Bright
18b4dc2153 LibWeb: Update add_libweb_test.py to support Screenshot, Ref, and Layout
Changed the usage from `add_libweb_test.py test_name.html` to
`add_libweb_test.py test_name.html test_type` with no default,
and supports automatically generating input/output files in the
right directories for test types Screenshot, Text, Ref, and Layout.

Co-authored-by: Sam Atkins <sam@ladybird.org>
2025-01-13 14:25:26 +00:00
Ivan Zuzak
cb9e3d5c9b Documentation: Mention TODOs and FIXMEs as potential sources of work
As many other projects, Ladybird has more than a few TODO and FIXME
comments sprinkled throughout the codebase. These can be a great
inspiration or starting point for contributors looking for work, so
we mention them in the docs on contributing to the project.
2025-01-05 12:02:16 +01:00
Timothy Flynn
66732d2203 Meta: Switch to clang-format-19 as the standard formatter 2024-12-28 05:39:32 -08:00
Timothy Flynn
2ec97b4548 Meta: Update to clang-19 in CI and build instructions 2024-12-28 05:39:32 -08:00
Sam Atkins
eb11c35640 LibWeb/CSS: Use CSSNumericType for CalculationResult's numeric type
When we originally implemented calc(), the result of a calculation was
guaranteed to be a single CSS type like a Length or Angle. However, CSS
Values 4 now allows more complex type arithmetic, which is represented
by the CSSNumericType class. Using that directly makes us more correct,
and allows us to remove a large amount of now ad-hoc code.

Unfortunately this is a large commit but the changes it makes are
interconnected enough that doing one at a time causes test
regressions.

In no particular order:

- Update our "determine the type of a calculation" code to match the
  newest spec, which sets percent hints in a couple more cases. (One of
  these we're skipping for now, I think it fails because of the FIXMEs
  in CSSNumericType::matches_foo().)
- Make the generated math-function-parsing code aware of the difference
  between arguments being the same type, and being "consistent" types,
  for each function. Otherwise those extra percent hints would cause
  them to fail validation incorrectly.
- Use the CSSNumericType as the type for the CalculationResult.
- Calculate and assign each math function's type in its constructor,
  instead of calculating it repeatedly on-demand.

The `CalculationNode::resolved_type()` method is now entirely unused and
has been removed.
2024-12-21 18:14:28 +01:00
Jess
61fcccb104 Flake: Add and run formatter + Rename devshell
Add a formatter output to the flake (`nix fmt`), along with moving +
renaming the devshell so it will work by running `nix-shell` in the root
of the project.
2024-12-18 15:15:42 +00:00
sideshowbarker
afca902ea9 Docs: Explain how to do Debug builds without optimizations on
This change updates the (advanced) build docs to explain how to do a
Debug build with the CXX `-O0` option set — which tells the compiler to
build with no optimizations at all.

Otherwise, Debug builds use the `-Og` option — which, when trying to
check frame variables in a debugger can result in an error of this form:

> error: Couldn't look up symbols: __ZN2AK6Detail10StringBaseD2Ev
> Hint: The expression tried to call a function that is not present in
> the target, perhaps because it was optimized out by
> the compiler.
2024-12-11 17:31:52 -07:00
mkljczk
0b2fe008a3 Docs: Add perl-lib to build prerequisites for Fedora 2024-12-10 10:36:29 -08:00
sideshowbarker
aa2c296489 Docs: Add “Is [some particular site] usable in Ladybird” to FAQ 2024-12-08 15:30:03 +01:00
Sam Atkins
2c3c821305 LibWeb: Remove Realm parameter from property_initial_value()
We don't need the Realm to parse a style value.

Fixes #2720
2024-12-05 19:59:57 +01:00
Sam Atkins
b9994c83da Documentation: Update coding style rules about comments
The requirement to use // for comments wasn't described anywhere, so now
it is! Also updated the rule about TODO comments because we've allowed
those for a while now.
2024-12-04 22:22:24 +01:00
Pavel Shliak
2d0fdf804e Documentation: Minor rewordings in Porting.md 2024-12-04 10:26:24 +01:00
Ben Wiederhake
079fdf50d4 Meta+Documentation: Update config for QtCreator
We no longer use C or raw assembly (*.S), and generated include files
have moved to Build/release/Lagom/.
2024-12-02 09:45:32 +00:00
Jess
f4cc9c6426 Docs: Update Nixos build instructions 2024-12-01 13:27:59 -05:00
rmg-x
59c8e0cd5a Documentation: Remove SerenityOS references where appropriate 2024-11-23 14:29:48 +01:00
Feng Yu
570c5f8df2 Documentation: Fix broken link in README 2024-11-21 10:42:45 +01:00
Nicolas Ramz
e98e9b8e81 Documentation: Fix typo in Testing markdown 2024-11-20 15:48:13 +01:00
Shannon Booth
f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00
Luke Wilde
aacf9b08ed LibWeb: Generate IDL attributes for all supported CSS properties
The CSSOM spec tells us to potentially add up to three different IDL
attributes to CSSStyleDeclaration for every CSS property we support:
- A camelCased attribute, where a dash indicates the next character
  should be uppercase
- A camelCased attribute for every -webkit- prefixed property, with the
  first letter always being lowercase
- A dashed-attribute for every property with a dash in it.

Additionally, every attribute must have the CEReactions and
LegacyNullToEmptyString extended attributes specified on it.

Since we specify every property we support with Properties.json, we can
use that file to generate the IDL file and it's implementation.

We import it from the Build directory with the help of multiple import
base paths. Then, we add it to CSSStyleDeclaration via the mixin
functionality and inheriting the generated class in
CSSStyleDeclaration.
2024-11-14 19:50:22 +01:00
Timothy Flynn
db47cc41f8 Everywhere: Move the Ladybird folder to UI 2024-11-10 12:50:45 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Timothy Flynn
22e0eeada2 Everywhere: Hoist the Services folder to the top-level 2024-11-10 12:50:45 +01:00
sideshowbarker
98b223b9df Docs: Beef up the FAQ 2024-11-09 11:07:55 -07:00
Andrew Kaster
f4124c7f40 CI+DevContainer+Documentation: Remove install steps for ffmpeg libs 2024-11-08 11:10:31 -07:00
sideshowbarker
96ded779e2 Docs: Recommend “Web Browser Engineering” book in GettingStarted guide 2024-11-07 15:39:31 +01:00
Timothy Flynn
5681dbee64 Meta: Move the vcpkg installation/cache directories under Build
In addition to changing the build-type dependent build directories, we
can take this opportunity to move the vcpkg cache directory to the Build
folder itself. This probably isn't 100% needed, but it ensures that no
leftover artifacts are used from non-dynamic vcpkg builds, and it's also
generally nice to have all build artifacts under Build.
2024-11-06 10:38:57 -07:00
Timothy Flynn
4ffca2089e Meta: Change the default build directories to exclude "ladybird" prefix
The reason for this change is that CMake/vcpkg are unable to detect a
change to VCPKG_LIBRARY_LINKAGE. So when we switch to dynamic builds,
the switch would be non-functional, and every developer would have to
remove their Build and vcpkg cache directories manually. By changing
these directories, vcpkg is able to detect it must rebuild.
2024-11-06 10:38:57 -07:00
Sam Atkins
7a5b38d577 Meta: Support importing WPT reference tests 2024-11-05 17:58:16 +00:00
Sam Atkins
b7efb61fbe Tests/LibWeb: Restructure Ref and Screenshot test dirs to match others
Now each test type has the same directories:
- input
- expected
- data

Also, tests can be in subdirectories within ./input.
2024-11-05 14:02:07 +00:00
sideshowbarker
21b705ee32 Documentation: Explain how to import tests using the WPT.sh script 2024-11-05 10:38:52 +01:00
Kostya Farber
aeab342fd7 Documentation: Add VSCode debugger instructions
Co-authored-by: sideshowbarker <mike@w3.org>
2024-11-01 12:25:28 -07:00
Hermes Junior
1be6c12501 Documentation: Explain how to fix CMake errors in CLion
When importing the project in some CLion versions,
the build profile can be created missing configurations,
breaking code insight.
2024-11-01 16:22:40 +00:00
Timothy Flynn
3a6b698572 Documentation: Add note about making the macOS terminal a developer tool 2024-11-01 15:04:53 +01:00
sideshowbarker
51912bf0da Documentation: Make updates to align better with new issue template 2024-10-31 09:18:08 +01:00
66542e
9b44a99617 Documentation: Rename class name on Images/classes.png
Updated class name on diagram according to rename in the
commit(3a71748e5d).
2024-10-28 11:06:38 -04:00
Kostya Farber
b953b5cc71 Documentation: Change in name from Serenity to Ladybird
Probably a remnant from Ladybird being in Serenity :^).
2024-10-27 14:33:24 +01:00
Jonne Ransijn
551b72b018 Documentation: Add one more option for getting started
Using a profiler is another great way to find issues
2024-10-27 09:43:04 +01:00
Jonne Ransijn
d002254ada Meta: Add build instructions for Void Linux
`git` and `bash` are most likely already installed, `bash` is part of
`base-system`, and `git` is required to pull the repository in the
first place, but they are not included in `base-minimal` or
`base-container`, and they ARE required for a successful build,
so I have added them regardless.

`qt6-tools-devel` and `qt6-wayland-devel` were not required to compile
and link Ladybird on my machine, but I have included them as they are
installed on the other Linux distributions.
2024-10-23 11:33:03 -06:00
Sam Atkins
86744449e3 Documentation: Flatten the Browser/ directory
Separating out the browser documentation doesn't make much sense now
that we are only a browser. :^)
2024-10-23 09:02:46 +02:00
Sam Atkins
25441e2250 Documentation: Move editor configuration guides into a subdirectory
This makes them a bit easier to find, and also stops them cluttering up
the main documentation.
2024-10-23 09:02:46 +02:00
Sam Atkins
c036e87d46 Documentation: Combine testing documentation together
Bring together the docs on running tests, with the ones on writing them
which were hidden in Browser/Patterns.md

I've made a few adjustments while I was at it, because RunningTests.md
was a bit outdated and didn't mention `Meta/ladybird.sh test`. It's
possible they're still outdated and wrong, but I'm not familiar enough
with that area to know.
2024-10-23 09:02:46 +02:00
Jelle Raaijmakers
0310b47a7b Documentation: Remove doc on self-hosted runners
The mentioned runner is no longer in use, and we set up runners managed
by the org nowadays.
2024-10-17 08:16:50 -04:00
John Diamond
5c35807878 Documentation: Suggest installing clang-format version 18 precisely 2024-10-14 15:54:53 -06:00
Totto16
846a3a16e2 Meta: Update the devcontainer configuration
Update the base image and the feature images
Add new packages to the install.sh command
as they are now needed by some dependencies, that are built via vcpkg
Add newer clang version, but the default stays the same
2024-10-12 11:34:57 -06:00
Andrew Kaster
3b2b86303f Documentation: Add start of a Porting guide 2024-10-11 09:08:10 +02:00
Andrew Kaster
5e090b359c Documentation: Add instructions for experimental native Windows build
Co-Authored-By: pheonixfirewingz <luke.a.shore@proton.me>
2024-10-10 21:48:41 -06:00
Timothy Flynn
de1475f99a Documentation: Update description of "Unable to find ninja" error
Unlike the current FAQ entry, this error really never involves having to
uninstall/reinstall Ninja or invoking it directly.
2024-10-08 16:34:13 +02:00
Neil Viloria
1e29a3ae13 Documentation: Update command for regenerating test expectations 2024-10-06 22:48:13 -06:00
sideshowbarker
6762714f5e Documentation: Emphasize getting started by troubleshooting WPT tests 2024-10-04 20:01:42 +02:00
Timothy Flynn
d33a87c8c4 LibWeb+Documentation: Remove the rebaseline-libweb-test script
This is superseded by the headless-browser --rebaseline flag.
2024-10-03 09:15:45 -04:00