summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
AgeCommit message (Collapse)Author
2023-05-17LibWeb: Null-check layout node before dereferencing in HTMLVideoElementAndreas Kling
DOM elements don't always have a corresponding layout node. This fixes a crash soon after loading the Steam store.
2023-05-16LibWeb: Implement location.assignLuke Wilde
2023-05-15LibWeb: Make `processBodyError` take an optional exceptionSam Atkins
Changed here: https://github.com/whatwg/fetch/commit/018ac19838ade92324a1900113636a8bf98f3a1b
2023-05-15LibWeb: Cache state of the contenteditable attribute on HTMLElementAndreas Kling
Instead of recomputing the state whenever someone asks for it, we now cache it when the attribute is added/changed/removed. Before this change, HTMLElement::is_editable() was 6.5% of CPU time when furiously resizing Hacker News. After, it's less than 0.5%. :^)
2023-05-14LibWeb: Protect against dereferencing a null pending image requestAndreas Kling
The spec seems to neglect the potential nullity of an image's pending request in various cases. Let's protect against crashing and mark these cases with a FIXME about figuring out whether they are really spec bugs or not.
2023-05-13LibWeb: Implement performance.{measure,clearMeasures}Luke Wilde
2023-05-13LibWeb: Partially implement HTMLSourceElement's insertion/removal stepsTimothy Flynn
This implements the substeps which concern HTMLMediaElement parents.
2023-05-13LibWeb: Implement the HTMLMediaElement child <source> selection stepsTimothy Flynn
Rather than setting the src attribute on the HTMLMediaElement, websites may append a list of HTMLSourceElement nodes to the media element. There is a series of "try the next source" steps to attempt to fetch/load each source until we find one that works.
2023-05-13LibWeb: Let HTMLImageElement delay the document load event againAndreas Kling
2023-05-13LibWeb: Don't force HTMLImageElement to have a legacy ImageLoaderAndreas Kling
We achieve this by adding a new Layout::ImageProvider class and having both HTMLImageElement and HTMLObjectElement inherit from it. The HTML spec is vague on how object image loading should work, which is why this first pass is focusing on image elements.
2023-05-13LibWeb: Implement enough of "update the image data" to load imagesAndreas Kling
This first pass is enough to get us: - Image loading via fetch - Source selection via srcset and sizes attributes
2023-05-13LibWeb: Add a class to represent the "source set" concept from HTMLAndreas Kling
Also comes with a little extra CSS parser helper for parsing "sizes" attributes in images.
2023-05-13LibWeb: Add class to represent "list of available images" from HTML specAndreas Kling
2023-05-13LibWeb: Start fleshing out HTML "image requests" and "image data"Andreas Kling
This patch adds HTML::ImageRequest and HTML::DecodedImageData. The latter had to use a different name than "ImageData", as there is already an IDL-exposed ImageData class in HTML.
2023-05-12LibWeb: Implement fetching classic scripts using Fetch infrastructureTimothy Flynn
2023-05-12LibWeb: Implement the fetch a classic script AOTimothy Flynn
Note that this unfortunately requires the same workaround as <link> elements to handle CORS cross-origin responses.
2023-05-12LibWeb: Change the script fetch completion callback to accept any scriptTimothy Flynn
The completion callback currently only accepts a JavaScriptModuleScript. The same callback will need to be used for ClassicScript scripts as well so allow the callback to accept any Script type. The single existing outside caller already stores the result as a Script.
2023-05-12LibWeb: Implement the CORS settings attribute credentials mode AOTimothy Flynn
2023-05-09LibWeb: Broadcast the viewport rect to clients immediately after layoutAndreas Kling
This lets elements figure out if they're visible within the viewport or not, so they take appropriate action. Fixes the issues with animations not starting until the viewport was resized or scrolled.
2023-05-08LibWeb: Convert Navigable::navigate's csp_navigation_type to an enumTimothy Flynn
Some versions of clang will have an issue using a consteval function to set the optional parameter's default value. For example, see: https://stackoverflow.com/questions/68789984/immediate-function-as-default-function-argument-initializer-in-clang This doesn't need to be a String anyways, so let's make it an enum.
2023-05-08LibWeb: Implement "populate session history entry" step in navigate()Aliaksandr Kalenik
Implements https://html.spec.whatwg.org/multipage/browsing-the-web.html#finalize-a-cross-document-navigation
2023-05-08LibWeb: Implement "clear the forward session history" for traversableAliaksandr Kalenik
https://html.spec.whatwg.org/multipage/browsing-the-web.html#clear-the-forward-session-history
2023-05-08LibWeb: Make HTMLObjectElement invalidate the document layoutAndreas Kling
This is an oversized hammer for sure, but we have to make sure the layout tree gets rebuilt in case the object representation changes. Since "throw out the entire layout tree" is the finest tool we have right now, it'll have to do. This fixes an issue where the eyes on Acid2 would sometimes not show up until the next layout invalidation occurred.
2023-05-08LibWeb: Don't include Layout/Node.h from DOM/Element.hAndreas Kling
This required moving the CSS::StyleProperty destruct out of line.
2023-05-08LibWeb: Don't include HTML/Window.h from DOM/Element.hAndreas Kling
This required moving HTML::ScrollOptions to its own header file.
2023-05-07LibWeb: Add fast_is<T>() helper for HTMLScriptElementAndreas Kling
This makes loading Google Groups quite a bit faster, as 20% of runtime while loading was spent asking if DOM nodes are HTMLScriptElement.
2023-05-07Everywhere: Change spelling of 'behaviour' to 'behavior'Ben Wiederhake
"The official project language is American English […]." https://github.com/SerenityOS/serenity/blob/5d2e9156239cd707a22ecea6c87d48e5fc1cbe84/CONTRIBUTING.md?plain=1#L30 Here's a short statistic of the occurrences of the word "behavio(u)r": $ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n 2 BEHAVIOR 24 Behaviour 32 behaviour 407 Behavior 992 behavior Therefore, it is clear that "behaviour" (56 occurrences) should be regarded a typo, and "behavior" (1401 occurrences) should be preferred. Note that The occurrences in LibJS are intentionally NOT changed, because there are taken verbatim from the specification. Hence: $ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n 2 BEHAVIOR 10 behaviour 24 Behaviour 407 Behavior 1014 behavior
2023-05-06LibWeb: Propagate errors from parse_css_value and property_initial_valueSam Atkins
2023-05-06LibWeb: Propagate errors from StyleValue constructionSam Atkins
Turns out we create a lot of these, mostly from places that don't return ErrorOr. The yak stack grows.
2023-05-04LibWeb: Use JS::SafeFunction for module fetching callbacksAndreas Kling
This fixes another GC crash seen on https://shopify.com/ Found it by collecting garbage after every 500th heap allocation.
2023-05-04LibWeb: Pause HTMLMediaElement when its document becomes inactiveTimothy Flynn
For example, when navigating to another page, this ensures any media resource will not continue playing.
2023-05-04LibWeb: Implement steps for removing an HTMLMediaElement from a documentTimothy Flynn
2023-05-04LibWeb: Make module maps GC-allocatedAndreas Kling
This allows them to mark JS modules, and fixes a crash seen on https://shopify.com/
2023-05-03LibWeb: Implement "create navigation params from a srcdoc resource"Aliaksandr Kalenik
Implements: https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-from-a-srcdoc-resource This is supporting function for populating document in session history entry. This function populates navigation params response with HTML text passed in document resource.
2023-05-03LibWeb: Implement "create navigation params by fetching"Aliaksandr Kalenik
Implements: https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-by-fetching This is supporting function for population of document in a session history entry. This function populates response in navigation params by fetching url in navigation params and handling redirects if required.
2023-05-03LibWeb: Implement "attempt to populate the history entry's document"Aliaksandr Kalenik
Implements: https://html.spec.whatwg.org/multipage/browsing-the-web.html#attempt-to-populate-the-history-entry's-document This is going to be a replacement for `FrameLoader::load()` after switching to navigables. Brief description of `populate_session_history_entry_document`: - If navigation params have url with fetch scheme then DOM document will be populated by fetching url and parsing response. This is going to be a replacement for `FrameLoader::load(AK::URL&)`. - If url in navigation params is abort:srcdoc then DOM document will be populated by parsing HTML text passed in document resource. This is going to be a replacement for `FrameLoader::load_html()`
2023-05-03LibWeb: Reuse ReferrerType from Fetch in HTML::DocumentStateAliaksandr Kalenik
2023-05-03LibWeb: Add fetch_controller property in HTML::NavigationParamsAliaksandr Kalenik
2023-05-03LibWeb: Add navigable property in NavigationParamsAliaksandr Kalenik
2023-05-03LibWeb: Change id to be optional in HTML::NavigationParamsAliaksandr Kalenik
2023-05-03LibWeb: Fix typo in HTML::DocumentStateAliaksandr Kalenik
ever_navigable_target_name -> navigable_target_name
2023-05-03LibWeb: Add resource property in DocumentStateAliaksandr Kalenik
2023-05-03LibWeb: Add request_body property in HTML::POSTResourceAliaksandr Kalenik
2023-05-03LibWeb: Introduce SourceSnapshotParamsAliaksandr Kalenik
2023-05-02LibWeb: Support multi-keyword syntax for CSS display propertyEmil Militzer
The Display class already supported all specific values, and now they will be parsed too. The display property now has a special type DisplayStyleValue.
2023-04-30LibJS+LibWeb: Explicitly mark ignored members in visit_edges methodsMatthew Olsson
2023-04-30LibJS+LibWeb: Add missing visit calls in visit_edges implementationsMatthew Olsson
2023-04-30LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objectsMatthew Olsson
2023-04-30LibWeb: Add missing JS::GCPtr wrappers in HTMLLinkElementMatthew Olsson
2023-04-28LibWeb: Implement "get all used history steps" for traversablesAliaksandr Kalenik
https://html.spec.whatwg.org/multipage/browsing-the-web.html#getting-all-used-history-steps