Commit graph

20128 commits

Author SHA1 Message Date
thankyouverycool f7eb72a8be Terminal+LibVT: Toggle TerminalWidget's focus on input preemption
This prevents Terminal's cursor from blinking when a Popup is open.
2022-11-19 16:04:42 +01:00
thankyouverycool 657ff1cd19 LibGUI: Set focus proxy for CommandPalette's TableView 2022-11-19 16:04:42 +01:00
thankyouverycool 3b18226fcb LibGUI: Let Widgets track their focus proxy delegators
And update them on relevant events.
2022-11-19 16:04:42 +01:00
thankyouverycool 4aa608aa71 LibGUI+Taskbar+Applets+Applications: Set various windows as Popups
Makes the Audio applet, Taskbar clock, CommandPalette, EmojiPicker,
and Assistant work as Popup windows. Popups are frameless, unmovable,
and unresizable by default, in addition to their preemptive function.
Also sets Assistant not to obey widget min size so its search result
area resizes correctly
2022-11-19 16:04:42 +01:00
thankyouverycool 24d299c9c8 LibGUI+WindowServer+Applets+Taskbar: Remove active input concepts
and the CaptureInput mode. They are a source of unneeded complexity
in WindowServer and have proven prone to regressions, so this patch
replaces them with a simple input preemption scheme using Popups.

Popup windows now have ergonomics similar to menus: When open,
a popup preempts all mouse and key events for the entire window
stack; however, they are fragile and will close after WindowServer
swallows the first event outside them. This is similar to how combo
box windows and popups work in the classic Windows DE and has the
added benefit of letting the user click anywhere to dismiss a popup
without having to worry about unwanted interactions with other
widgets.
2022-11-19 16:04:42 +01:00
thankyouverycool 35bd79701c WindowServer: Add request_close_fragile_windows() helper 2022-11-19 16:04:42 +01:00
thankyouverycool c23adeaaf7 WindowServer: Add foremost_popup_window() helper 2022-11-19 16:04:42 +01:00
thankyouverycool 3027cf7e99 LibGUI+WindowServer: Remove InputPreemptor concept
This functionality will be superceded by WindowType:Popups
2022-11-19 16:04:42 +01:00
thankyouverycool 5d567565a4 LibGUI+WindowServer: Replace WindowInput{Enter,Leave} Events
with WindowInput{Preempted,Restored} Events and allow Widgets to save
the state of their focus preemption. As of now, only Popups will
preempt input and trigger these events.
2022-11-19 16:04:42 +01:00
thankyouverycool 901878bad9 LibGUI: Use move_cursor() API for AutocompleteProvider
Fixes failure to update focus rect when moving between items.
2022-11-19 16:04:42 +01:00
thankyouverycool 2c58902939 LibGUI: Use WindowType:Autocomplete for AutocompleteProvider
And fix its inability to focus/resize correctly.
2022-11-19 16:04:42 +01:00
thankyouverycool 1718a40ac7 LibGUI+WindowServer: Add WindowType:Autocomplete and helpers 2022-11-19 16:04:42 +01:00
Julian Offenhäuser 0bc3333740 LibPDF: Parse integer numbers with atoi() instead of strtof()
strtof() produces rounding errors for very large numbers, which we
don't want for integers, as they may have to be precise.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser c2ad29c85f LibPDF: Implement png predictor decoding for flate filter
For flate and lzw filters, the data can be transformed by this
predictor function to make it compress better. For us this means that
we have to undo this step in order to get the right result.

Although this feature is meant for images, I found at least a few
documents that use it all over the place, making this step very
important.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser 4bd79338e8 LibPDF: Fix off-by-one error in Reader::remaining() 2022-11-19 15:42:08 +01:00
Julian Offenhäuser 4b1a72ff7a LibPDF: Fix loop condition in parse_xref_stream()
We previously compared two unrelated values to determine if we parsed
the xref table to completion. We now check if we added every subsection
instead, and double check to make sure we never read past the end.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser a17a23a3f0 LibPDF: Make some variable names in parse_xref_stream() more clear
I found these to be a bit misleading.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser f926dfe36b LibPDF: Implement the DCT filter
This filter basically tells us that we are dealing with a JPEG.
Note that by serializing the resulting image we assume that this filter
is the last one in the chain, everything else would be highly unlikely.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser baaf42360e LibPDF: Derive alternate ICC color space from the number of components
We currently don't support ICC color spaces and fall back to a "simple"
one instead.

If no alternative is specified however, we are allowed to pick the
closest match based on the number of color components.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser 16ed407c01 LibPDF: Support cascading stream filters
You can specify multiple filters as an array, where each one is fed the
output of the one before it.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser becd648a78 LibPDF: Parse hexadecimal values in name objects correctly 2022-11-19 15:42:08 +01:00
Julian Offenhäuser 0308300b78 PDFViewer: Take the mousewheel delta into account for scrolling
We now respect the system-wide setting for scroll speed, where we would
previously use a fixed step.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser 9b1331a984 PDFViewer: Simplify user-facing error messages
We now show a simple, if less helpful, message to the user and print
the verbose error message to serial instead.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser e782d03f96 PDFViewer: Invalidate document when a page fails to load
This fixes an issue where we would show an error message on every
subsequent paint event, making it impossible to close or use the
application further.

Some more architectural work is needed if we want to invalidate the
sidebar entries as well.
2022-11-19 15:42:08 +01:00
thankyouverycool ef30073127 LibGUI: Let Delete remove selections greater than 1 in GlyphMapWidget
Updates keydown_event() to work with the new bubbling mechanism
for action shortcuts.
2022-11-19 15:41:09 +01:00
thankyouverycool 92a75ccaed FontEditor: Include file basename in error messages when available
And write messages in the [action] failed: [error] format to match
common error message formatting elsewhere in Userland.
2022-11-19 15:41:09 +01:00
thankyouverycool 9725fd162f LibGUI+Applications: Allow GlyphMapWidget's set_font() to fail
And TRY early during initialization in FontEditor to leave the app
in a valid state on error. Fixes OOM crashes when cloning the original
font for highlight modifications.
2022-11-19 15:41:09 +01:00
thankyouverycool 1be830e3c6 LibGfx: Add pure virtual fallible clone() for Fonts 2022-11-19 15:41:09 +01:00
thankyouverycool d9fb838cf6 LibGUI+FontEditor: Allow system emoji to be toggled in GlyphMapWidget
And remove their red backgrounds when visible to not be confused with
deletion highlights.
2022-11-19 15:41:09 +01:00
thankyouverycool c974e644ec FontEditor: Add Layout options to View menu
Like other apps, FontEditor now organizes widget visibility toggles
under a View->Layout submenu. The main toolbar and the status bar
can now be turned on and off.
2022-11-19 15:41:09 +01:00
thankyouverycool 61d93092cf FontEditor: Remove redundant set_scale() helper 2022-11-19 15:41:09 +01:00
thankyouverycool 8f7dbf363e FontEditor: Remove overzealous find-and-replace ""sv operator 2022-11-19 15:41:09 +01:00
thankyouverycool 894b41ef4d FontEditor: Consolidate GlyphEditor's flip_{horizontally,vertically} 2022-11-19 15:41:09 +01:00
thankyouverycool d867871bda FontEditor: Standardize Gfx::RotationDirections for rotate_90() 2022-11-19 15:41:09 +01:00
Andreas Kling fb00d3ed25 Kernel+lsirq: Track per-CPU IRQ handler call counts
Each GenericInterruptHandler now tracks the number of calls that each
CPU has serviced.

