Commit Graph

18941 Commits

Author SHA1 Message Date
Linus Groh
68006f3e16 LibWeb: Update Navigator.idl to use 4 spaces for indentation 2022-10-13 11:14:45 +02:00
Linus Groh
5681115744 Browser: Set 'webdriver-active flag' when creating a new Tab 2022-10-13 11:14:45 +02:00
Linus Groh
3f24a444f9 LibWeb+WebContent: Add plumbing for 'webdriver-active flag' 2022-10-13 11:14:45 +02:00
Sam Atkins
096fe865c6 WebDriver: Implement GET /session/{id}/url endpoint 2022-10-12 23:07:42 +02:00
Sam Atkins
a15d32982a WebDriver: Implement GET /status endpoint 2022-10-12 23:07:42 +02:00
Sam Atkins
80603f141a WebDriver: Add new WebDriver service
WebDriver aims to implement the WebDriver specification found at
https://w3c.github.io/webdriver/webdriver-spec.html . It's an HTTP
server that can create Browser sessions and control them.

Co-authored-by: Florent Castelli <florent.castelli@gmail.com>
2022-10-12 23:07:42 +02:00
Sam Atkins
8c0f1da9f7 Browser: Add a basic WebDriver API
This adds a new option "--webdriver" that opens a local unix socket
in /tmp/browser_{pid} which the WebDriver server can use to send
commands to the Browser instance.

Co-authored-by: Florent Castelli <florent.castelli@gmail.com>
2022-10-12 23:07:42 +02:00
Florent Castelli
ec9c11667f LibC+LibCore: Fix file argument name in posix_spawnp
posix_spawnp takes a file, which is subject to PATH search,
while posix_spawn takes a path.
2022-10-12 23:07:42 +02:00
implicitfield
480e517f03 checksum: Support the '--check' option
This commit also updates 'checksum' to use the Core::Stream::File API.
2022-10-12 12:01:40 -06:00
davidot
d9360676cd LibCore: Add standard_{output, input, error} functions to File::Stream 2022-10-12 12:00:21 -06:00
davidot
e0cccaa583 LibCore: Add option to Stream::File to not close the file on destruction 2022-10-12 12:00:21 -06:00
Mart G
279121fa10 HexEditor: Fix two off-by-one errors
The 'select all' feature now also selects the last byte of the document.
The find function now also selects the last byte of a match.
2022-10-12 18:15:44 +02:00
huttongrabiel
6926991a56 LibGUI: Delete from current position to end of line in VimEditingEngine
When in normal mode pressing Shift+D will delete from the current cursor
position to the end of the line. Leaving the cursor on the character
before where the cursor was when the deletion took place.
2022-10-12 09:46:18 -06:00
Ali Mohammad Pur
166a905951 Userland: Properly populate GENERATED_SOURCES
We previously put the generated headers in SOURCES, which did not mark
them as GENERATED (and did not produce a proper dependency).
This commit moves all generated headers into GENERATED_SOURCES, and
removes useless header SOURCES.
2022-10-12 15:55:15 +01:00
Mart G
c88058cea2 PixelPaint: Call update after clearing guides 2022-10-12 15:25:18 +01:00
Gunnar Beutner
344ca73930 TextEditor: Set window title before showing the main window
Previously TextEditor updated its window title after the window was
already visible. This causes the default title ("GUI::Window") to be
shown for a short period of time which was especially noticeable when
opening files.
2022-10-12 14:47:27 +02:00
Timon Kruiper
8373a14835 LibWeb: Remove code duplication in computing height for abs-pos elements
This refactors the solve_for_{top, bottom, height, etc} lambdas to use a
common solve_for lambda that takes the length to be solved as an
argument. This way some code duplication is removed.
2022-10-12 11:08:29 +02:00
Samuel Bowman
ca0a0b7a93 LibWeb: Add missing else's in absolutely positioned height computation
Rules 1, 2, and 3 use else if, so rules 4, 5, and 6 should too.
2022-10-12 10:32:57 +02:00
Jan200101
743f46030c LibC: Declare _setjmp and _longjmp on non i386 platforms
These aliases were previously only implemented for i386 and are required
for certain Ports e.g. Lua.
2022-10-12 02:07:27 -06:00
Zaggy1024
41cb705b47 LibVideo: Allow the VP9 decoder to decode ultra high resolution video
Previously, some integer overflows and truncations were causing parsing
errors for 4K videos, with those fixed it can fully decode 8K video.

