Commit graph

49973 commits

Author SHA1 Message Date
Ben Wiederhake 36ff6187f6 Everywhere: Change spelling of 'behaviour' to 'behavior'
"The official project language is American English […]."
5d2e915623/CONTRIBUTING.md?plain=1#L30

Here's a short statistic of the occurrences of the word "behavio(u)r":

$ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n
      2 BEHAVIOR
     24 Behaviour
     32 behaviour
    407 Behavior
    992 behavior

Therefore, it is clear that "behaviour" (56 occurrences) should be
regarded a typo, and "behavior" (1401 occurrences) should be preferred.

Note that The occurrences in LibJS are intentionally NOT changed,
because there are taken verbatim from the specification. Hence:

$ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n
      2 BEHAVIOR
     10 behaviour
     24 Behaviour
    407 Behavior
   1014 behavior
2023-05-07 01:05:09 +02:00
Ben Wiederhake d5f8dac2bd dungeonrush: Fix typo in patches 2023-05-07 01:05:09 +02:00
Ben Wiederhake ee47c0275e Everywhere: Run spellcheck on all documentation 2023-05-07 01:05:09 +02:00
Cubic Love a7600caea1 Base+Snake: Capitalize snake skin names
In Snake, the menu for choosing a skin looked messy due to
inconsistent capitalization. Two skins names were entirely lowercase.
For the sprite-based skins, the menu takes the name of each skin's
directory, so I have capitalized these.

Capitalizing the original snake skin required more change than simply
renaming a directory.
2023-05-06 22:19:41 +02:00
Ben Wiederhake 4b7639c3b5 LibGfx+WindowServer: Ensure constrain-to-rect ends up inside the rect 2023-05-06 22:04:46 +02:00
MacDue 4c2ad70066 Toolchain: Use ninja to bootstrap CMake
For some reason (for me) on Ubuntu 22.04 the standard make generator
fails:

  ---------------------------------------------
  CMake has bootstrapped.  Now run gmake.
  make: make: Permission denied
  make: *** [Makefile:166: all] Error 127

This seems to be because Source/kwsys/CMakeFiles/cmsys.dir/depend is
missing or not generated. Using ninja works fine though, and as it is
already the default for Serenity proper, it seems reasonable to switch
it here too.
2023-05-06 22:04:12 +02:00
Nico Weber 36c8c1129b LibGfx/WebP: Use context.error() in animation frame decoding function
That also sets the error state on the context.
2023-05-06 21:17:18 +02:00
Nico Weber 40e839fd7e image: Add a --frame-index option 2023-05-06 21:17:18 +02:00
Nico Weber ce45ad6112 LibGfx/WebP: Implement decoding of animation frame bitmaps
With this, lossless animated webp files work :^)

(Missing: Loop count handling is not yet implemented, and alpha blending
between frames isn't done in linear space.)
2023-05-06 21:17:18 +02:00
Nico Weber 23ce1f641c LibGfx/WebP: Check that animation frame dimensions are in bounds 2023-05-06 21:17:18 +02:00
Nico Weber 0b70ecb7e6 LibGfx/WebP: Make decode_webp_chunk_VP8L() return a Bitmap
...instead of setting it on the context. We'll need this to decode
animation frames.
2023-05-06 21:17:18 +02:00
Nico Weber 1334bac548 LibGfx/WebP: Extract an ImageData struct
We'll need the same struct for animation frames.
2023-05-06 21:17:18 +02:00
Nico Weber 03b04ed66a LibGfx/WebP: Check ICCP chunk precedes alpha and animation frame chunks 2023-05-06 21:17:18 +02:00
Andreas Kling 41d518669e LibWeb: Remove weird CSS::Length::resolved() API
This API is no longer used by anyone so let's remove it.
2023-05-06 21:14:38 +02:00
Andreas Kling c6309bce0b LibWeb: Stop using weird resolved() in FilterValueListStyleValue 2023-05-06 21:14:38 +02:00
Andreas Kling 6ccb77a9b8 LibWeb: Stop using weird Length::resolved() in {Block,}FormattingContext 2023-05-06 21:14:38 +02:00
Andreas Kling 07815dacf8 LibWeb: Don't use weird resolved() when calculating abspos box height 2023-05-06 21:14:38 +02:00
Andreas Kling 7eb9e730e0 LibWeb: Remove unused variable in FormattingContext 2023-05-06 21:14:38 +02:00
Andreas Kling 4699365a64 LibWeb: Stop using weird resolved() in calculate_inner_{width,height}() 2023-05-06 21:14:38 +02:00
Andreas Kling 452a527ff3 LibWeb: Don't use weird resolved() for insets in FormattingContext 2023-05-06 21:14:38 +02:00
Andreas Kling 1d76126abe LibWeb: Don't use weird Length::resolved() for padding in BFC 2023-05-06 21:14:38 +02:00
Andreas Kling c9223528a0 LibWeb: Get rid of weird Length::resolved() usage in LayoutState
The second call to resolved() turns non-finite lengths into "auto".
This is a very strange ad-hoc behavior that we need to get rid of.
2023-05-06 21:14:38 +02:00
Andreas Kling ca1fa5f748 LibWeb: Use the new to_px() helpers in CSS, SVG and layout code
There should be no behavior change from this, only slightly less
verbosity. :^)
2023-05-06 18:41:34 +02:00
Andreas Kling cdf0d3e905 LibWeb: Add to_px() helpers to CSS::Size and CSS::PercentageOr<T>
Old pattern:

    foo.resolved(node, reference_value).to_px(node)