This takes care of a FIXME in the /sys/kernel/interrupts generator.

Also, the lsirq command line tool now displays per-CPU call counts.
2022-11-19 15:39:30 +01:00
MacDue 8a5d2be617 Everywhere: Remove unnecessary mutable attributes from lambdas
These lambdas were marked mutable as they captured a Ptr wrapper
class by value, which then only returned const-qualified references
to the value they point from the previous const pointer operators.

Nothing is actually mutating in the lambdas state here, and now
that the Ptr operators don't add extra const qualifiers these
can be removed.
2022-11-19 14:37:31 +00:00
MacDue 66a428ae03 LibJS+LibWeb: Return non-const types from Ptr class operators
Even if the pointer value is const, the value they point to is not
necessarily const, so these functions should not add the qualifier.

This also removes the redundant non-const implementations of these
operators.
2022-11-19 14:37:31 +00:00
Jamie Mansfield 24caacfe28 LibJS: Add spec comments to TypedArray.prototype.entries 2022-11-19 14:23:28 +00:00
Jamie Mansfield 67ed3e1d93 LibJS: Add spec comments to TypedArray.prototype.keys 2022-11-19 14:23:28 +00:00
Jamie Mansfield db00097700 LibJS: Match spec behaviour in TypedArray.prototype.join
This corrects 2 TRYs to MUSTs and a replaces a call to is_nullish to
is_undefined.
2022-11-19 14:23:28 +00:00
Jamie Mansfield 5341af6225 LibJS: Add spec comments to TypedArray.prototype.join 2022-11-19 14:23:28 +00:00
Jamie Mansfield 70a4e4bd67 LibJS: Add missing assert to TypedArray.prototype.indexOf 2022-11-19 14:23:28 +00:00
Jamie Mansfield 80d2d3812a LibJS: Add spec comments to TypedArray.prototype.indexOf 2022-11-19 14:23:28 +00:00
Jamie Mansfield f1b4412005 LibJS: Add missing assert to TypedArray.prototype.includes 2022-11-19 14:23:28 +00:00
Jamie Mansfield 34f27f76ec LibJS: Add spec comments to TypedArray.prototype.includes 2022-11-19 14:23:28 +00:00
Jamie Mansfield 43456ad708 LibJS: Add spec comments to TypedArray.prototype.reduceRight 2022-11-19 14:23:28 +00:00
Jamie Mansfield 364d873e33 LibJS: Add spec comments to TypedArray.prototype.reduce 2022-11-19 14:23:28 +00:00
Jamie Mansfield d7654aebd7 LibJS: Match spec behaviour in TypedArray.prototype.fill
This just replaces an instance where TRY was used when MUST should
have been, reflecting the difference between ? and ! in the spec.
2022-11-19 14:23:28 +00:00
Jamie Mansfield d492887dcd LibJS: Add spec comments to TypedArray.prototype.fill 2022-11-19 14:23:28 +00:00
Andreas Kling 524baa29e8 LibC+Tests: Simplify getpwuid_r() and getpwnam_r() and add tests
These functions are now implemented in terms of getpwent_r() which
allows us to remove two FIXMEs about global variable shenanigans.

I'm also adding tests for both APIs. :^)
2022-11-19 11:11:13 +01:00
Andreas Kling cc189ce0f3 LibC: Make getpwent_r() behave more like glibc
Two things:
- We now fail with ENOENT when we reach the end of the database.
- Errors are returned directly instead of via errno.
2022-11-19 11:11:13 +01:00
Julian Offenhäuser 7c4f5b58be LibPDF: Use Gfx::PathRasterizer for Adobe Type 1 font rendering
This gives much better visual results than painting the path directly.
It also has the nice side effect that Type 1 fonts will now look much
more similar to TrueType fonts, which use the same class :^)

In addition, we can now cache glyph bitmaps for repeated use.
2022-11-19 11:04:34 +01:00
Julian Offenhäuser 0b6299849e LibGfx: Move TTF::Rasterizer to its own files
The custom TTF path rasterizer is actually generic enough for it to be
used for other fonts. To make this more clear, it now lives on its own
in the "Font" directory.
2022-11-19 11:04:34 +01:00
thankyouverycool d444724d24 ThemeEditor: Update GML and polish interface
Registers the PreviewWidget for addition directly into GML. Fixes
its previous double Frame borders. Also standardizes the Apply and
Reset buttons as DialogButtons and spaces them consistently with
other apps. Gives the TabWidget some tasteful container margins.
2022-11-19 11:04:11 +01:00
thankyouverycool e99277611b Magnifier+ThemeEditor: Use CommonMenus::make_accessibility_menu() 2022-11-19 11:04:11 +01:00
thankyouverycool f31a56d086 LibGUI: Add CommonMenus
Right now only the accessibility menu is shared across apps but
it's a good bit of boilerplate that can be consolidated and will
make adding ColorBlindnessFilters to other widgets trivial.
2022-11-19 11:04:11 +01:00
thankyouverycool 7252a1aa4d LibGUI: Add fallible try_create_checkable() Action 2022-11-19 11:04:11 +01:00
thankyouverycool 032ca748c6 LibGUI: Add ColorFilterer class
Widgets will inherit from ColorFilterer in order to create the
accessibility CommonMenu
2022-11-19 11:04:11 +01:00
thankyouverycool c88d77361c LibGUI: Allow adding previously constructed menus to Menubar 2022-11-19 11:04:11 +01:00
thankyouverycool 9cf93528f5 LibGUI: Accept() mouse wheel events in {Spin,Combo}Boxes
Prevents ScrollableContainerWidgets from moving when changing
values in embedded widgets with the mouse wheel.
2022-11-19 11:04:11 +01:00
thankyouverycool 5c9a140084 LibGUI: Display shortcut text for Alt Graph modifier
Fixes Accessibility menus in ThemeEditor and Magnifier not showing
their complete shortcut combinations
2022-11-19 11:04:11 +01:00
Jamie Mansfield 8363225320 LibJS: Validate TypedArray when calling TypedArray.prototype.values 2022-11-18 17:14:55 +00:00
Jamie Mansfield 1eb15cbaf4 LibJS: Add spec comments to %TypedArray%.prototype.values 2022-11-18 17:14:55 +00:00
Timothy Flynn fa2579ffa9 LibWeb: Implement most of WebDriver capability matching
We don't completely implement version matching, and currently ignore the
"proxy" capability.
2022-11-18 15:30:29 +00:00
Timothy Flynn 021eb04640 LibWeb: Extract out the User-Agent browser name and version
This way we can re-use these elsewhere, and if they ever change again,
those other uses will get updated automatically.
2022-11-18 15:30:29 +00:00
Timothy Flynn 7398fd107c WebContent: Add missing user prompt handling steps
The text on these steps is slightly different than when this was also
done in 0e94904034, so these were missed.
2022-11-18 12:21:57 +00:00
Timothy Flynn 37c4bf3afd WebDriver: Implement all modes for handling the current user prompt 2022-11-18 12:21:57 +00:00
Timothy Flynn adc7977ec7 WebContent+WebDriver: Send the parsed capabilities over to WebContent 2022-11-18 12:21:57 +00:00
Timothy Flynn e0c7b5747d LibWeb+WebDriver: Begin processing and matching WebDriver capabilities
Still some TODOs here:
* We don't handle all capabilities (e.g. proxy)
* We don't match the capabilities against the running browser

