Commit graph

51398 commits

Author SHA1 Message Date
MacDue
9e57f8d183 LibGfx: Invalidate path bounding boxes when invalidating split lines
If the lines are no longer valid then the bounding box (which is derived
from the lines) is also invalid.
2023-06-17 06:38:32 +02:00
stelar7
4436ab0cb1 LibWeb: Handle calculated vertical-align 2023-06-17 06:33:52 +02:00
kamp
c476ff10a5 LibWeb/CSS: Update Default.css from the HTML specification 2023-06-17 06:31:28 +02:00
Andreas Kling
61148bce5f LibJS/Bytecode: Use the correct this value in GetById
The fix for this was to port the "don't create unnecessary FooObject
for property access on primitives" optimization from Reference,
which also brings us the correct behavior.
2023-06-16 21:46:43 +02:00
Andreas Kling
dbfe1311ef LibJS/Bytecode: Simplify creating/leaving lexical environment
Since we no longer need to create or leave var environments directly
in bytecode, we can streamline the two instructions by making them
always operate on the lexical environment.
2023-06-16 21:46:43 +02:00
Andreas Kling
12ce0789da LibJS/Bytecode: Remove BlockBoundaryType::LeaveVariableEnvironment
We never need to manually exit a var environment from bytecode anymore.
2023-06-16 21:46:43 +02:00
Andreas Kling
ac246d764d LibJS/Bytecode: Leave BlockDeclarationInstantiation in C++
Instead of implementing this AO in bytecode, we now have an instruction
for it that simply invokes the C++ implementation.

This allows us to simplify Bytecode::Generator quite a bit by removing
all the variable scope tracking.
2023-06-16 21:46:43 +02:00
Andreas Kling
4684d3fe54 LibJS: Make BlockDeclarationInstantiation take a VM&
There's no need for this to require an AST Interpreter.
2023-06-16 21:46:43 +02:00
Timothy Flynn
9e95c9892c Ladybird+LibWeb+WebContent: Add context menu controls for muting audio 2023-06-16 19:34:42 +02:00
Timothy Flynn
b3bbdb1e2c Ladybird: Add a context menu for audio elements 2023-06-16 19:34:42 +02:00
Timothy Flynn
14ca04de25 Ladybird+LibWeb+WebContent: Generalize video context menus for all media
The data we want to send out of the WebContent process is identical for
audio and video elements. Rather than just duplicating all of this for
audio, generalize the names used for this IPC for all media elements.

This also encapsulates that data into a struct. This makes adding new
fields to be sent much easier (such as an upcoming field for muting the
element).
2023-06-16 19:34:42 +02:00
Timothy Flynn
e81abbde7b LibWeb: Explicitly set the audio element playback position after seeking
The audio element behaves a bit differently than the video element in
that the audio element drives itself on a timer (as opposed to LibVideo
notifying the video element when a frame is available). So if an audio
element is paused while seeking, we wouldn't receive an updated playback
position until the element is unpaused.