This adds a test to ensure that 4K video will continue to be decoded.

Note: There seems to be unexpectedly high memory usage while decoding
them, causing 8K video to require more than a gigabyte of RAM. (!!!)
2022-10-12 00:54:31 -06:00
Jeremy Borgman
f894e8be62 shot: Add ability to edit in PixelPaint 2022-10-12 00:46:33 -06:00
implicitfield
8c5fa95ba3 test: Guard code paths that may lead to a null pointer dereference
test no longer crashes with a segmentation violation if invalid
arguments are passed.
2022-10-11 23:38:13 -06:00
Tommy Murphy
0ee98c69c1 LibCompress: Brotli support metadata of skip_length=0
The relevant RFC section from
https://www.rfc-editor.org/rfc/rfc7932#section-9.2

MSKIPBYTES * 8 bits: MSKIPLEN - 1, where MSKIPLEN is
       the number of metadata bytes; this field is
       only present if MSKIPBYTES is positive;
       otherwise, MSKIPLEN is 0 (if MSKIPBYTES is
       greater than 1, and the last byte is all
       zeros, then the stream should be rejected as
       invalid)

So when skip_bytes is zero we need to break and
re-align bytes.

Added the relevant test case that demonstrates this from:
https://github.com/google/brotli/blob/master/tests/testdata/x.compressed
2022-10-11 22:49:33 -06:00
Andreas Kling
e6de382679 LibWeb: Constrain abspos element heights by min-height and max-height 2022-10-11 22:31:51 +02:00
Andreas Kling
0e295f727a LibWeb: Fix dumb typos in solver helpers for abspos height 2022-10-11 22:23:13 +02:00
Sam Atkins
f754f45680 LibHTTP: Include request body in HttpRequest::from_raw_request() 2022-10-11 21:52:13 +02:00
Sam Atkins
437c6fc277 pro: Stop closing stdout early
This was causing a race-condition where sometimes the response body
would not get printed.

Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
2022-10-11 21:52:13 +02:00
Sam Atkins
f06a7f40bf LibProtocol: Remove redundant return statement 2022-10-11 21:52:13 +02:00
Sam Atkins
ee72a11ca9 pro: Add argument --method/-m for controlling the HTTP method
This lets you send requests like DELETE.
2022-10-11 21:52:13 +02:00
Sam Atkins
53b7edd5b9 pro: Print the response code if it's an error 2022-10-11 21:52:13 +02:00
Sam Atkins
9b891a423b LibHTTP: Make HTTP method names more accessible
Previously you could only get the name of an HttpRequest::Method if you
already had an HttpRequest.
2022-10-11 21:52:13 +02:00
Andreas Kling
84953c5020 LibWeb: Calculate height of absolute-position elements according to spec
This patch implements the full "old model" height algorithm from the
CSS Positioned Layout spec. I went with the old model since we don't
yet have the machinery required to implement the new model.

Also, the width calculations already follow the old model, so this
is symmetric with that. Eventually we should of course implement the new
positioned layout model.
2022-10-11 21:49:48 +02:00
Andreas Kling
e77798f5fd LibWeb: Implement a large chunk of the Selection API
This patch implements enough of the Selection API specification
that we stop hitting unimplemented functions when loading Twitter.
2022-10-11 21:49:48 +02:00
Andreas Kling
317ab7a04b LibWeb: Make Range's boundary point comparison a public function
We'll need this in the Selection API implementation as well.
2022-10-11 21:49:48 +02:00
Andreas Kling
33c6559561 LibWeb: Add spec link for DOM::Document::m_selection 2022-10-11 21:49:48 +02:00
Andreas Kling
5ab501c92f LibWeb: Scroll elements into view when they become focused
This makes both user-interactive (tab keys) and programmatic focus
changes scroll the viewport if necessary to reveal the newly focused
element.
2022-10-11 21:49:48 +02:00
Andreas Kling
7dcbb403bb LibWeb: Update layout in Element.getClientRects()
We always have to flush any pending layout updates before inspecting the
layout tree.
2022-10-11 21:49:48 +02:00
Mart G
8202beeb2b WindowServer+LibGUI: Shrink window edge resize hot-spots
The hot-spots for resizing a window by dragging its corner are now
limited to a small area around the actual corner instead of an area with
1/3rd the length or width of the window.