But this will parse the capabilities JSON object received from the
WebDriver client.
2022-11-18 12:21:57 +00:00
Timothy Flynn 5b5b563968 LibWeb: Do not reject valid WebDriver script timeouts
The spec's text is pretty awkward here, but the way we've currently
transcribed it to C++ means we reject valid script timeouts. This meant
the following would fail:

    TimeoutsConfiguration config {}; // Default values.
    auto json = timeouts_object(config);
    config = TRY(json_deserialize_as_a_timeouts_configuration(json));
2022-11-18 12:21:57 +00:00
MacDue 862320828f LibWeb: Fix clicking on links
Since ff2f31b LibWeb has segfaulted when clicking on links, as the
browsing context (a GCPtr) in the lambda was captured by reference
and was out of scope by the time the callback fired.
2022-11-18 10:08:43 +00:00
Ali Mohammad Pur 253f4de302 LibRegex: Use spans<4> to avoid allocating small vectors
This path is hit a lot, and alloc/free of this vector was showing up on
profiles, so get rid of it.
2022-11-17 20:13:04 +03:30
Ali Mohammad Pur f1851346d3 LibRegex: Use a copy-on-write vector for fork state 2022-11-17 20:13:04 +03:30
Ali Mohammad Pur cfcd6e770c LibRegex: Don't copy forked results twice 2022-11-17 20:13:04 +03:30
Ali Mohammad Pur 464ac85a1b LibRegex: Avoid copying MatchInput when getting argument descriptions 2022-11-17 20:13:04 +03:30
davidot 73fcbbb0ee LibJS: Give the undeclared private identifier error more precedence
Before this could give the `must be followed by in` error before the
undeclared private identifier error. Fixing the `in` error would not
have resolved the other error so this order makes the errors more
actionable.
2022-11-17 16:05:20 +00:00
davidot 16ac43c9d4 LibJS: Make sure private identifier is valid in optional chain
If we don't check that a private identifier is valid this can break the
assumption that we have a private environment when evaluation the
private identifier. Also an unknown private identifier this should
be a SyntaxError.
2022-11-17 16:05:20 +00:00
davidot 49fc0e2514 LibJS: Add space in output of toEval in test-common.js 2022-11-17 16:05:20 +00:00
davidot 8fa6861f66 LibJS: Initialize functions in spec order
This is only visible with something like `Object.getOwnPropertyNames` on
the global object. All other declaration instantiations put the
functions on an environment making the order invisible.
Note that spec order is not quite tree order as in non-strict mode
functions which get hoisted out of blocks appear before top level
functions.

Co-authored-by: Hendiadyoin1 <leon.a@serenityos.org>
2022-11-17 16:05:20 +00:00
davidot 5ca6e8dca8 LibJS: No longer hoist if parent scope has a function with the same name 2022-11-17 16:05:20 +00:00
davidot 54b2d8c1b8 LibJS: Reuse as_i32 in as_double in JS::Value
Since this might be complicated with NaN boxing keeping it as one
implementation makes this easier to check and change.
2022-11-17 16:05:20 +00:00
davidot 2e24ee49aa LibTest: Fail if the top-level result of running a JS file is an error
Before putting `throw 1;` in a test file did not fail the file, and it
ignored the rest of the file. Now we check the resulting completion from
run and fail if that is an error.
2022-11-17 16:05:20 +00:00
Timothy Flynn f7bb835d09 LibWeb+LibWebView+WebContent+WebDriver: Implement Send Alert Text 2022-11-16 17:23:56 +00:00
Timothy Flynn f9b8742fff LibWeb+WebContent+WebDriver: Implement Get Alert Text 2022-11-16 17:23:56 +00:00
Timothy Flynn 3e7d633954 LibWeb+WebContent+WebDriver: Implement Accept Alert 2022-11-16 17:23:56 +00:00
Timothy Flynn 7cf2feb047 LibWeb+WebContent+WebDriver: Implement Dismiss Alert 2022-11-16 17:23:56 +00:00
Timothy Flynn 159dcb9507 LibWeb: Fix typo in WebDriver section comment 2022-11-16 17:23:56 +00:00
Timothy Flynn 0e94904034 LibWebView+WebContent: Begin handling open user dialogs for WebDriver
The way in which dialogs should be handled is configurable by the driver
capabilities object, which we don't support yet. So this implements just
the default mode to dismiss the dialog and return an error if there is
one open.

In the OOPWV, this means we need to refer to the dialog after it has
been open, so we now hold a pointer to whatever dialog is open.
2022-11-16 17:23:56 +00:00
Timothy Flynn 5b31a3dbc7 LibGUI: Allow more programmatic control over GUI::InputBox
This will be needed for WebDriver, which will require constructing and
controlling dialogs manually. Currently, InputBox will only set its text
value when the OK button is pressed. This changes InputBox to update its
text when done(ExecResult::OK) is invoked in any way.

This also makes the text_value() method public, allows for setting the
text value, and allows for moving-in the initial text value.
2022-11-16 17:23:56 +00:00
Timothy Flynn db4fa36b58 LibGUI: Add GUI::Dialog to the LibGUI forwarding header 2022-11-16 17:23:56 +00:00
Timothy Flynn 364f44d7d8 LibWebView+WebContent: Wait for dialog responses without blocking IPC
Currently, the WebContent process is completely blocked while waiting
for a response to a dialog request. This patch allows the IPC event loop
to continue executing while only blocking the HTML event loop.

