Commit Graph

35784 Commits

Author SHA1 Message Date
Tobias Christiansen
ffcc11c31b PixelPaint: Add asymmetric parameters to FastBoxBlur
This allows the user to blur the image not uniformly, but to specify
different radii for the x and y component.
2022-03-17 20:03:05 +01:00
Tobias Christiansen
64cc482f8a LibGfx: Allow for different {x,y}-radii in FastBoxBlurFilter
Use different specified radii for the two seperate passes.

The gaussian approximation is not changed to accept two parameters since
the math is not exactly straight forward and therefore something for a
later patch. For now, let's progress!
2022-03-17 20:03:05 +01:00
Tobias Christiansen
5f063e832e LibGfx: Make FastBoxBlurFilter::apply_single_pass's argument unsigned
It isn't sensible to have a negative radius for blurring, so an unsigned
value is the right thing to do here.
Now we have to cast the radius to int a few times when actually doing
the calculations but I'm sure that can be done more intelligently, but
that optimization is a thing for the future.

It looked very goofy for the two different ways of invoking the Filter
to have differently signed arguments.
2022-03-17 20:03:05 +01:00
Lenny Maiorani
9c56a83b76 Libraries: Use default constructors/destructors in LibGfx
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 17:23:49 +00:00
Lenny Maiorani
c37820b898 Libraries: Use default constructors/destructors in LibWeb
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 17:23:49 +00:00
Timothy Flynn
c0dd188c4d LibTimeZone: Update to TZDB version 2022a
https://mm.icann.org/pipermail/tz-announce/2022-March/000070.html
2022-03-17 16:38:33 +00:00
Maciej
a95794a356 LibGUI: Clamp selection when drag-selecting over out of range area 2022-03-17 17:05:56 +01:00
Maciej
bee9cd2113 LibGUI: Update active glyph when drag-selecting in GlyphMapWidget
This matches behavior of text selecting
2022-03-17 17:05:56 +01:00
Maciej
d3836f982a LibGUI: Use different color for GlyphMapWidget background
This patch makes background a bit darkened so that it is possible to
distinguish out of range area from glyphs that are just not drawn.

The default background color is also changed to Window so that it looks
good in more themes.
2022-03-17 17:05:56 +01:00
Timothy Flynn
157d16f049 LibJS: Update specification steps for RegExp Match Indices
This proposal was implemented in Stage 3 in commit:
6c67de8186

It is now Stage 4 and has been merged into the main ECMA-262 spec:
https://github.com/tc39/ecma262/commit/0209d85
2022-03-17 11:29:51 -04:00
djwisdom
3016ccba18 Base+Fonts: Applied recommended fixes to fonts 2022-03-17 11:07:08 +01:00
djwisdom
d7ba802c81 Base+Fonts: Add Satori Mono and update Satori fonts 2022-03-17 11:07:08 +01:00
Itamar
09bdd844b4 Utilities: Remove redundant program name element in Core::command() call
This removes a redundant program name element from the arguments Vector
in calls to Core::command().

The Shell's argument parsing logic tolerated the extra argument,
until 83609ad.
2022-03-17 12:32:59 +03:30
Itamar
45788d030a HackStudio: Remove program name element in Core::command() calls
Core::command() takes care of inserting the program name as the first
element in argv, and so we shouldn't include the program name in the
argument vector we give it.

The Shell's argument parsing logic tolerated the extra argument,
until 83609ad.

This fixes building serenity components in Hack Studio.
2022-03-17 12:32:59 +03:30
Ali Mohammad Pur
f27c48d707 Meta: Copy wasm results to the right file
Hopefully for the last time, copy the results to the right file.
2022-03-17 11:25:52 +03:30
Lenny Maiorani
190cf1507b Kernel: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 00:51:36 -07:00
Andreas Kling
68f75ab98e LibWeb: :checked should only match inputs in checkbox/radio type state
We were erroneously allowing :checked to match any input element.
2022-03-16 23:29:17 +01:00
Andreas Kling
a403086940 LibWeb: Schedule a relayout after <image> and <object> elements load
Otherwise we'll be stuck with the intrinsic dimensions of the
replacement content.
2022-03-16 23:13:05 +01:00
Andreas Kling
be5f0b5ac4 LibWeb: Move text fragment painting to PaintableWithLines
All the other painting code has moved to paintables already.
2022-03-16 23:13:05 +01:00
Simon Wanner
7969161f07 LibWeb: Implement window.name
Right now the only functionality supported is getting/setting via JS
and resetting when browsing cross origin.

