summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2022-02-13LibJS: Get rid of unnecessary work from canonical_numeric_index_stringAnonymous
The spec version of canonical_numeric_index_string is absurdly complex, and ends up converting from a string to a number, and then back again which is both slow and also requires a few allocations and a string compare. Instead lets use the logic we already have as that is much more efficient. This improves performance of all non-numeric property names.
2022-02-13LibJS: Correct the handling of accessors on stringsAnonymous
2022-02-13LibLine: Fix loading of terminal dimensions when running under lldbAnonymous
2022-02-13LibCore: Add syscall wrapper for profiling_free_buffer()rvictorr
2022-02-13LibCore: Add syscall wrapper for profiling_disable()rvictorr
2022-02-13LibCore: Add syscall wrapper for profiling_enable()rvictorr
2022-02-13LibGUI: Allow breadcrumbbar segment activation using the keyboardnetworkException
We now interpret a breadcrumbbar segment gaining focus just as clicking on the segment, allowing keyboard navigation using the arrow keys.
2022-02-13LibGUI: Allow activation of CommandPalette without a focused widgetnetworkException
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-13Userland: Run gml-formatIdan Horowitz
This brings the existing GML files up to spec with the new requirements
2022-02-13gml-format+Playground: Print GML parsing error on formatting failureIdan Horowitz
2022-02-13LibGUI: Enforce new GML newline and ordering guidelinesIdan Horowitz
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-13LibWeb: Don't crash on unknown CSS display types, fall back to inlineAndreas Kling
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-12LibWeb: Add stub implementation for Element's getClientRectsDerpyCrabs
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-12LibWeb: Implement Geometry::DOMRectListDerpyCrabs
Implement DOMRectList that is used as a return type of getClientRects functions on Element and Range.
2022-02-12LibWeb: Stop sizing the context root box in formatting contextsAndreas Kling
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-12LibWeb: Always rebuild stacking context tree during layoutAndreas Kling
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-12LibWeb: Move initial containing block setup out of BFCAndreas Kling
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-12LibWeb: Fix comparing current position to quote in Mime Type quote parseLuke Wilde
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-12LibWeb: Set response header cookies on redirectsIdan Horowitz
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-12LibWeb: Pass cookie string by reference in Document::set_cookieIdan Horowitz
This string is only taken by const reference internally, so there's no point in forcing the callers to copy the string.
2022-02-12LibWeb: Ignore Location headers unless the response status code is 3xxIdan Horowitz
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-12LibWeb: Add an enum for !importantSam Atkins
2022-02-12LibJS: Remove the name prefix for wrapped functionsLinus Groh
This is a normative change in the ShadowRealm spec. See: https://github.com/tc39/proposal-shadowrealm/commit/4ca634a
2022-02-12LibWeb: Decode XHR text with the specified charset in the MIME typeLuke Wilde
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-12LibTextCodec: Add x-user-defined decoderLuke Wilde
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-12LibTextCodec: Add decoder function that overrides given decoder on BOMLuke Wilde
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-12LibTextCodec: Add BOM snifferLuke Wilde
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-12LibWeb: Implement XMLHttpRequest.overrideMimeTypeLuke Wilde
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-12LibWeb: Implement spec-compliant MIME type struct and parserLuke Wilde
This will be used by XHR to extract the Content-Type MIME type to retrieve the charset.
2022-02-12LibC: Stub out fmemopen()Ali Mohammad Pur
2022-02-12LibPthread: Add PTHREAD_CANCELEDAli Mohammad Pur
This is just the expected return value of pthread_join() when it fails.
2022-02-12LibWeb: Add support for 'arraybuffer' message types on WebSocketsserenitydev
2022-02-12LibWeb: Ignore malformed at-rules in CSS parserGuilherme Gonçalves
Fixes #12405.
2022-02-12LibWebSocket: Don't try to send empty payload inside of frameDerpyCrabs
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-12LibHTTP: Make reason phrase of HTTP response's status line optionalDerpyCrabs
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-12LibHTTP: Remove redundant can_read_without_blocking callWesley Moore
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-12LibHTTP: Remove attempt to read extra line after response headersWesley Moore
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-11LibWeb: Rename Layout::Box absolute rect helpersAndreas Kling
- padded_rect() -> absolute_padding_box_rect() - bordered_rect() -> absolute_border_box_rect()
2022-02-11LibWeb: Remove unused functions from Layout::BoxAndreas Kling
2022-02-11LibWeb: Clear the path of a SVGPathElement if the attribute changesSam Atkins
Otherwise, modifying the `d` attribute would not cause any visual changes to the path.
2022-02-11LibWeb: Make SVG AttributeParser::parse_path_data() staticSam Atkins
This is mostly a style thing, but it matches the other APIs.
2022-02-11LibWeb: Use StringView instead of String in SVG::AttributeParserSam Atkins
This saves copying the string data, since the AttributeParser is always temporary.
2022-02-11LibWeb: Add SVG `<polygon>` element and test case :^)Sam Atkins
2022-02-11LibWeb: Add SVG `<polyline>` element and test case :^)Sam Atkins
2022-02-11LibWeb: Add SVG `<line>` element and test case :^)Sam Atkins
2022-02-11LibWeb: Add SVG `<ellipse>` element and test case :^)Sam Atkins
2022-02-11LibWeb: Add SVG `<circle>` element and test case :^)Sam Atkins
2022-02-11LibWeb: Add SVG `<rect>` element and test case :^)Sam Atkins
2022-02-11LibGfx: Add Path::[horizontal,vertical]_path_to()Sam Atkins
The SVG spec describes some path operations using these, so we might as well have them. :^)
2022-02-11LibWeb: Expose SVG length/coordinate parsing methodsSam Atkins
This is all still quite ad-hoc. Eventually these will both need to support units (like with CSS Lengths) but for now we can continue only using numbers.