This will allow other processes like WebDriver to continue to operate on
the WebContent process while a dialog is open.
2022-11-16 17:23:56 +00:00
Timothy Flynn 4b8729aea6 LibWeb: Add a flag to pause an HTML event loop's execution
This will be used to unblock the WebContent IPC event loop while waiting
for a dialog response.
2022-11-16 17:23:56 +00:00
Andreas Kling 4aeb1ffc12 LibWeb: Add naive layout for SVG foreign objects
We now layout foreign objects as if they form a nested block formatting
context. This probably isn't the most correct way to do this, but it's
a start.
2022-11-16 13:01:21 +01:00
Andreas Kling 0555684682 LibWeb: Sketch out basic support for SVG <foreignObject> elements
This patch adds basic DOM construction and IDL bindings for foreign
objects in SVG trees.
2022-11-16 13:01:21 +01:00
Andreas Kling e9eba66361 LibWeb: Adjust foreignobject to foreignObject in HTML parser
This conversion was missing from the table we copied from the spec
for whatever reason.
2022-11-16 13:01:21 +01:00
Aliaksandr Kalenik 1b5b7e3b01 LibWeb: Solve width for absolute positioned elemenent according to spec
https://www.w3.org/TR/css-position-3/#abs-non-replaced-width
If left and width are auto and right is not auto, then
the width is shrink-to-fit. Then solve for left.
2022-11-16 03:10:26 +01:00
martinfalisse 35094fc744 LibWeb: Make auto-fit compatible with grid-gap
This fixes an error when using auto-fit with grid-gap, as previously
were not taking into account the fact that more columns had been added
to the grid yet the occupation grid had not grown.
2022-11-16 00:53:00 +01:00
martinfalisse 4b6534a26d LibWeb: Use fixed-size tracks for grid gap
Previously were incorrectly initializing the grid gap tracks as were
using the GridSize float constructor, which creates a flexible length.
What is actually wanted is a fixed-size track of a certain size,
indicated in pixels.
2022-11-16 00:53:00 +01:00
Torstennator b2a6066042 LibGfx: Optimize anti-aliased line drawing and stroking
This patch optimizes the drawing of aa-lines by rotating the drawn
rectangle to the direction where the line points. That enables us to
draw non-straight lines with the proper width.
If a aa-line is drawn that is infact a straigt line we now dont plot
those lines with multipe rectangles across the line - insted we draw
straight lines in one go with just one rectangle of proper size.
Stroking of lines has been enhanced to take care of the edges between
two lines with drawing the stroke till the intersections of two
connected lines.
2022-11-15 22:59:25 +01:00
Torstennator 7c09d7c52f LibWeb: Change SVGContext initial fill_color to transparent
This patch changes the initialization of the fill_color of an SVGContext
to transparent instead of black to not draw a black filling if the
elements fill_color is defined as "none".
2022-11-15 22:59:25 +01:00
Aliaksandr Kalenik adf0262b54 LubWeb: Call before_children_paint for positioned descendants
Add before_children_paint and after_children_paint calls for
positioned descendants with z-index: auto during painting
2022-11-15 22:53:47 +01:00
Aliaksandr Kalenik f3d57e1157 LibWeb: Clip hidden overflow by absolute rect of containing block
Since handling overflow: hidden in PaintableBox::before_children_paint
while following paint traversal order can't result in correctly computed
clip rectangle for elements that create their own stacking context
(because before_children_paint is called only for parent but overflow:
hidden can be set somewhere deeper but not in direct ancestor), here
introduced new function PaintableBox::clip_rect() that computes clip
rectangle by looking into containing block.