The HTML Specification (7.11 Browsing the web) also specifies how the
name should be restored from history entries, but we don't have those
yet.
2022-03-16 21:49:54 +00:00
Linus Groh
619794dfa7 LibJS: Fix fraction substring in ParseTimeZoneOffsetString
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/97d553c
- https://github.com/tc39/proposal-temporal/commit/d53af7f

Note that we already implemented this correctly, so the only change is
updating the spec comment.
2022-03-16 21:49:38 +00:00
Linus Groh
356fa2dca1 LibJS: Remove unused code in DifferenceISODate
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/056f695
2022-03-16 21:49:38 +00:00
Linus Groh
2ad69d789b LibJS: Remove the ConstrainToRange AO
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/537b3e6
2022-03-16 21:49:38 +00:00
Linus Groh
1521c5f55c LibJS: Remove argument type assertion from ParseTemporalDurationString
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/8615b41
2022-03-16 21:49:38 +00:00
Linus Groh
0c22a7f822 LibJS: Assume Get() on the result of PrepareTemporalFields can't fail
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/980e168
2022-03-16 21:49:38 +00:00
Sam Atkins
7c4402ba92 LibWeb: Evaluate no-preference media-features as false
As noted, this is not 100% to the spec, but effectively the same -
`no-preference` is only allowed to appear in features that evaluate it
as false in a boolean context. This is also the only identifier besides
`none` that evaluates to false. If other identifiers gain this property
in the future, we can make it more robust then.
2022-03-16 22:07:53 +01:00
Sam Atkins
aa48dda3a4 LibWeb: Add missing MEDIAQUERIES-5 media-features
This adds (or at least stubs-out) the following:
- display-mode
- dynamic-range
- environment-blending
- forced-colors
- horizontal-viewport-segments
- vertical-viewport-segments
- inverted-colors
- nav-controls
- prefers-contrast
- prefers-reduced-data
- prefers-reduced-motion
- prefers-reduced-transparency
- scripting
- video-color-gamut
- video-dynamic-range

The `@media (inverted-colors)` CSS that the spec requires we add to the
UA style sheet does not actually do anything for us yet since we don't
support `filter`, but it seemed sensible to include it now to avoid
forgetting later. :^)
2022-03-16 22:07:53 +01:00
Sam Atkins
84a06a1209 LibWeb: Add MEDIAQUERIES-5 identifiers
Sorting the whole list also moved `interlace` by a couple of places.
2022-03-16 22:07:53 +01:00
Tobias Christiansen
e8be8f7b6d PixelPaint: Add Timer for displaying previews of filters
This way the preview image is not generated on _every_ update_preview()
call but rather only if the last update_preview() was longer than 100ms
ago.
When rapidly moving the Slider for large blur values in the
FastBoxBlurFilter with the Gaussian approximation the usage became
noticeably sliggush because we queued a lot of preview generation just
to throw it away immediately. This patch fixes that.
2022-03-16 21:45:31 +01:00
Andreas Kling
d71b0e4638 LibWeb: Don't discard update_style_recursively() return value
This was causing us to miss layout invalidations. With this fixed, we
can remove the invalidation from Element::recompute_style() along with
the associated FIXME.

Thanks to Idan for spotting this! :^)
2022-03-16 21:30:39 +01:00
Andreas Kling
bec0c96aea LibWeb: Mark a bunch of CSS border-* properties as not affecting layout
border*-width and border-collapse affect layout, but all the color,
style and radius ones will only need a repaint if changed. :^)
2022-03-16 21:30:04 +01:00
Simon Wanner
cc77bb5067 LibJS: Relax line and column number restrictions in Error stack tests 2022-03-16 18:55:55 +00:00
Andreas Kling
aaed7b11f8 LibWeb: Mark all text-decoration* CSS properties as not affecting layout 2022-03-16 19:16:45 +01:00
Andreas Kling
ccc37032a4 LibWeb: Don't call establishes_stacking_context() during painting
By the time we're painting, we've already built the stacking context
tree. So instead of asking if a box establishes a stacking context, we
can ask if its paintable *has* a stacking context.

