Age | Commit message (Collapse) | Author |
|
DOM elements don't always have a corresponding layout node. This fixes a
crash soon after loading the Steam store.
|
|
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/ :^)
|
|
Introducing for_each_spanned_track that allows to iterate tracks
spanned by a specific items allow to delete a lot of repeated code.
|
|
|
|
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 :)
|
|
|
|
Otherwise base_size and growth_limit for tracks that do not have any
spanning items will be overriden with wrong values.
|
|
Let's match the name used in the spec.
|
|
Implements "Otherwise, if the free space is an indefinite length:" from
the spec.
|
|
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). :^)
|
|
When negating a number, we should subtract it from 0, not 1. :^)
|
|
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.
|
|
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.
|
|
Use inner height since the paintable adds padding back.
Fixes #18842.
|
|
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.
|
|
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.
|
|
Otherwise, returning "no" here will disallow the browser process from
showing a context menu, as the event handler will bail early.
|
|
|
|
|
|
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.
|
|
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.
|
|
Changed here:
https://github.com/whatwg/fetch/commit/018ac19838ade92324a1900113636a8bf98f3a1b
|
|
There is not need to run layout inside grid items for intrinsic sizing
of grid container.
|
|
specified_size_suggestion() should use width or height depending on
specified dimension.
|
|
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.
|
|
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%. :^)
|
|
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.
|
|
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
|
|
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.
|
|
|
|
|
|
Removes unrelated to the code copy paste from spec (sometimes
duplicated).
|
|
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.
|
|
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
|
|
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.
|
|
This change brings calculate_minimum_contribution() for grid items and
supporting functions.
|
|
|
|
This will be used by performance.measure to read the value of a given
entry in the NavigationTiming interface.
|
|
This implements the substeps which concern HTMLMediaElement parents.
|
|
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.
|
|
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.
|
|
automatic_content_width() should return grid container width that is
supposed to be set by determine_intrinsic_size_of_grid_container().
|
|
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.
|
|
This solves the issue when track with "fixed" min sizing function were
treated like "auto" during sizing.
|
|
|
|
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.
|
|
This first pass is enough to get us:
- Image loading via fetch
- Source selection via srcset and sizes attributes
|
|
Also comes with a little extra CSS parser helper for parsing "sizes"
attributes in images.
|
|
|
|
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.
|