should_clip_overflow flag that disables clip for absolutely positioned
elements in before_children_paint and after_children_paint is removed
because after changing clip rectangle to be computed from not parent
but containing block it is not needed anymore (absolutely positioned
item is clipped if it's containing block has hidden overflow)
2022-11-15 22:53:47 +01:00
Aliaksandr Kalenik c1401b37c4 LibWeb: Join out-of-flow block nodes in last parent child if possible
Join out-of-flow block nodes into last child of parent node if last
child has inline children.
2022-11-15 22:52:08 +01:00
Idan Horowitz 43c5b94ea6 LibWeb: Implement document.open(string, string, string) 2022-11-15 21:48:19 +00:00
Idan Horowitz a63c7549e1 LibWeb: Implement window.open
This implementation is some-what complete, with the most common missing
/broken feature being opening pages in new tabs using the "_blank"
target.

This is currently broken due to 2 reasons:
 - We currently always claim the Window does not have transient
   activation, as we do not track the transient activation timestamp
   yet. This means that all such window.open calls are detected as
   pop-ups, and as such they are blocked. This can be easily bypassed
   by unchecking the 'Block Pop-ups' checkbox in the debug menu.
 - There is currently no mechanism for the WebContent process to
   request a new tab to be created by the Browser process, and as
   such the call to BrowsingContext::choose_a_browsing_context does not
   actually open another tab.
2022-11-15 21:48:19 +00:00
Idan Horowitz d15d7636e5 LibWeb: Add window.open feature detection abstract operations 2022-11-15 21:48:19 +00:00
Idan Horowitz 798d7c6fae LibWeb: Add 'should block pop ups' user config to Page
This will also be used by the window.open algorithm steps.
2022-11-15 21:48:19 +00:00
Idan Horowitz ff2f31bc81 LibWeb: Bring BrowsingContext::choose_a_browsing_context closer to spec 2022-11-15 21:48:19 +00:00
Idan Horowitz c948873c5b LibWeb: Add the 'opener browsing context' BrowsingContext property
This will also be used by the window.open algorithm steps.
2022-11-15 21:48:19 +00:00
Idan Horowitz b27f855107 LibWeb: Add the 'is popup' BrowsingContext property
This will also be used by the window.open algorithm steps.
2022-11-15 21:48:19 +00:00
Idan Horowitz efe94d9040 LibWeb: Support parsing a URL relative to environment settings object 2022-11-15 21:48:19 +00:00
Idan Horowitz f69c135796 LibWeb: Implement the 'Entry Realm/{settings,global} object' concepts 2022-11-15 21:48:19 +00:00
Idan Horowitz c9f9fcd8fd LibWeb: Remove accidentally commited dbglns 2022-11-15 21:48:19 +00:00
Timothy Flynn 4fd9e3ab08 Userland: Remove workarounds for LibIPC include order sensitivity 2022-11-15 13:25:51 -05:00
Timothy Flynn 05f41382bb Userland: Properly define IPC::encode and IPC::decode specializations
In order to avoid the base encode/decode methods from being used (and
failing a static assertion), we must be sure to declare/define the
custom type implementations as template specializations.

After this, LibIPC is no longer sensitive to include order.
2022-11-15 13:25:51 -05:00
Timothy Flynn b1ea418d14 LibIPC: Forward declare the encode() and decode() template functions
For the most part, we try to provide specializations of these functions
in various headers by including "LibIPC/Forward.h" and then declaring
encode() and decode() specializations. However, without any forward
declaration of these types, we aren't actually specializing anything.
Rather, we are just declaring overloads, which trips up the base encode
and decode template definitions.

The result is that LibIPC is very sensitive to include order, and the
DependentFalse<> static assertion would fail if the includes weren't
perfectly ordered.

By properly forward declaring these templates, we can make sure the
specializations receive precedence over the base templates.
2022-11-15 13:25:51 -05:00
Timothy Flynn 421ebc2e29 LibJS: Remove workaround for Clang misalignment in MathematicalValue
As noted in 269a931, this has been fixed in Clang 15.
2022-11-15 12:30:16 +00:00
davidot 67865306d3 LibJS: Fix that functions in module did not look for var declarations 2022-11-15 12:00:36 +00:00
davidot 385c2f2eb8 LibJS: Use correct this value for tagged template calls
This has to get quite messy because we currently do evaluation to value
and reference separately meaning we have to deal with a lot of edge
cases here.
2022-11-15 12:00:36 +00:00
davidot b3edd94869 LibJS: Treat '\\' as an escaped character in template literals
Before this change we would ignore that the second backslash is escaped
and template strings ending with ` \\` would be unterminated as the
second slash was used to escape the closing quote.
2022-11-15 12:00:36 +00:00
Timothy Flynn 8e624c8f6d LibWeb+WebContent+WebDriver: Implement Find Elements From Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn 6d9bd04233 LibWeb+WebContent+WebDriver: Implement Find Element From Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn 4d9fd5d190 LibWeb+WebContent+WebDriver: Implement Get Element Shadow Root 2022-11-15 11:55:36 +00:00
Timothy Flynn cb91e6067c LibWeb+WebContent+WebDriver: Implement Get Active Element
Unfortunately, nothing ever calls DOM::Document::set_active_element at
the moment, so this will always return ErrorCode::NoSuchElement.
2022-11-15 11:55:36 +00:00
Itamar 8d65df935e LibWeb: Handle inset properties in style_value_for_property()
This adds support for the Top, Right, Bottom and Left CSS properties
in style_value_for_property().
2022-11-14 21:22:27 +00:00
Timothy Flynn 826d5f8f9a WebContent+WebDriver: Move Window commands to WebContent
This moves Get Window Handle, Close Window, and Get Window Handles over
to WebContent so they may be implemented closer to the spec and be used
by Ladybird.
2022-11-14 13:43:24 -05:00
Timothy Flynn be50806a18 WebDriver: Remove "Services/" prefix from local WebDriver includes
This is to allow building some of these files from Ladybird. The Build
directory for Ladybird does not include the "Services/" path.
2022-11-14 13:43:24 -05:00
Timothy Flynn 4d4ed96fa1 WebContent: Provide access to ConnectionFromClient's PageHost
This is needed to construct a WebDriverConnection from outside of
PageHost itself in Ladybird.
2022-11-14 13:43:24 -05:00
Timothy Flynn d2b2d3ad80 WebContent: Allow creating a WebDriverConnection with an existing socket
The socket used by WebDriverConnection will be created separately for
Ladybird.
2022-11-14 13:43:24 -05:00
Timothy Flynn b00d77eac8 LibCore: Invoke forward from the global namespace inside C_OBJECT
If a class defines a method named `forward` itself, the compiler isn't
able to differentiate between that method and (std::)forward.
2022-11-14 13:43:24 -05:00
Timothy Flynn fb83ceaf57 LibCore: Allow TCPServer's port to be reused after it exits
This hasn't been an issue on Serenity, but on Linux, if a program opens
a TCPServer on some port and then exits, that program can't be re-run
until the OS makes the port available again. This is usually ~2x the TCP
socket's maximum segment lifetime, upwards of a minute.

Add an option to TCPServer to allow re-using the port after the program
exits.
2022-11-14 13:43:24 -05:00
Aliaksandr Kalenik 2675b9390b LibWeb: Parse unknown media type in media queries
Prevent media query parser from falling back into
MediaQuery::create_not_all() for queries with unknown media type.
With this change following test works correctly:
http://wpt.live/css/css-conditional/at-media-001.html
2022-11-14 16:08:35 +00:00
Aliaksandr Kalenik 7f527ddde3 LibWeb: Support device-height and device-width media query values 2022-11-14 16:08:35 +00:00
Zaggy1024 52a5da51bf LibVT: Make shortcuts propagate completely before terminal input
This allows shorcuts to be used in the Terminal app rather than
processing the terminal input first and ignoring shortcuts after.
2022-11-14 16:08:11 +00:00
Zaggy1024 a9bc626639 2048: Call event.ignore() correctly in 2048's BoardView keydown handler 2022-11-14 16:08:11 +00:00
Zaggy1024 66b15e6cd6 KeyboardMapper: Call event.ignore() on keydown in the main widget 2022-11-14 16:08:11 +00:00
Zaggy1024 76627ec0a2 HexEditor: Allow keydown events to propagate if they are not handled 2022-11-14 16:08:11 +00:00
Zaggy1024 7ce346e50e PixelPaint: Allow keydown events to bubble from ImageEditor
Previously, all keydown KeyEvents were accepted, causing parent widgets
not to receive them. With the addition of shortcut handling to keydown,
shortcuts were not called when the ImageEditor was focused.
2022-11-14 16:08:11 +00:00
Zaggy1024 967dfa7956 LibGUI: Handle Action keyboard shortcuts in Widget keydown
Widgets can now prevent shortcut Actions from being called, which
allows text input keydown handlers to override single key shortcuts.
2022-11-14 16:08:11 +00:00
Zaggy1024 8e7c7e0a2a LibGUI: Share code for finding an Action by Shortcut
This moves logic for finding a shortcut on a Window or Widget to
Action::find_action_for_shortcut instead.
2022-11-14 16:08:11 +00:00
Samuel Bowman d947555527 Taskbar: Support launching apps that require root
If an app file has RequiresRoot=true, launch the app with the requsite
setuid binary. For GUI apps, this is Escalator. For app files with
RunInTerminal=true, this is pls.
2022-11-14 14:58:10 +00:00
Eli Youngs 1b4ebcaa0c hexdump: Support truncating output with -n 2022-11-14 14:54:45 +00:00
Eli Youngs ae68def54b hexdump: Pledge stdio and rpath 2022-11-14 14:54:45 +00:00
Aliaksandr Kalenik 93238edf8f LibWeb: Respect media attribute of style tag 2022-11-14 14:47:37 +00:00
Eli Youngs bd4bb4fd51 seq: Fix clang-tidy warnings 2022-11-14 14:38:23 +00:00
Eli Youngs f05ec0da53 seq: Add the --terminator option 2022-11-14 14:38:23 +00:00
Eli Youngs 956ef0c9fd seq: Add the --separator option 2022-11-14 14:38:23 +00:00
Eli Youngs d16fa32674 seq: Interpret parameters with ArgsParser 2022-11-14 14:38:23 +00:00
Zaggy1024 87aed17a46 VideoPlayer: Make PlaybackManager use OwnPtr
VideoPlayerWidget was keeping a reference to PlaybackManager when
changing files, so the old and new managers would both send frames to
be presented at the same time, causing it to flicker back and forth
between the two videos. However, PlaybackManager no longer relies on
event bubbling to pass events to its parent. By changing it to send
events directly to an Object, it can avoid being ref counted, so that
it will get destroyed with its containing object and stop sending
events.
2022-11-14 10:05:56 +00:00
Andrew Kaster 5925d3b26b Browser: Remove unused WebDriverSessionServer.ipc
This was missed in 7972916be7
2022-11-14 10:01:44 +00:00
Linus Groh 93c0c73b9e LibWeb: Implement XMLHttpRequest.withCredentials 2022-11-14 10:00:11 +00:00
Linus Groh bfa378660b LibWeb: Add a clarifying comment to XHR::m_response_object
Trying to change this to a JS::Object didn't quite work, so let's add
a helpful comment instead.
2022-11-14 10:00:11 +00:00
Linus Groh fb57500394 LibWeb: Use HeaderList from Fetch for XHR author request headers 2022-11-14 10:00:11 +00:00
Linus Groh c8184d85c1 LibWeb: Rename XHR::{m_request_headers => m_author_request_headers} 2022-11-14 10:00:11 +00:00
Linus Groh 6e53dd8767 LibWeb: Rename XHR::{m_url => m_request_url} 2022-11-14 10:00:11 +00:00
Linus Groh 29a8414a05 LibWeb: Rename XHR::{m_method => m_request_method} 2022-11-14 10:00:11 +00:00
Linus Groh 338ada66fa LibWeb: Add spec comments and links to XHR members 2022-11-14 10:00:11 +00:00
Linus Groh 04eaff3bb4 LibWeb: Rename XHR's ReadyState / m_ready_state to just State / m_state
This is what the spec calls it.
2022-11-14 10:00:11 +00:00
Lucas CHOLLET 7649feb26f SoundPlayer: Load cover image from music files
When the visualization is set to "Album Cover", the player will now try
to load the embedded image. On failure, it defaults to a "Cover" image
file in the directory.

In Player::play_file_path, file_name_changed now needs to be executed
after that the loader have been set, to get the correct image.
2022-11-13 18:51:18 -07:00
Lucas CHOLLET 27539440df LibAudio: Make FlacLoaderPlugin destructor virtual 2022-11-13 18:51:18 -07:00
Lucas CHOLLET 2ddcfcb00f LibAudio: Parse the picture metadata block 2022-11-13 18:51:18 -07:00
Lucas CHOLLET db40a514f5 LibCore: Allow MemoryStream::seek to go to EOF
The method still prevents you to go out of bound.
2022-11-13 18:51:18 -07:00
Lucas CHOLLET 706638a0d0 LibAudio: Explicitly support Application metadata block type 2022-11-13 18:51:18 -07:00
Lucas CHOLLET 95968705ce LibAudio: Explicitly support Padding metadata block type 2022-11-13 18:51:18 -07:00
Julian Offenhäuser 8fd4e2ee40 LibGfx: Don't require the OS/2 table for ttf files
This table seems to only exist for OpenType compatibility. There are
some font files, including most embedded fonts in PDF documents, that
don't include one.

For those cases, we now just zero-initialize one to the largest
supported size.
2022-11-13 18:20:45 -07:00
Julian Offenhäuser 703b85b916 LibGfx: Make the ttf parser recognize files with the "true" tag 2022-11-13 18:20:45 -07:00
Alec Murphy c2f3dead91 WindowServer: Update alt shortcuts for menu items when text changes
WindowServer: Make CI happy :^)
2022-11-13 18:13:17 -07:00
ne0ndrag0n 9ddb86f7db LibCore: Add query for all accounts and groups 2022-11-13 17:49:03 -07:00
implicitfield 58e9262ff1 LibArchive: Make get_field_as_integral error out on non-octal input
Fixes this bug that was reported by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52493
2022-11-13 17:37:26 -07:00
implicitfield c88d8a21cc LibArchive: Make TarInputStream::advance report errors
Fixes this bug that was reported by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52862
2022-11-13 17:37:26 -07:00
Julian Eigmüller 26a4327b06 LibC: Implement getpass()
This function is a deprecated POSIX function which prints a prompt and
receives a password from the user, not echoing back to the terminal.
2022-11-13 17:29:27 -07:00
Timothy Flynn 9fbc4138bb LibWeb: Define the route for the Fullscreen Window command
This was missed in 4eefa292df.
2022-11-14 00:05:15 +00:00
Moustafa Raafat 6ff9a88c3b LibWeb: Support animated backgrounds 2022-11-13 16:53:22 -07:00
Igor Pissolati bfdb30c74a LibWeb: Implement bare-bones HTMLElement.dir 2022-11-13 16:37:09 -07:00
Igor Pissolati de494ccf38 LibWeb: Implement window.location.origin 2022-11-13 16:37:09 -07:00
Karol Kosek 0b7f5bbdfb Userland: Accept drag_enter events for widgets supporting file drops
This patch will switch cursor to DragCopy when a user enters a widget
while dragging file(s), giving them a visual clue that it *might* be
dropped into this widget.