New pattern:

    foo.to_px(node, reference_value)

Also, the reference value for to_px() is a CSSPixels, which means we
don't have to synthesize a CSS::Length just for this call.
2023-05-06 18:41:34 +02:00
Andreas Kling 3e62ab996d LibWeb: Put debug spam about unimplemented calc() expansion behind flag 2023-05-06 18:41:34 +02:00
Andreas Kling f09391dd7f LibWeb: Remove debug spam when creating a dummy formatting context
This will go away when we get rid of the dummy context. There's no value
in spamming the debug console about it.
2023-05-06 18:41:34 +02:00
Andreas Kling ecd3d0935a LibWeb: Re-lookup the intrinsic sizing cache slot after doing the layout
It's not safe to hold on to a pointer to the cache slot across layout
work, since the nested layout may end up causing new entries to get
added to the cache, potentially invalidating a cache slot pointer.
2023-05-06 18:41:34 +02:00
Andreas Kling 134717ec8f LibWeb: VERIFY that nobody tries to hash a non-finite CSSPixels value
Non-finite CSSPixels quantities should never make their way into hash
tables. If this ever happens, let's catch it closer to the source
instead of letting things cascade into confusion.
2023-05-06 18:41:34 +02:00
Karol Kosek 7e4db556eb ThemeEditor: Remove one usage of DeprecatedString
Up until 3d53dc8228, to_string(ColorRole)
returned char*, which prevented us from directly creating a String
class.
2023-05-06 16:12:11 +01:00
Maciej 5d2e915623 LibJS: Guard against stack overflow in ProxyObject set_property()
For similar reason as in the previous commit.
2023-05-06 06:46:02 -07:00
Maciej 52a5a42147 LibJS: Guard against stack overflow in ProxyObject has_property()
If proxy has an undefined trap, it will fallback to target's
internal_has_property, which will then check target's prototype for
the requested property. If Proxy's prototype is set to the Proxy itself,
it will check in itself in a loop, causing a stack overflow.
2023-05-06 06:46:02 -07:00
Cubic Love e7502d4d6d Ports: Update serenity-theming to use the latest commit (f4b6f7f) 2023-05-06 06:43:16 -07:00
Patryk Pilipczuk 90ab011127 WindowServer: Fix window content scaling when switching from fullscreen
Resolves #18624

Switching to and from fullscreen produces a behaviour where window
content too big in relation to window size.

This patch fixes sent resize event to contain current
window size.
2023-05-06 12:24:53 +01:00
Andreas Kling 0eb7c24e7d Ladybird: Stop telling Qt to use HTTP pipelining
For some reason, this was causing incomplete HTTP loads in some cases.
As an example, we would only load half of the "Ahem" CSS font from the
wpt.live server when running Acid3.

I only enabled pipelining in the first place because I assumed it would
be a performance boost, but it appears to do more than that.