This fixes an issue where you would have to click the play button twice
to re-start an audio track after it reached the end.
2023-06-16 19:34:42 +02:00
Andreas Kling
58478d572f headless-browser: Bump test timeout from 5s to 15s
We're seeing occasional timeouts on the very first test when running
on CI. Let's try giving it more time to see if it goes away. :^)
2023-06-16 17:43:14 +02:00
Andi Gallo
52956d355c LibWeb: Make border-collapse actually inherited
Move it to the inherited section of ComputedValues.
2023-06-16 17:21:15 +02:00
stelar7
5727e276ea LibWeb: Implement CSS exp() 2023-06-16 14:58:47 +01:00
stelar7
6dde49404a LibWeb: Implement CSS log() 2023-06-16 14:58:47 +01:00
stelar7
fa37bb8b76 LibWeb: Implement CSS hypot() 2023-06-16 14:58:47 +01:00
stelar7
0d30fb5a6e LibWeb: Implement CSS sqrt() 2023-06-16 14:58:47 +01:00
stelar7
9aed8ec7f0 LibWeb: Implement CSS pow() 2023-06-16 14:58:47 +01:00
Sam Atkins
8ef25989b6 LibWeb: Parse identifiers last in parse_paint_value()
Previously, using an identifier color like `currentColor` would fail to
parse, since we look at ident tokens (and reject unrecognised ones)
before trying to parse colors.
2023-06-16 15:39:32 +02:00
Andreas Kling
a988241f3f LibWeb: Resolve % min-sizes against 0 while under min-content constraint
When resolving a percentage min-width or min-height size against a
containing block currently under a min-content constraint, we should act
as if the containing block has zero size in that axis.
2023-06-16 14:39:03 +02:00
Andreas Kling
1578121dcb Tests/LibWeb: Fix typo in test
"display: max-content" is not a thing. The test was actually not working
correctly, it just looked like it did. Now it has correct metrics for
the body element.
2023-06-16 14:39:03 +02:00
Andi Gallo
b69036970b LibWeb: Add layout support for border spacing
When border-collapse is separate, border-spacing affects layout.
Implement most of that functionality.
2023-06-16 13:57:31 +02:00
Andi Gallo
396f1a977c LibWeb: Add CSS support for border-spacing property 2023-06-16 13:57:31 +02:00
Timothy Flynn
f662a452c9 LibWeb: Draw a volume scrub bar on media elements to control volume 2023-06-16 13:50:15 +02:00
Timothy Flynn
a4cb3b5d4d LibWeb: Draw a speaker on media elements to toggle muting audio 2023-06-16 13:50:15 +02:00
Timothy Flynn
1107cb58c0 LibWeb: Compute some media timeline rects/sizes before painting anything
The idea here is to let us decide ahead of time what components to paint
depending on the size available. We currently paint each component left-
to-right, until we run out of room. This implicitly gives priority to
the left-most components.

We will soon paint volume controls on the right-side of the timeline.
Subjectively, they should have a higher priority than, say, the timeline
scrubbing bar (i.e. it's more important to be able to mute audio than to
seek). By computing these components before painting, we can more easily
allocate sections to the components in priority order, until the area
remaining has been depleted.
2023-06-16 13:50:15 +02:00
Timothy Flynn
55b61724a0 LibWeb: Handle media elements being painted before their duration is set
It can take some time to download / decode a media resource. During this
time, its duration is set to NaN. The media control box would then have
some odd rendering glitches as it tried to treat NaN as an actual time.
Once we do have a duration, we also must ensure the media control box is
updated.
2023-06-16 13:50:15 +02:00
Timothy Flynn
8cb0197eeb LibWeb: Slightly decrease the font size used for media timestamps
The default scaled font is currently quite large on Ladybird. Decrease
it a bit to make more room for other elements.
2023-06-16 13:50:15 +02:00
Timothy Flynn
54e674974e LibWeb: Use the scaled font size when computing media timestamp width
We draw the text for the timestamp using the scaled font, so we must
also compute its width using the scaled font.
2023-06-16 13:50:15 +02:00
Timothy Flynn
b9e4dc2cb7 LibWeb: Implement the HTMLMediaElement volume and muted IDL attributes 2023-06-16 13:50:15 +02:00
Timothy Flynn
d3b8d88598 LibWeb: Expose volume controls through the platform audio plugin 2023-06-16 13:50:15 +02:00
Andreas Kling
d364d99cb8 LibJS/Bytecode: Perform ToNumeric on accumulator before postfix inc/dec
This ensures we get the expected behavior of code like:

    let a = []
    let b = a++