This is a rather naive approach, as the cursor icon will change for any
kind of file, as currently programs don't know the drag contents before
dropping it. But after all I think it's better than nothing. :^)
2022-11-13 16:13:03 -07:00
Timothy Slater 461ee18d64 PixelPaint: Correct active tool ImageEditor sync issue
This fixes a scenario in which the active tool can get out of sync in
regards to what it believes it the current ImageEditor. In the case
where multiple images are open, switching between the editor tabs with a
tool selected can lead to this unsynchronized state due to a check that
the ImageEditor's active tool matches the current tool. If this is the
case the method returns early before we properly set the new editor
pointer on the active tool.
2022-11-13 16:08:48 -07:00
meiskam 8768417b1c WindowServer: Add "[user]" to titlebar when uid differs from login user 2022-11-13 16:02:39 -07:00
kleines Filmröllchen 7237be763f LibThreading: Add thread priority controls to Thread
This exposes the now properly working pthread APIs on the higher level.
2022-11-13 19:42:39 +00:00
kleines Filmröllchen f54462c424 LibAudio: Revert to using buffered file reading
This was slowing down FLACLoader below realtime. The real solution is
still to use mapped files but that has to wait until a larger refactor.
2022-11-13 19:18:00 +00:00
kleines Filmröllchen 276be7f8cc Piano: Guard against all allocations at top level of the audio pipeline
Therefore, we don't rely on LibDSP Processors to use allocation guards
themselves. It also demonstrates that nested allocation guards work
correctly :^)
2022-11-13 19:17:21 +00:00
kleines Filmröllchen 59a9f8a958 Piano: Alphabetize sources
:greenlinus:
2022-11-13 19:13:28 +00:00
Timothy Flynn 5385cb1287 LibWeb+WebContentr+WebDriver: Move driver response wrapping to LibWeb
Success responses are meant to be wrapped in a JSON object with a single
"value" key. Instead of doing this in both WebContent and WebDriver, do
it once in LibWeb.
2022-11-13 16:41:07 +00:00
Timothy Flynn 2c3ff6bb74 WebDriver: Port the WebDriver client to be a Web::WebDriver::Client 2022-11-13 16:41:07 +00:00
Timothy Flynn 4eefa292df LibWeb: Re-implement WebDriver endpoint handling within Web::WebDriver
This moves communication and route matching for WebDriver endpoints into
LibWeb. This is to reduce the amount of duplication required to create a
WebDriver implementation for Ladybird.

In doing so, this introduces some cleanup of WebDriver handling. Routes
are now a compile-time array, and matching a route is nearly free of
allocations (we still allocate a Vector for parsed parameters). This
implementation also makes heavier use of TRY semantics to propagate
errors into one handler.
2022-11-13 16:41:07 +00:00
Timothy Flynn 47493b5734 WebDriver: Implement Close Window closer to the spec
We are expected to return the list of open handles after closing the
current handle. Also just return a WebDriver::Response instead of a
wrapped Error variant.
2022-11-13 16:41:07 +00:00
Zaggy1024 9dc622475e LibVideo: Rename parse_tree_new to parse_tree in VP9/TreeParser.cpp
It is now the only function used to parse the binary trees in the VP9
decoder.
2022-11-12 10:17:27 -07:00
Zaggy1024 907816e629 LibVideo: Create TokensContext struct for token parsing parameters
With the addition of this struct, both the bool to determine if coefs
should be parsed and the token parse itself can take specific
parameters.

This is the last step in parameterizing all the tree parsing, so the
old functions in TreeParser are now unused. This patch is very
satisfying :^)