This was taking up ~6% of the profile when mousing around on the HTML
specification. With this change, it disappears completely. :^)
2022-03-16 19:16:45 +01:00
Linus Groh
e31d1620a8 LibPthread: Define SEM_FAILED in semaphore.h
This makes the _multiprocessing module from the Python port build. :^)
2022-03-16 18:03:52 +00:00
Linus Groh
9882848e0b Kernel: Define IF_NAMESIZE in net/if.h
This makes the _socket module from the Python port build. :^)
2022-03-16 18:03:25 +00:00
Andreas Kling
910fded482 LibWeb: Flush any pending layout updates before processing mouse events
We want to make sure the layout and paint trees are up-to-date before
handling any mouse events.
2022-03-16 18:50:56 +01:00
Andreas Kling
0e8b538e0a LibWeb: Invalidate less style when moving between hovered nodes
Instead of invalidating style for the entire document, we now locate the
nearest common ancestor between the old and new innermost hovered node,
and only invalidate that ancestor and its descendants.

This drastically reduces the amount of style update work when mousing
around on GitHub (and any other pages, really.) It's actually really
really snappy now. Very cool! :^)
2022-03-16 18:06:45 +01:00
Andreas Kling
f1711a562a LibWeb: Avoid layout invalidation for some CSS property changes
Use the new CSS::property_affects_layout() helper to figure out if we
actually need to perform a full relayout after recomputing style.

There are three tiers of required invalidation after an element receives
new style: none, repaint only, or full relayout.

This avoids the need to rebuild the layout tree (and perform layout on
it) when trivial properties like "color" etc are changed.
2022-03-16 18:06:45 +01:00
Andreas Kling
275db39c94 LibWeb: Annotate which CSS properties may affect layout
This patch adds CSS::property_affects_layout(PropertyID) which tells us
whether a CSS property would affect layout if it were changed.

This will be used to avoid unnecessary relayout work when something
changes that really only requires us to repaint the page.

To mark a property as not affecting layout, set "affects-layout" to
false in the corresponding Properties.json entry. Note that all
properties affect layout by default.
2022-03-16 18:06:45 +01:00
Andreas Kling
df5c123d8c LibWeb: Schedule a relayout after setting CharacterData.data 2022-03-16 18:06:45 +01:00
Andreas Kling
28721874e8 LibWeb: Schedule a relayout after setting Element.innerHTML 2022-03-16 18:06:45 +01:00
Andreas Kling
a2b9609793 LibGfx: Make FontDatabase API use FlyString for family and variant
This reduces work done by font lookups.
2022-03-16 18:06:45 +01:00
Ali Mohammad Pur
cb6b372a3b Meta: Actually copy the new wasm per-file results after generating them
Otherwise the website data won't be updated.
2022-03-16 20:19:24 +03:30
Lenny Maiorani
5b59375a56 AK: Fix implicit and narrowing conversions in Base64 2022-03-16 16:19:53 +00:00
Lenny Maiorani
8d1d4d4f09 AK: Make static constexpr variables to avoid stack copy in Base64
Alphabet and lookup table are created and copied to the stack on each
call. Create them and store them in static memory.
2022-03-16 16:19:53 +00:00
Lenny Maiorani
d00b79568f Libraries: Use default constructors/destructors in LibJS
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-16 16:19:40 +00:00
Ali Mohammad Pur
07c7827dee Meta: Don't use heredocs as file paths
Heredocs are passed to stdin, so make `jq` read it from stdin instead of
treating it as a file path argument.
2022-03-16 19:48:04 +03:30
Ali Mohammad Pur
c0dbea43f3 Meta: Run Wasm spec tests on master push
...and report the results on libjs-website.
2022-03-16 15:44:52 +00:00
Ali Mohammad Pur
ab55abb0f8 Meta: Enable all wasm extensions when building test suite
...and let LibWasm do the validation instead of removing the test when a
module is invalid.
Also, one of the tests has an integer literal starting with zero, so
account for this to make it not fail :^)
2022-03-16 15:44:52 +00:00