(Where b should be 0, not [], because JavaScript.)
2023-06-16 12:56:39 +02:00
Andreas Kling
c9bd324369 LibJS/Bytecode: Set "home object" of functions within object expression
We manage this by having a stack of home objects in Generator, and then
adding an optional home object parameter to the NewFunction instruction.
2023-06-16 12:56:39 +02:00
Xuekun Li
a33af174b2 LibGUI: Prevent crashes/hangs when deleting words backwards
When the user hits <Ctrl-Backspace> where the previous content has the
format [Punctuation|Seperator]+ before the cursor, there will be a
size_t index underflow in TextDocument::first_word_break_before,
which returns an invalid word break position with a huge column index
(18446744073709551615, -1 in size_t). The invalid text position later
used for executing RemoveTextCommand will cause a crash.

The while loop condition in TextDocument::first_word_break_before is
not right, the loop will never stop when the target.column() becomes
0 inside.
2023-06-16 08:20:09 +01:00
Andreas Kling
6f39882f11 LibJS/Bytecode: Fix multiple wrong jumps in ForStatement codegen 2023-06-16 08:40:45 +02:00
Andreas Kling
0772a23c65 LibJS/Bytecode: Add "raw" property correctly for tagged template literal
We were adding it to the wrong object before. :^)
2023-06-16 08:40:45 +02:00
Andreas Kling
2ac8a4bbb7 LibJS/Bytecode: Add support for direct eval()
This is implemented as a special mode of the Call opcode that invokes
the PerformEval AO (instead of the Call or Construct AO).
2023-06-16 08:40:45 +02:00
Andreas Kling
8a3e350321 LibJS/Bytecode: Don't choke on MemberExpression with PrivateIdentifier 2023-06-16 08:40:45 +02:00
Andreas Kling
d063f35afd LibJS/Bytecode: Leave GlobalDeclarationInstantiation in C++
Don't try to implement this AO in bytecode. Instead, the bytecode
Interpreter class now has a run() API with the same inputs as the AST
interpreter. It sets up the necessary environments etc, including
invoking the GlobalDeclarationInstantiation AO.
2023-06-16 08:40:45 +02:00
Andreas Kling
32d9c8e3ca LibJS: Make GlobalDeclarationInstantiation take a VM&
This doesn't need to take an AST Interpreter&.
2023-06-16 08:40:45 +02:00
Andreas Kling
872d798951 LibJS/Bytecode: Leave FunctionDeclarationInstantantiation in C++
Instead of trying to implement this AO in bytecode, we can just let it
be a C++ thing. Once we implement fast uncaptured locals, we won't even
be calling it super often.
2023-06-16 08:40:45 +02:00
Tim Ledbetter
17fe2c4822 pkill: Add -O option to filter processes by age
This option allows the user to specify a number of seconds. Only
processes older than the given number of seconds are killed.
2023-06-16 07:22:45 +02:00
Tim Ledbetter
aa79a4ed9a pkill: Add -o option to kill the oldest matching process only 2023-06-16 07:22:45 +02:00
Tim Ledbetter
519893d31f pkill: Add -n option to kill the newest matching process only 2023-06-16 07:22:45 +02:00
Tim Ledbetter
0621a83cb4 pkill: Allow signal names to be used with the -s option 2023-06-16 07:22:45 +02:00
Tim Ledbetter
0d71db6721 pkill: Initialize display_number_of_matches to false
This ensures the number of matches is not displayed when the `-c`
option is not specified.
2023-06-16 07:22:45 +02:00
Sam Atkins
cbf84152df LibWeb: Resolve fill and stroke related CSS properties 2023-06-16 07:03:57 +02:00
Sam Atkins
af51095fe2 LibWeb: Stop making ComputedValues::stroke_width() optional
This defaults to 1px and should always have some kind of value.
2023-06-16 07:03:57 +02:00
Sam Atkins
5cdcd135ab LibWeb: Add parsing for CSS <paint> values
This gets rid of a couple of FIXMEs in Properties.json :^)
2023-06-16 07:03:57 +02:00