I suppose there's a reason it's off by default (and most Qt API users
don't bother enabling it.)
2023-05-06 12:49:12 +02:00
Andreas Kling eff783a6d2 LibWeb: Invalidate style *and* layout when removing a DOM node
It's not enough to invalidate only layout, since changes to the DOM tree
may also cause different selectors to apply.

This brings Acid3 back to a score of 100/100. The problem was that a
:last-child selector wasn't rechecked after removing a node that was
previously the last child of its parent.

Regression from f36cbd3b65.
2023-05-06 10:27:48 +02:00
Annie Song cbdb5f926c Documentation: Correct some typos found in kernel markdown files 2023-05-06 08:01:26 +01:00
Kenneth Myhra 8eaf28b4ce LibGUI: Guard us from trying to slice an empty Arguments::strings
This fixes an issue when we sometime pass in an empty Main::Arguments to
GUI::Application::create().

Also, this mimics the behavior that Application::construct() had which
only iterated over argv when more than one argument was passed to it.
2023-05-06 08:50:12 +02:00
Andreas Kling 1b8788157c LibWeb: Fill PageHost root with document background color
This makes Acid3 have a background color again.

Regressed with f2f14ad9bd.
2023-05-06 08:43:22 +02:00
Sam Atkins f4d8a24fe4 LibWeb: Propagate errors from parse_css_value and property_initial_value 2023-05-06 08:07:28 +02:00
Sam Atkins 294f5b109f LibWeb: Propagate errors from ResolvedCSSStyleDeclaration
Though not from ResolvedCSSStyleDeclaration::property() just yet.
2023-05-06 08:07:28 +02:00
Sam Atkins ba6d37ee6f LibWeb: Propagate errors when parsing StyleValues
This necessitated returning `nullptr` instead of just `{}` in a lot of
places. Also, some temporary hackiness in `parse_css_value()`: That
returns a special `ParseError` type already, so we now have a
`FIXME_TRY()` macro which logs the error and then returns a generic
`ParseError::InternalError` value. Eventually this macro will go away,
once I figure out how to deal with this more nicely.
2023-05-06 08:07:28 +02:00
Sam Atkins d732a83de8 LibWeb: Propagate errors from absolutizing StyleValues 2023-05-06 08:07:28 +02:00
Sam Atkins d16600a48b LibWeb: Propagate errors from StyleValue construction
Turns out we create a lot of these, mostly from places that don't return
ErrorOr. The yak stack grows.
2023-05-06 08:07:28 +02:00
Liav A 36bb04d792 Kernel/Memory: Fix UNMAP_AFTER_INIT page fault handling
This was discovered by me during a work on USB keyboard patches, so it
triggered this bug.

The printing format for the VirtualAddress part is incorrect, leading to
another crash when handling page fault after accessing UNMAP_AFTER_INIT
code section.
2023-05-06 08:03:34 +02:00
MacDue c4ef1db33d LibGUI: Use linear gradient to paint opacity sliders
No need to implement gradients again :^)
2023-05-06 08:03:02 +02:00
MacDue 5f93f62f1c LibGUI: Fix ColorSlider crash when the selected hue is 360
If the ColorSlider returns a hue of 360 degrees one of the various
   `VERIFY(hsv.hue >= 0.0 && hsv.hue < 360.0);`
in Color.h will be hit.
2023-05-06 08:03:02 +02:00
MacDue bd0bf8250e PixelPaint: Use ValueSlider for radial gradient hardness
This makes this input consistent with the hardness properties of other
tools.
2023-05-06 08:03:02 +02:00
Nico Weber 5c002c13c9 LibGfx/WebP: Some steps towards supporting animated webp files
No observable behavior change, but when building with WEBP_DEBUG 1,
this now prints frame data.
2023-05-06 08:01:13 +02:00
Nico Weber 812763e5b9 LibGfx/WebP: Stop dropping ANIM chunk decoding errors
decode_webp_chunks() was already called 5 lines up, no need to do that
again.
2023-05-06 08:01:13 +02:00
Nico Weber 835d328a6c LibGfx/WebP: Check presence of ANMF chunks correctly
Previously, we looked at the wrong variable here.
2023-05-06 08:01:13 +02:00