Commit Graph

13719 Commits

Author SHA1 Message Date
Anonymous
77511627e9 LibLine: Fix loading of terminal dimensions when running under lldb 2022-02-13 14:44:36 +01:00
rvictorr
434925bbd8 profile: Port to LibMain 2022-02-13 12:40:36 +01:00
rvictorr
73303f0dc1 LibCore: Add syscall wrapper for profiling_free_buffer() 2022-02-13 12:40:36 +01:00
rvictorr
014c0d68c0 LibCore: Add syscall wrapper for profiling_disable() 2022-02-13 12:40:36 +01:00
rvictorr
c6a743f22c LibCore: Add syscall wrapper for profiling_enable() 2022-02-13 12:40:36 +01:00
networkException
4dc23c9b24 LibGUI: Allow breadcrumbbar segment activation using the keyboard
We now interpret a breadcrumbbar segment gaining focus just as clicking
on the segment, allowing keyboard navigation using the arrow keys.
2022-02-13 12:39:44 +01:00
networkException
daf2ebca3b LibGUI: Allow activation of CommandPalette without a focused widget
Previously we required there to be a focused widget so it would have
been able to opt out. In case the isn't a focused widget there is no way
for it to opt out anyways, so let's allow CommandPalette to work in this
case :^)
2022-02-13 12:38:26 +01:00
electrikmilk
8c32b42bdf Base+PixelPaint: Add more icons 2022-02-13 10:18:37 +01:00
Idan Horowitz
9839a1699f gml-format: Skip writing formatted GML to file if no changes were made
This stops all GML files from appeared under the "Changes not staged
for commit" section of the commit message comment due to the changed
last-modified timestamp of the file.
2022-02-13 02:36:35 +02:00
Idan Horowitz
c8ab45e79f Userland: Run gml-format
This brings the existing GML files up to spec with the new requirements
2022-02-13 02:36:35 +02:00
Idan Horowitz
4c451422c3 gml-format+Playground: Print GML parsing error on formatting failure 2022-02-13 02:36:35 +02:00
Idan Horowitz
d4f08b3096 LibGUI: Enforce new GML newline and ordering guidelines
Specifically:
 * Properties must precede sub-object declarations.
 * There shouldn't be any newlines in-between properties.
 * There should be a newline in-between each sub-object.
 * Object declarations must include the curly braces.
 * There should be a newline between the properties of an object and
   it's sub-objects.
2022-02-13 02:36:35 +02:00
Andreas Kling
c52dc87a42 LibWeb: Don't crash on unknown CSS display types, fall back to inline
This patch also adds CSS::Display::to_string() so we can log the
unimplemented CSS display value (if you have LIBWEB_CSS_DEBUG enabled).
2022-02-13 01:03:49 +01:00
DerpyCrabs
58ce2dd088 LibWeb: Add stub implementation for Element's getClientRects
getClientRects supposed to return a list of bounding DOMRect
for each box fragment of Element's layout, but most elements have
only one box fragment, so implementing it with getBoundingClientRect
is useful.
2022-02-12 22:43:10 +01:00
DerpyCrabs
2f828231c4 LibWeb: Implement Geometry::DOMRectList
Implement DOMRectList that is used as a return type of
getClientRects functions on Element and Range.
2022-02-12 22:43:10 +01:00
Andreas Kling
0532d7d255 LibWeb: Stop sizing the context root box in formatting contexts
Until now, some formatting contexts (BFC in particular) have been
assigning size to the root box. This is really the responsibility of the
parent formatting context, so let's stop doing it.

To keep position:absolute working, parent formatting contexts now notify
child contexts when the child's root box has been sized. (Note that the
important thing here is for the child root to have its final used height
before it's able to place bottom-relative boxes.)

This breaks flexbox layout in some ways, but we'll have to address those
by improving the spec compliance of FFC.)
2022-02-12 22:30:50 +01:00
Andreas Kling
2f3af71261 LibWeb: Always rebuild stacking context tree during layout
We sometimes had a stale stacking context tree sitting around, causing
incorrect paints until the next full layout invalidation.

Fix this by simply rebuilding the stacking context tree when asked to.
2022-02-12 22:30:50 +01:00
Andreas Kling
40bd2cb611 LibWeb: Move initial containing block setup out of BFC
BFC currently has a number of architectural issues due to it being
responsible for setting the dimensions of the BFC root.

