summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
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-17LibWeb: Resolve CSS custom properties on pseudo elementsAndreas Kling
The resolved property sets are stored with the element in a per-pseudo-element array (same as for pseudo element layout nodes). Longer term, we should stop storing this with elements entirely and make it temporary state in StyleComputer somehow, so we don't waste memory keeping all the resolved properties around. This makes various gradients show up on https://shopify.com/ :^)
2023-05-17LibWeb: Add for_each_spanned_track to iterate spanned tracks in GFCAliaksandr Kalenik
Introducing for_each_spanned_track that allows to iterate tracks spanned by a specific items allow to delete a lot of repeated code.
2023-05-17LibWeb: Consider span > 1 while getting available space for items in GFCAliaksandr Kalenik
2023-05-17LibWeb: Remove borders from TemporaryTrack in GFCAliaksandr Kalenik
This change makes grid items be responsible for their borders instead of grid tracks which can not have borders itself. There are changes in layout tests but those are improvements :)
2023-05-17LibWeb: Use auto minimimum size while resolving flexible tracks in GFCAliaksandr Kalenik
2023-05-17LibWeb: Skip non-spanning items sizing if there are no such itemsAliaksandr Kalenik
Otherwise base_size and growth_limit for tracks that do not have any spanning items will be overriden with wrong values.
2023-05-17LibWeb: Rename flexible_length to flex_factor in GridSizeAliaksandr Kalenik
Let's match the name used in the spec.
2023-05-17LibWeb: Implement more of "Expand Flexible Tracks" in GFCAliaksandr Kalenik
Implements "Otherwise, if the free space is an indefinite length:" from the spec.
2023-05-17LibWeb: Support flex-basis: calc(...)Andreas Kling
1. Propagate calc() values from StyleProperties to ComputedValues. 2. Actually resolve calc() values when determining the used flex basis. This makes the "support" section on https://shopify.com/ show up correctly as a 2x2 grid (instead of 1x4). :^)
2023-05-17LibWeb: Fix off-by-one in CSS calc() "negate" operationAndreas Kling
When negating a number, we should subtract it from 0, not 1. :^)
2023-05-16LibWeb: Make text justification work between floatsAndreas Kling
While inline content between floating elements was broken correctly, text justification was still using the original amount of available space (without accounting for floats) when justifying fragments.
2023-05-16LibWeb: Rewrite calculation of available space between floatsAndreas Kling
This code now works in terms of *intrusion* by left and right side floats into a given box whose insides we're trying to layout. Previously, it worked in terms of space occupied by floats in the root box of the BFC they participated in. That created a bunch of edge cases since the code asking about the information wasn't operating in root coordinate space, but in the coordinate space of some arbitrarily nested block descendant of the root. This finally allows horizontal margins in the containing block chain to affect floats and nested content correctly, and it also allows us to remove a bogus workaround in InlineFormattingContext.
2023-05-16LibWeb: Fix for absolutely positioned elements with specified heightAndi Gallo
Use inner height since the paintable adds padding back. Fixes #18842.
2023-05-16LibWeb+WebContent: Add APIs to control video playback stateTimothy Flynn
This allows for the browser process to control the play/pause state, whether we paint user agent controls on the video, and whether the video loops when it finishes playing.
2023-05-16Browser+LibWeb+WebContent: Broadcast video element context menu requestsTimothy Flynn
This just sets up the IPC to notify the browser process of context menu requests on video elements. The IPC contains a few pieces of information about the state of the video element.
2023-05-16LibWeb: Propagate non-primary mouse button clicks on video elementsTimothy Flynn
Otherwise, returning "no" here will disallow the browser process from showing a context menu, as the event handler will bail early.
2023-05-16LibWeb: Implement location.assignLuke Wilde
2023-05-16LibWeb: Skip frozen tracks while distributing space in GFCAliaksandr Kalenik
2023-05-16LibWeb: Reset item_incurred_increase before distributing space in GFCAliaksandr Kalenik
item_incurred_increase should be reset before every next distirbution because otherwise it will accumulate increases from previous distributions which is not supposed to happen.
2023-05-15LibWeb: Basic support for CSS `text-indent: <length-percentage>`Andreas Kling
Note that this simple form of text-indent only affects the first line of formatted content in each block. Percentages are resolved against the width of the block.
2023-05-15LibWeb: Make `processBodyError` take an optional exceptionSam Atkins
Changed here: https://github.com/whatwg/fetch/commit/018ac19838ade92324a1900113636a8bf98f3a1b
2023-05-15LibWeb: Do not layout grid items during grid container intrinsic sizingAliaksandr Kalenik
There is not need to run layout inside grid items for intrinsic sizing of grid container.
2023-05-15LibWeb: Fix specified_size_suggestion to use size of dimensionAliaksandr Kalenik
specified_size_suggestion() should use width or height depending on specified dimension.
2023-05-15LibWeb: Fix UBSAN issue caused by invalid TemporaryTrack pointer in GFCAliaksandr Kalenik
Fixes the issue when if there are enough rows/column to force m_row_gap_tracks or m_column_gap_tracks be resized during gaps initialization then pointers stored in m_grid_columns_and_gaps or m_grid_rows_and_gaps become invalid.
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-15LibWeb: Fix iframes flickering on window resizeAndreas Kling
After finishing layout, iframe layout boxes (FrameBox) get notified about their new size by LayoutState::commit(). This information is forwarded to the nested browsing context, where it can be used for layout of the nested document. The problem here was that we notified the FrameBox twice. Once when assigning the used offset to its paintable, and once when assigning its size. Because the offset was assigned first, we ended up telling the FrameBox "btw, your size is 0x0". This caused us to throw away all the layout information we had for the nested document. We'd then say "actually, your size is 300x200" (or something) but by then it was already too late, and we had to do a full relayout. This caused iframes to flicker as every time their containing document was laid out, we'd nuke the iframe layout and redo it (on a zero timer). The fix is pleasantly simple: we didn't need to inform the nested document of its offset in the containing document's layout anyway. Only its size is relevant. So we can simply remove the first call, which removes the bogus 0x0 temporary size. Note that iframes may still flicker if they change size in the containing document. That's a separate issue that will require more finesse to solve. However, this fixes a very noticeable common case.
2023-05-14LibWeb: Start implementing sizing for tracks with span > 1 items in GFCAliaksandr Kalenik
Partially implements: - Increase sizes to accommodate spanning items crossing content-sized tracks - Increase sizes to accommodate spanning items crossing flexible tracks from https://www.w3.org/TR/css-grid-2/#algo-content
2023-05-14LibWeb: Separate grid tracks from gaps in GFCAliaksandr Kalenik
This change is supposed to solve the problem that currenty when grid tracks are interleaved with gaps it is impossible to iterate tracks spanned by a specific grid item. There is a pair of functions: gap_adjusted_row() and gap_adjusted_column() but they won't work when it comes to items spanning > 1 track. Separating gaps from tracks is going to make it possible to iterate just tracks or both tracks and gaps when it is required. And now tracks spanned by an item can be accessed by just index without doing any additional math.
2023-05-14LibWeb: Make the dblclick event bubble, cancelable and composedLuke Wilde
2023-05-14LibWeb: Remove unused line in calculate_min_content_size() in GFCAliaksandr Kalenik
2023-05-14LibWeb: Remove excessive spec referencing in GridFormattingContextAliaksandr Kalenik
Removes unrelated to the code copy paste from spec (sometimes duplicated).
2023-05-14LibWeb: Remove dead code in resolve_intrinsic_track_sizes() in GFCAliaksandr Kalenik
Removes partially implemented algorithm for distributing extra space from spanning item: https://www.w3.org/TR/css-grid-2/#extra-space This algorithm should not be part of resolving track sizing on its own but instead be a subfunction of step 3: https://www.w3.org/TR/css-grid-2/#track-size-max-content-min There are changes in layout tests but those are not regressions.
2023-05-14LibWeb: Change implicit background-size height to autoRimvydas Naktinis
The spec says: "The first value gives the width of the corresponding image, the second value its height. If only one value is given the second is assumed to be auto." Fixes #18782
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: Flesh out basic support of min-width/height for grid itemsAliaksandr Kalenik
This change brings calculate_minimum_contribution() for grid items and supporting functions.
2023-05-13LibWeb: Implement performance.{measure,clearMeasures}Luke Wilde
2023-05-13LibWeb: Specify snake case names for navigation timing entries tooLuke Wilde
This will be used by performance.measure to read the value of a given entry in the NavigationTiming interface.
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: Change Document::parse_url to accept a StringViewTimothy Flynn
There's no need for this to require a DeprecatedString - the method it wraps around already only expects a StringView. This allows passing a String instance without any conversion.
2023-05-13LibWeb: Return grid container width from automatic_content_width in GFCAliaksandr Kalenik
automatic_content_width() should return grid container width that is supposed to be set by determine_intrinsic_size_of_grid_container().
2023-05-13LibWeb: Implement grid container intrinsic sizes calculationAliaksandr Kalenik
When a width/height constraint is applied to GFC it should set its own width/height to the sum of track sizes according to the spec. Changes in layout tests are improvement over what we had before.
2023-05-13LibWeb: Fix condition to determine auto tracks while sizing in GFCAliaksandr Kalenik
This solves the issue when track with "fixed" min sizing function were treated like "auto" during sizing.
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.