The hot-spots to resize a window while holding a modifier key and the
right mouse button are unchanged.
2022-10-11 17:48:48 +02:00
Timothy Slater
eb9db167da HackStudio: Set proper action scope for editor shortcuts
This fixes issue #14429. The editor actions were not given a parent as
scope so defaulted to global. Because HackStudio can have multiple
editors and even multiple editor tab widgets, I chose the
VerticalSplitter that all editor tab widgets get added to as the parent.
With a Widget set as the parent, the action gets WidgetLocal scope and
allows the embedded terminals to receive shortcuts.

Thanks to Andreas for doing a quick look at this and pointing in the
right direction during an Office Hours stream :)
2022-10-11 11:12:41 +02:00
Andreas Kling
0f2d5f91dc LibWeb: Fix two uninitialized variables in FormattingContext 2022-10-10 23:42:35 +02:00
Andreas Kling
a2348ebcc0 LibWeb: Make Window.getSelection() forward to Document.getSelection()
(And have document create the Selection object on demand.)
2022-10-10 21:23:03 +02:00
Andreas Kling
b945d164e2 LibWeb: Split intrinsic heights cache based on available width
Now that intrinsic heights (correctly) depend on the amount of available
width, we can't just cache the first calculated min-content and
max-content heights and reuse it without thinking.

Instead, we have to cache three pairs:

- min-content & max-content height with definite available width
- min-content & max-content height with min-content available width
- min-content & max-content height with max-content available width

There might be some more elegant way of solving this, but basically this
makes the cache work correctly when someone's containing block is being
sized under a width constraint.
2022-10-10 20:22:50 +02:00
Andreas Kling
4b74f36cd0 LibWeb: Resolve vertical margins against containing block width
We were incorrectly resolving them against the available width, which
may or may not be the same as the containing block width.

The specification for these properties says that percentages resolve
against the containing block width, so that's what we should do.
2022-10-10 20:22:50 +02:00
Andreas Kling
47e3daa40f LibWeb: Use *outside* available space for fit-content sizing in FFC
When calculating the fit-content width or height for a flex item, we
need to use the available space *outside* the item, not the available
space *inside*.
2022-10-10 20:22:50 +02:00
Andreas Kling
4a17e8713b LibWeb: Update FFC for spec change to intrinsic min-content cross size
We now know exactly how to calculate the min-content cross size for
multi-line flex containers, which is great. The other three intrinsic
constraints still fall back to the old ad-hoc code path.

5630e7b064
2022-10-10 20:22:50 +02:00
Andreas Kling
9869405802 LibWeb: Put HTML parser encoding sniffing debug logging behind a flag 2022-10-10 20:22:50 +02:00
Andreas Kling
3a675a024a LibWeb: Make DOMStringMap a LegacyPlatformObject
Since it has a custom named getter, it should have been this all along.
2022-10-10 20:22:50 +02:00
Andreas Kling
2c37df6241 LibWeb: Don't include DOMStringMap.h quite so much
This file was being included everywhere via HTMLElement and SVGElement,
but we don't actually need to do that.
2022-10-10 20:22:50 +02:00
Luke Wilde
081a617d8d LibWeb: Use the default CSS attributes for embedded content from HTML
The main benefit of this is respecting the iframe frameborder
attribute, as frameborder="0" is a pretty common way of removing
the default <iframe> border.

For example, it's on all YouTube embeds by default and on some
ReCAPTCHA embeds.
2022-10-10 19:33:34 +02:00
Luke Wilde
6a7c560849 LibWeb: Respect width and height attributes of <iframe>
We have to respect the width and height attributes of <iframe> elements
the same way as <img> elements.
2022-10-10 19:33:34 +02:00