This patch moves the logic for setting up the ICB from BFC to Document.
2022-02-12 22:30:50 +01:00
Andreas Kling
8b8a1449c4 RequestServer: Make value copy of the URL in ensure_connection()
I saw what looked like a UAF of this URL in a RequestServer crash,
and it seems reasonable to make a copy here since we end up passing
them to Core::deferred_invoke().
2022-02-12 22:30:50 +01:00
Andreas Kling
3c108e20a7 PixelPaint: Run gml-format on FilterGallery.gml 2022-02-12 22:30:50 +01:00
Luke Wilde
d1c4a94659 LibWeb: Fix comparing current position to quote in Mime Type quote parse
Had a look over this with a fresh head and noticed I was comparing the
current lexer position to the quote character, oops!
2022-02-12 17:13:14 +00:00
Idan Horowitz
497dd5b354 LibWeb: Set response header cookies on redirects
Since we were previously relying on Document::set_cookie in order to
set cookies received as a 'Set-Cookie' response header, we would ignore
any response header cookies in redirect (status code 3xx) responses.

While this behaviour is not strictly enforced in the specification,
most major browsers do set cookies in redirect responses, and some
sites (e.g. Cookie Clicker) rely on this behaviour.

Since cookies are stored per-site and not per-document, this behaviour
is achieved by simply decoupling the cookie set mechanism from it.
2022-02-12 16:15:56 +00:00
Idan Horowitz
5e5b94a7ec LibWeb: Pass cookie string by reference in Document::set_cookie
This string is only taken by const reference internally, so there's no
point in forcing the callers to copy the string.
2022-02-12 16:15:56 +00:00
Idan Horowitz
721a4a0a67 LibWeb: Ignore Location headers unless the response status code is 3xx
As per RFC7231 the Location header field has different meanings for
different response status codes:
For 201 (Created) responses, the Location value refers to the primary
resource created by the request.
For 3xx (Redirection) responses, the Location value refers to the
preferred target resource for automatically redirecting the request.
2022-02-12 16:15:56 +00:00
Sam Atkins
a99d02e14d LibWeb: Add an enum for !important 2022-02-12 16:13:27 +00:00
Linus Groh
c08a52dd97 LibJS: Remove the name prefix for wrapped functions
This is a normative change in the ShadowRealm spec.

See: https://github.com/tc39/proposal-shadowrealm/commit/4ca634a
2022-02-12 16:06:37 +00:00
itskarudo
16aeb8b51d kill: Parse CLI arguments using Arguments.strings
The previous implementation used argv and LibC to parse arguments,
it now uses the Arguments.strings interface to do so.
2022-02-12 10:53:07 -05:00
itskarudo
500098c76d kill: Port to LibMain 2022-02-12 10:53:07 -05:00
Aatos Majava
c23d25d1de FileManager: Add F6 alternate shortcut to "location" action
This mirrors the behaviour in Browser.
2022-02-12 09:06:23 -05:00
Luke Wilde
28f0193d9b LibWeb: Decode XHR text with the specified charset in the MIME type
The MIME type can come from either the Content-Type header in the
response header list, or the overridden MIME type passed into
overrideMimeType()

This is required by Google Maps, which downloads blobs encoded
in x-user-defined format.
2022-02-12 12:53:28 +01:00
Luke Wilde
0e0f98a45e LibTextCodec: Add x-user-defined decoder
It's a pretty simple charset: the bottom 128 bytes (0x00-0x7F) are
standard ASCII, while the top 128 bytes (0x80-0xFF) are mapped to a
portion of the Unicode Private Use Area, specifically 0xF780-0xF7FF.

This is used by Google Maps for certain blobs.
2022-02-12 12:53:28 +01:00
Luke Wilde
835a344337 LibTextCodec: Add decoder function that overrides given decoder on BOM
This functions takes a user-provided decoder and will only use it if no
BOM is in the input.

If there is a BOM, it will ignore the given decoder and instead decode
the input with the appropriate Unicode decoder for the detected BOM.

This is only to be used where it's specifically needed, for example XHR
uses this for compatibility with deployed content. As such, it has an
obnoxious name to discourage usage.
2022-02-12 12:53:28 +01:00
Luke Wilde
94965ba28d LibTextCodec: Add BOM sniffer
This takes the input and sniffs it for a BOM. If it has the UTF-8 or
UTF-16BE BOM, it will return their respective decoder. Currently we
don't have a UTF-16LE decoder, so it will assert TODO if it detects
a UTF-16LE BOM. If there is no recognisable BOM, it will return no
decoder.
2022-02-12 12:53:28 +01:00
Luke Wilde
4ccade42b7 LibWeb: Implement XMLHttpRequest.overrideMimeType
This allows you to ignore the Content-Type returned by the server and
always parse the content as if it's the given MIME type.