There's still more work to be done to clean up how the parameters are
passed from Parser, but that's work for another day.
2022-11-12 10:17:27 -07:00
Zaggy1024 e906bcc696 LibVideo: Parameterize all tree parsing for motion vectors in VP9 2022-11-12 10:17:27 -07:00
Zaggy1024 84f1aed40a LibVideo: Parameterize parsing single reference frame selection in VP9 2022-11-12 10:17:27 -07:00
Zaggy1024 37fab851f1 LibVideo: Parameterize parsing compound references in the VP9 decoder 2022-11-12 10:17:27 -07:00
Zaggy1024 dd18c42643 LibVideo: Parameterize compound mode parsing in the VP9 decoder 2022-11-12 10:17:27 -07:00
Zaggy1024 372a4ea8c1 LibVideo: Parameterize parsing if a block is inter predicted in VP9 2022-11-12 10:17:27 -07:00
Zaggy1024 93caa1e19d LibVideo: Parameterize TXSize parsing for the VP9 decoder 2022-11-12 10:17:27 -07:00
Zaggy1024 cc735a7001 LibVideo: Parameterize coefficient skip parsing for VP9 2022-11-12 10:17:27 -07:00
Zaggy1024 10ba956066 LibVideo: Parameterize segment ID parsing for the VP9 decoder 2022-11-12 10:17:27 -07:00
Zaggy1024 568e2fc1f2 LibVideo: Parameterize interpolation filter parsing for the VP9 decoder 2022-11-12 10:17:27 -07:00
Zaggy1024 cbb8a3f0f4 LibVideo: Parameterize inter mode parsing in the VP9 decoder 2022-11-12 10:17:27 -07:00
Zaggy1024 540ef22b95 LibVideo: Parameterize UV mode parsing in the VP9 decoder 2022-11-12 10:17:27 -07:00
Zaggy1024 858915ab3a LibVideo: Parameterize intra prediction mode parsing for VP9 2022-11-12 10:17:27 -07:00
Zaggy1024 1b66aa3cad LibVideo: Parameterize parsing the default UV prediction mode for VP9 2022-11-12 10:17:27 -07:00
Zaggy1024 c6ecad63d0 LibVideo: Parameterize parsing of the default VP9 intra mode tree 2022-11-12 10:17:27 -07:00
Zaggy1024 fce7639c90 LibVideo: Put motion vector or reference frame pairs in a struct
Since these two types are often passed around as a pair, it's easier to
handle them with a simple pair struct, at least for now. Once things
are fully being passed around as parameters wherever possible, it may
be good to change this type for something more generalized.
2022-11-12 10:17:27 -07:00
Zaggy1024 6192a33e79 LibVideo: Move parsing of Partition to its own TreeParser function
This adds a tree-parsing function that can be called statically from
specific trees' implementations in TreeParser, of which Partition is
the first. This way, all calls to tree parses will take the context
they need to be able to select a tree and probabilities, which will
allow removal of the state dependence in TreeParser on fields from
itself and Parser.
2022-11-12 10:17:27 -07:00
Zaggy1024 69e6feaf32 LibVideo: Add const getters to VP9/ProbabilityTables.h 2022-11-12 10:17:27 -07:00
Zaggy1024 17e1b205a4 LibVideo: Use the BlockSubsize enum where appropriate in the VP9 parser 2022-11-12 10:17:27 -07:00
Zaggy1024 981997c039 LibVideo: Combine VP9's Intra- and InterMode enums into PredictionMode
The two different mode sets are stored in single fields, and the
underlying values didn't overlap, so there was no reason to keep them
separate.

The enum is now an enum class as well, to enforce that almost all uses
of the enum are named. The only case where underlying values are used
is in lookup tables, but it may be worth abstracting that as well to
make array bounds more clear.
2022-11-12 10:17:27 -07:00
Zaggy1024 1c6d0a9777 LibVideo: Use Gfx::Size for VP9 frame sizes
Frame sizes will now be represented by Gfx::Size instead of storing
width and height separately.
2022-11-12 10:17:27 -07:00
Zaggy1024 40b0bb0914 LibVideo: Change all Span<u8 const> to ReadonlyBytes 2022-11-12 10:17:27 -07:00
Zaggy1024 72ed286e16 LibVideo: Allow the VP9 decoder to queue multiple frames
Frames will now be queued for retrieval by the user of the decoder.
When the end of the current queue is reached, a DecoderError of
category NeedsMoreInput will be emitted, allowing the caller to react
by displaying what was previously retrieved for sending more samples.
2022-11-12 10:17:27 -07:00
Zaggy1024 993385f18d LibVideo: Rename VP9's ReferenceFrame enum to ReferenceFrameType 2022-11-12 10:17:27 -07:00
kleines Filmröllchen 3610b8dd93 LibAudio: Restore exact audio enqueuer thread mutex behavior
This was changed with a recent move to MutexLocker, but the exact
previous behavior is safer as it holds the lock for the minimum amount
of time in both locations. We don't want to introduce these kinds of
subtle bugs.
2022-11-12 10:04:21 -07:00
kleines Filmröllchen 9d0b56b1fc LibAudio: Initialize enqueuer event loop to null pointer
If this is not done, the event loop pointer will be initialized to
exploded MALLOC_SCRUB_BYTEs and the null pointer check at destruction
time will fail, causing a crash any time an audio client without a
started enqueuer thread exits. With this change, we correctly skip
quitting the event loop both when it was never started (if the enqueuer
thread never ran) as well as if it already exited (if the enqueuer
thread exited fast enough) without additional logic for the two very
different cases.
2022-11-12 10:04:21 -07:00
Alex Chronopoulos 457fda6354 AudioServer: Stop re-creating the device stream buffer
The buffer provided to `OutputMemoryStream` was made a private class
member. This is because there is no reason to re-create it in every
iteration. Also, the logic becomes more symmetric with
`m_zero_filled_buffer` which is already a class member.
2022-11-12 10:03:42 -07:00
Alex Chronopoulos b22c840963 AudioServer: Stop glitching when toggling mute
Initialize the `AudioServer::Mixer::m_zero_filled_buffer` to zero. The
garbage memory inside that buffer was causing a glitch sound when the
user was toggling the mute checkbox or was moving the volume slider on
and off zero. Glitching was more obvious if the toggling was happening
without any sound being played in parallel.