This will currently be used for allowing you to override the charset
of text responses.
2022-02-12 12:53:28 +01:00
Luke Wilde
8cfeca5261 LibWeb: Implement spec-compliant MIME type struct and parser
This will be used by XHR to extract the Content-Type MIME type to
retrieve the charset.
2022-02-12 12:53:28 +01:00
Itamar
2903c47ba0 Utilities: Add update-cpp-test-results utility
This is a small utility that updates the target tests results for the
LibCpp parser and preprocessor regression tests.

It's handy to run after changing something in the output of either the
parser or the preprocessor.
2022-02-12 11:45:15 +00:00
snooze
e9d3f3793c PixelPaint: Add a preview in FilterGallery
Now FilterGallery shows the preview of the currently selected filter
applied on the currently active layer
2022-02-12 12:21:35 +01:00
Ali Mohammad Pur
ae68d1f865 strace: Add a chdir formatter 2022-02-12 12:16:59 +01:00
Ali Mohammad Pur
18f68d1aea LibC: Stub out fmemopen() 2022-02-12 12:16:59 +01:00
Ali Mohammad Pur
99f9860854 LibPthread: Add PTHREAD_CANCELED
This is just the expected return value of pthread_join() when it fails.
2022-02-12 12:16:59 +01:00
serenitydev
8c29cc879d LibWeb: Add support for 'arraybuffer' message types on WebSockets 2022-02-12 12:16:02 +01:00
Itamar
506c13d143 HackStudio: Put the Build directory inside the Serenity repository
Previously, the build directory for building serenity components was a
temporary directory in /tmp which was generated whenever a different
serenity component was built.

Instead of doing that, Hack Studio now simply uses the Build/ directory
inside the Serenity repository, similar to what is done in host builds.

This makes it so we don't re-build when switching back and forth between
different components.
It also makes it easier to inspect the build products.
2022-02-12 11:51:48 +01:00
Itamar
8bb4d46676 HackStudio: Only query token information if semantic highlighting is on 2022-02-12 11:24:32 +01:00
Guilherme Gonçalves
a456759d7a LibWeb: Ignore malformed at-rules in CSS parser
Fixes #12405.
2022-02-12 11:24:17 +01:00
electrikmilk
dece108f9a PixelPaint: Implement IconBag to organize icons
Implement IconBag method of organizing menubar icons from Browser.
2022-02-12 11:24:00 +01:00
DerpyCrabs
29078d4d53 LibWebSocket: Don't try to send empty payload inside of frame
According to RFC 6455 sections 5.5.2-5.5.3 Ping and Pong frames
can have empty "Application data" that means payload can be of size 0.
This change fixes failed "buffer.size()" assertion inside
of Core::Stream::write_or_error by not trying to send empty payload
in WebSocket::send_frame.
2022-02-12 11:12:43 +01:00
DerpyCrabs
e379147f64 LibHTTP: Make reason phrase of HTTP response's status line optional
According to rfc2616 section 6.1 the text of reason phrase is not
defined and can be replaced by server.
Some servers (for example http://linux.org.ru) leave it empty.
This change fixes parsing of HTTP responses with empty reason phrase.
2022-02-12 02:56:17 +03:30
Wesley Moore
849f849905 LibHTTP: Remove redundant can_read_without_blocking call
When entering the InBody state LibHTTP performs a
can_read_without_blocking check, which is duplicated immediately
afterwards. This initial call is removed.
2022-02-12 02:53:57 +03:30
Wesley Moore
12ff5c9bfd LibHTTP: Remove attempt to read extra line after response headers
When LibHTTP encountered the blank line between the headers and the body
in a HTTP response it made a call the m_socket->can_read_line(). This
ultimately tried to find a newline in the stream. If the response body
was small and did not contain a new line then the request would hang.

The call to m_socket->can_read_line() is removed so that the code is
able to progress into the body reading loop.
2022-02-12 02:53:57 +03:30
Andreas Kling
63345c4dfc LibWeb: Rename Layout::Box absolute rect helpers
- padded_rect() -> absolute_padding_box_rect()
- bordered_rect() -> absolute_border_box_rect()
2022-02-11 21:57:56 +01:00