In addition to that, the `m_zero_filled_buffer` turned to `const` since
there is no intention to modify its content.
2022-11-12 10:03:42 -07:00
Tobias Christiansen 1aa16b4dd4 WebDriver: Implement POST /session/{id}/window/fullscreen endpoint 2022-11-12 12:12:05 +00:00
Timothy Flynn 6a55370401 WebContent: Pass the script timeout into the WebDriver script executor
This was dropped in 0b9803d and 31469ee before the timeouts object was
avaiable in WebContent.
2022-11-11 22:03:23 +00:00
Timothy Flynn 04f41bda52 WebContent+WebDriver: Move Get/Set Timeouts to WebContent 2022-11-11 22:03:23 +00:00
Timothy Flynn cb4b9108d1 LibWeb+WebDriver: Move the timeouts configuration object to LibWeb 2022-11-11 22:03:23 +00:00
Timothy Flynn 7972916be7 Browser+WebDriver: Remove the connection between Browser and WebDriver
WebDriver now only has an IPC connection to WebContent. WebDriver still
launches the browser, but now when the session ends, we simply send a
SIGTERM signal to the browser.
2022-11-11 22:03:23 +00:00
Timothy Flynn c64da0d00c Browser+WebDriver: Add missing header includes
These are currently being included transitively, and will cause an error
when those intermediate includes are removed.
2022-11-11 22:03:23 +00:00
Timothy Flynn 2c9549cb76 Browser+WebContent+WebDriver: Move Get Title to WebContent 2022-11-11 22:03:23 +00:00
Timothy Flynn 7f142745e2 Browser+WebContent+WebDriver: Move Back, Forward, Refresh to WebContent 2022-11-11 22:03:23 +00:00
Timothy Flynn 24fb7cd0ad LibWebView+WebContent: Add IPCs to navigate the browser's history 2022-11-11 22:03:23 +00:00
Matteo Benetti f84b2e9e7d LibLine: Fix save line condition
Fix condition used by actual_rendered_string_length_step() to
check if the line reached the desired length.
2022-11-11 22:16:27 +03:30
Timothy Flynn ff6055e0a3 Browser+WebContent+WebDriver: Move Delete All Cookies to WebContent 2022-11-11 18:02:04 +00:00
Timothy Flynn b7f21bb92e Browser+WebContent+WebDriver: Move Delete Cookie to WebContent 2022-11-11 18:02:04 +00:00
Timothy Flynn d202999853 LibWebView+WebContent: Add IPC to update a document's cookie 2022-11-11 18:02:04 +00:00
Timothy Flynn 18abc6c85d Browser+WebContent+WebDriver: Move Add Cookie to WebContent
The new implementation is made a bit simpler by way of TRY. It also
implements setting the SameSite attribute.
2022-11-11 18:02:04 +00:00
Timothy Flynn fce9fcf154 LibWeb: Add a string-to-same-site-attribute converter 2022-11-11 18:02:04 +00:00
Timothy Flynn a3d6c2f6af Browser+WebContent+WebDriver: Move Get Named Cookie to WebContent
Instead of sending *all* cookies over IPC and filtering by name, we now
filter by name from the cookie jar and send just the first matching
cookie.
2022-11-11 18:02:04 +00:00
Timothy Flynn c6a0888088 LibWebView+WebContent: Add IPC to get a document's named cookie 2022-11-11 18:02:04 +00:00
Timothy Flynn c77260c480 Browser+WebContent+WebDriver: Move Get All Cookies to WebContent
There are a couple changes here from the existing Get All Cookies
implementation.

1. Previously, WebDriver actually returned *all* cookies in the cookie
   jar. The spec dictates that we only return cookies that match the
   document's URL. Specifically, it calls out that we must run just the
   first step of RFC 6265 section 5.4 to perform domain matching.

   This change adds a special mode to our implementation of that section
   to skip the remaining steps.

2. We now fill in the SameSite cookie attribute when serializing the
   cookie to JSON (this was a trival FIXME that didn't get picked up
   when SameSite was implemented).
2022-11-11 18:02:04 +00:00
Timothy Flynn d2c1957d8f LibWebView+WebContent: Add IPC to get all cookies for a document's URL 2022-11-11 18:02:04 +00:00
Andreas Kling 2d33b2996f LibJS: Teach GetVariable bytecode op to deal with global variable cache
This mirrors the behavior of Identifer::to_reference() in the AST
interpreter.
2022-11-11 15:25:52 +01:00
Sam Atkins c33eae24f9 AK+Everywhere: Replace DistinctNumeric bool parameters with named ones
This means that rather than this:

```
AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false,
    false, true, FunctionAddress);
```

We now have this:
```
AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, FunctionAddress, Arithmetic,
    Comparison, Increment);
```

Which is a lot more readable. :^)

Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
2022-11-11 17:50:53 +03:30
Linus Groh 24c0a6e9a4 Revert "LibJS: Add explicit assertion for days"
This reverts commit 56abb01ee3.

Unfortunately, the assertion doesn't work out as expected and crashes
test-js.
2022-11-11 14:10:02 +00:00
Andreas Kling 6ff9931dde LibJS: Make Identifier::execute() actually use the lookup cache
If we have cached environment coordinates for an Identifier, we have
to call to_reference() to actually make use of them. :^)
2022-11-11 12:22:01 +00:00
Andreas Kling d7e5a2058d LibJS: Cache access to bindings in the global environment
This patch adds a special EnvironmentCoordinate::global_marker value
that signifies that a binding lookup ended up searching the global
environment. It doesn't matter if we find it there or not, the global
marker is always returned. This allows us to bypass other environments
on subsequent access, going directly to the global environment.
2022-11-11 12:22:01 +00:00
Andreas Kling 7b30df0840 LibJS: Make ObjectEnvironment::set_mutable_binding() faster as well
We can combine HasProperty and Set into just Set in non-strict mode for
non-with object environments.
2022-11-11 12:22:01 +00:00
Andreas Kling 12ceaf3790 LibJS: Make ObjectEnvironment::get_binding_value() faster in sloppy mode
We can combine HasProperty and Get into just Get in non-strict mode for
non-with object environments.
2022-11-11 12:22:01 +00:00
Smrtnyk 56abb01ee3 LibJS: Add explicit assertion for days
This is an editorial change in Temporal spec.

See: 15b7293b38
2022-11-11 12:14:46 +00:00
Nico Weber 0175b5c584 LibWeb: Merge latest mimesniff spec update
Merges https://github.com/whatwg/mimesniff/commit/e589fcb71196,
an editorial change...that fixes a comment typo!
2022-11-11 12:13:09 +00:00
Timothy Flynn 31469ee45a Browser+WebContent+WebDriver: Move Execute Async Script to WebContent
With this, WebDriverEndpoints is unused and removed :^)
2022-11-11 11:36:07 +00:00
Timothy Flynn 0b9803dc93 WebContent+WebDriver: Move Execute Script to WebContent 2022-11-11 11:36:07 +00:00
Timothy Flynn 88dcdf681f Browser+WebContent+WebDriver: Move Get Page Source to WebContent 2022-11-11 11:36:07 +00:00
Timothy Flynn 561f9f36f7 WebContent: Capture entire content rect when taking a full screenshot
Instead of offsetting the screenshot by the position of the document
element, just take a screenshot of the entire content rect. After
looking at Acid3 a bit more, this more accurately represents what the
user actually sees on the webpage.
2022-11-11 11:36:07 +00:00
Timothy Flynn ea0561a0b3 Browser+WebContent+WebDriver: Move Take Element Screenshot to WebContent 2022-11-11 11:36:07 +00:00
Timothy Flynn de1e882601 Browser+WebContent+WebDriver: Move Take Screenshot to WebContent 2022-11-11 11:36:07 +00:00
Timothy Flynn 40b9d248be LibWeb: Implement screenshot painting inside Web::WebDriver
This will allow for implementing the screenshot action closer to the
spec, as we can now use HTMLCanvasElement to encode the bitmap, and
capture the screenshot on the animation frame loop.
2022-11-11 11:36:07 +00:00