aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020
Commit message (Collapse)AuthorAgeFilesLines
...
* Use `webrender_api::units::DevicePixel` rather than ↵Nico Burns2024-11-251-2/+2
| | | | | | | | | | | | | | | `style_traits::DevicePixel` unless interfacing with Stylo (#34353) * Use webrender_api::units::DevicePixel rather than style_traits::DevicePixel unless interfacing with Stylo Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix OpenHarmony build Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Avoid laying out grid items and generating fragments if only inline size is ↵Nico Burns2024-11-251-6/+21
| | | | | | | | | | | | | | | requested (#34352) * Layout: Short-circuit grid item layout if only inline size is requested Signed-off-by: Nico Burns <nico@nicoburns.com> * Layout: Avoid creating grid item fragments if only size is requested Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Refine logic for laying out flex item in column layout after #34346 (#34372)Oriol Brufau2024-11-252-25/+15
| | | | | | | | | | | - Clamp the stretch size to not be negative when the sum of padding, borders and margins exceed the available space. This avoids a 2nd layout. - Avoid computing the inline content sizes if the result isn't needed. - Instead of clamping both the min-content and max-content sizes to be between the min and max constraints, just compute the fit-content size first, and then clamp. Then `ContentSizes::map()` can be removed. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Remove some unused dependencies (#34355)Jonathan Schwender2024-11-251-2/+1
| | | | | | | | | | | | | | | * Remove unused deps This doesn't seem to remove any deps from the workspace. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * ohos: Remove gaol dependency Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* layout: Add a hit test item that covers all scroll frame contents (#34347)Martin Robinson2024-11-242-48/+95
| | | | | | | | | When building scroll frames, add a special `StackingContextContent::Fragment` type for a hit test that covers all scroll frame contents. This makes it so that you don't have to be hovering over actual content to scroll the scroll frame. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Remove unnecessary clone in layout (#34350)Nico Burns2024-11-231-1/+1
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* Improve performance of column flexboxes (#34346)Oriol Brufau2024-11-221-2/+10
| | | | | | | | | If a flex item in a single-line column flex container stretches, then we can know its final size. So instead of first laying it out using its intrinsic inline size, and then stretching it later, we can use the correct size from the very beginning. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Layout: Implement CSS Grid using `taffy` (#32619)Nico Burns2024-11-2114-109/+1497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add layout.grid.enabled pref Signed-off-by: Nico Burns <nico@nicoburns.com> * Add taffy dependency Signed-off-by: Nico Burns <nico@nicoburns.com> * Import taffy <-> stylo conversion code from taffy_stylo crate Signed-off-by: Nico Burns <nico@nicoburns.com> * Add `Grid` variant to DisplayInside Signed-off-by: Nico Burns <nico@nicoburns.com> * Implement CSS Grid using Taffy Signed-off-by: Nico Burns <nico@nicoburns.com> Import full stylo_taffy crate Signed-off-by: Nico Burns <nico@nicoburns.com> Squashed PR feedback changes Deduplicate is_document_only_whitespace Signed-off-by: Nico Burns <nico@nicoburns.com> Import taffy::AvailableSpace Signed-off-by: Nico Burns <nico@nicoburns.com> Rename FlexContext to TaffyContainerContext Signed-off-by: Nico Burns <nico@nicoburns.com> Eliminate references to flexbox in taffy/layout module Signed-off-by: Nico Burns <nico@nicoburns.com> Use constructors for geom types Signed-off-by: Nico Burns <nico@nicoburns.com> Remove comment about abspos elements splitting contiguous text runs Signed-off-by: Nico Burns <nico@nicoburns.com> Remove reference to flexbox in taffy/construct Signed-off-by: Nico Burns <nico@nicoburns.com> Deduplicate construction of flexbox/grid containers Signed-off-by: Nico Burns <nico@nicoburns.com> Make anonymous text runs InFlow Signed-off-by: Nico Burns <nico@nicoburns.com> Remove commented code Signed-off-by: Nico Burns <nico@nicoburns.com> Update comments Signed-off-by: Nico Burns <nico@nicoburns.com> Inline/vendor the stylo/taffy interop code Signed-off-by: Nico Burns <nico@nicoburns.com> * Update test expectations Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix nits from PR review Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Upgrade Stylo to 2024-11-01 (#34322)Oriol Brufau2024-11-211-2/+6
| | | | | | | | | | | | | | | | | * Upgrade Stylo to 2024-11-01 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D224747 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Update test expectations Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Remove the containing_block parameter from TableLayout::layout_caption (#34297)Oriol Brufau2024-11-201-16/+5
| | | | | | It was only used for the style, but the containing block of the caption is the table wrapper box, whose style is stored in `self.table.style`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Set all tracing spans to trace level for now (#34256)Delan Azabani2024-11-195-10/+19
| | | | | | | | | | | | | * Clean up tracing instrumentation Signed-off-by: Delan Azabani <dazabani@igalia.com> * Set all tracing spans to trace level for now Signed-off-by: Delan Azabani <dazabani@igalia.com> --------- Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Fix min/max-content block size of replaced element (#34284)Oriol Brufau2024-11-181-28/+27
| | | | | | | | | | | | The min-content and max-content sizes on the block axis depend on the inline size. But when computing the SizeConstraint corresponding to the inline axis, we were resolving the preferred inline size ignoring intrinsic keywords. Now we will only ignore `auto`. Also, this patch refactors the logic to compute the min-content and max-content block sizes after fully resolving the inline size. This avoids having to resolve the inline sizing properties twice. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Use `Size::FitContent` when the alignment isn't `normal` or ↵tanishka2024-11-181-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `stretch` for absolutely positioned elements (#34264) * layout: Use Size::FitContent when the alignment isn't normal or stretch Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Use unwrap_or_default() Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Use self.alignment.value() Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Refactor used_size to handle non-definite sizes Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Include AlignFlags::Auto Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Update test expectations Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Fix offsetLeft/offsetTop to match major browsers (#32761)Nico Burns2024-11-161-19/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix offsetLeft/offsetTop to match major browsers See: https://github.com/w3c/csswg-drafts/issues/10549 Signed-off-by: Nico Burns <nico@nicoburns.com> Fix crash when <html> element is absolutely positioned Signed-off-by: Nico Burns <nico@nicoburns.com> * Update test expectations Signed-off-by: Nico Burns <nico@nicoburns.com> * Update test expectations again Signed-off-by: Nico Burns <nico@nicoburns.com> * Use PhysicalRect and PhysicalVec types Signed-off-by: Nico Burns <nico@nicoburns.com> * Use is_some_and Signed-off-by: Nico Burns <nico@nicoburns.com> * clippy Signed-off-by: Nico Burns <nico@nicoburns.com> * Apply comment changes from code review Co-authored-by: Oriol Brufau <obrufau@igalia.com> Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Protect against arithmetic underflow in TableBuilder::current_y() (#34247)Oriol Brufau2024-11-141-20/+34
| | | | | | It doesn't seem like any web page could trigger the underflow, but this makes the code more robust. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Support justify-self on absolutely positioned elements (#34235)chickenleaf2024-11-131-1/+1
| | | | | | | | | | | | | * Support justify-self on absolutely positioned elements Signed-off-by: L Ashwin B <lashwinib@gmail.com> * updating test expectations Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Use a RwLock to cache inline_content_sizes() (#34232)Oriol Brufau2024-11-139-74/+76
| | | | | | | | | | | In order to support size keywords in block layout, we may need to call `inline_content_sizes()` in order to compute the min/max-content sizes. But this required a mutable reference in order the update the cache, and in various places we already had mutable references. So this switches the cache into a RwLock to avoid needing mutable refs. Note OnceCell wouldn't work because it's not thread-safe. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Add `BoxFragment::is_inline_box()` (#34233)Oriol Brufau2024-11-123-10/+10
| | | | | A helper function to check for inline boxes. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Use LazyCells instead of callbacks when resolving size keywords (#34211)Oriol Brufau2024-11-114-78/+75
| | | | | | | | | | In most cases we already had a LazyCell anyways, since we could need the value for multiple properties. Instead of passing a callback that forces the evaluation of the LazyCell, it's simpler to just pass the LazyCell directly. Also, this way we no longer need mutable references. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix inline content sizes of intrinsic element with indefinite block size ↵Oriol Brufau2024-11-1110-278/+297
| | | | | | | | | | | | | | | | | (#34152) To compute the min-content and max-content inline sizes of a replaced element, we were only using the aspect ratio to transfer definite block sizes resulting from clamping the preferred block size between the min and max block sizes. However, if the preferred block size is indefinite, then we weren't transfering the min and max through the aspect ratio. This patch adds a `SizeConstraint` enum that can represent these cases, and a `ConstraintSpace` struct analogous to `IndefiniteContainingBlock` but with no inline size, and a `SizeConstraint` block size. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Fix caching of streching flex items in row flex (#34162)Martin Robinson2024-11-081-5/+12
| | | | | | | | | | | When a flex item stretches in the cross axis in a row flex, the flex container layout should depend on block constraints. In this case the cross axis is the block axis (assuming horizontal writing modes -- vertical are not yet supported). This changes fixes an issue where the cached layout was used in this case when stretching should trigger a new layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add instrumentation for `display_list` (#34128)atbrakhi2024-11-083-0/+20
| | | | | | | | | | | | | | | | | * Add instrumentation for display_list Signed-off-by: atbrakhi <atbrakhi@igalia.com> * review update Signed-off-by: atbrakhi <atbrakhi@igalia.com> * review fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> --------- Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* layout: Clean up the flexible length resolution algorithm (#34153)Martin Robinson2024-11-061-93/+142
| | | | | | | | Instead of doing so much zipping, which is confusing, create a temporary data structure for each item that holds all relevant information. In addition, add detailed specification text so it is easier to understand what is going on. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement keyword sizes for replaced elements (#34091)Oriol Brufau2024-11-054-82/+151
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Properly calculate free space in flexbox flexible length resolution ↵Martin Robinson2024-11-051-6/+5
| | | | | | | | | | | | | | (#34150) Previously, when there were no more violations, the returned value for line free space was incorrect for flexible length resolution. It was returning the container main space minus the inner length of each item. Free space is determined by the outer length though. Fix this by reusing the `free_space()` function, but with an argument indicating that all items are now frozen. Fixes #34079. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add parallel layout to flexbox (#34132)Martin Robinson2024-11-051-170/+180
| | | | | | | | | | | | | | This adds parallelism using rayon to the initial layout of flex lines and line item. There is still no support for parallelism when laying out line items again to account for stretch. This can be done in a followup change. In addition, the array of data for each line item is collected into a new structure, `FlexLineItem`. This prevents a lot of needless zipping of iterators at the expense of some new vector allocations. A folluwup change can likely unify this structure and `FlexItemLayoutResult` though that will require a larger refactor. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Remove an obselete comment from flexbox (#34148)Martin Robinson2024-11-051-5/+0
| | | | | This behavior is handled properly in `style_ext.rs`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Replace ComputedValues with WritingMode on IndefiniteContainingBlock (#34090)Oriol Brufau2024-11-049-82/+70
| | | | | We only need the writing mode, not the entire computed style. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Remove unnecessary clamping in used_size_as_if_inline_element() (#34114)Oriol Brufau2024-11-031-10/+4
| | | | | | | | We don't need to floor the preferred box sizes to be at least zero, since `used_size_as_if_inline_element_from_content_box_sizes()` will take care of applying min and max constraints, and the min has been floored to be at least zero. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Unify sizing logic for replaced elements (#34076)Oriol Brufau2024-11-011-167/+65
| | | | | | | | | | | | | | | | The logic varied quite a bit depending on the case, now it's unified. This also fixes the following case where the iframe was 150px tall instead of 50px: ```html <iframe style="min-width: 400px; max-height: 50px"></iframe> ``` This also modifies video-intrinsic-width-height.html to expect the new behavior that we share with Blink and WebKit. In fact WebKit already modified this test but forgot to export the change upstream. Firefox is different but it was already failing anyways. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Use default object size as fallback for intrinsic size of replaced element ↵Oriol Brufau2024-10-311-15/+22
| | | | | | | (#34084) Instead of falling back to zero. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Properly handle fallback aspect ratio for videos (#34082)Oriol Brufau2024-10-311-15/+15
| | | | | | | | | | | | | | | | | | A `<video>` element with no source won't have a natural aspect ratio, but `aspect-ratio: auto` should still fall back to a ratio of 300/150. `used_size_as_if_inline_element_from_content_box_sizes()` was already handling this, but other consumers of `preferred_aspect_ratio()` were wrong. In particular, this resulted in a 0px wide inline-block: ```html <div style="display: inline-block; border: solid"> <video style="height: 100px; background: cyan"></video> </div> ``` So this patch moves the fallback into `preferred_aspect_ratio()`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix geometry queries for floats and replaced inlines (#34083)Oriol Brufau2024-10-311-2/+5
| | | | | APIs like `clientWidth` were returning zero. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Properly transfer min/max constraints on auto-sized replaced elements (#34026)Oriol Brufau2024-10-301-114/+31
| | | | | | | | | | | | | We were following CSS2, which didn't handle `aspect-ratio`. This patch simplifies the logic and handles it correctly. Unfortunately this makes 2 tests fail, but I'm pretty sure they aren't spec-compliant. I'm leaving them as-is for now since they are part of interop-2021, and Gecko, Blink and WebKit pass them (because of some non-interoperable incorrect behaviors). I'm adding a new test that is fully passed by Servo and WebKit. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Improve how intrinsic sizes work for videos (#31746)eri2024-10-295-57/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: patch for video layout sizes added rebase from main 2024/10/05 Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: eri <epazos@igalia.com> * feat: take width and height parameters if provided Signed-off-by: eri <epazos@igalia.com> * chore: tidy the code and update test expectations Signed-off-by: eri <epazos@igalia.com> * feat: handle removing poster Signed-off-by: eri <epazos@igalia.com> * chore: update test expectations and remove debug code Signed-off-by: eri <epazos@igalia.com> * fix: issues after rebasing to main Signed-off-by: eri <epazos@igalia.com> * feat: pass src remove test and tidy Signed-off-by: eri <epazos@igalia.com> * chore: clippy fixes Signed-off-by: eri <epazos@igalia.com> * chore: update passing test expectations Signed-off-by: eri <epazos@igalia.com> * fix object-position-svg test Signed-off-by: eri <epazos@igalia.com> * fix unintentional override of video size and resize events Signed-off-by: eri <epazos@igalia.com> * change how resize events are sent to better match the spec Signed-off-by: eri <epazos@igalia.com> * simplify poster mutation handling Co-authored-by: Oriol Brufau <obrufau@igalia.com> Signed-off-by: eri <eri@inventati.org> * improved handling of intrinsic sizes - differentiate between natural size and css size - presentational attributes - fallback ratio for video element - handle more cases where the src/poster are added/removed - aspect ratio hints Signed-off-by: eri <epazos@igalia.com> * update test expectations Signed-off-by: eri <epazos@igalia.com> * fix cleaning current frame Signed-off-by: eri <epazos@igalia.com> * update test expectations Signed-off-by: eri <epazos@igalia.com> * Apply suggestions from code review Co-authored-by: Oriol Brufau <obrufau@igalia.com> Signed-off-by: eri <eri@inventati.org> * More code review suggestions Signed-off-by: eri <epazos@igalia.com> * Prevent aspect-ratio:auto from pulling the ratio from the default object size As resolved in https://github.com/w3c/csswg-drafts/issues/7524#issuecomment-1204462924 Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: eri <epazos@igalia.com> Signed-off-by: eri <eri@inventati.org> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add support for `mix-blend-mode: plus-lighter` (#34057)Martin Robinson2024-10-291-0/+1
| | | | | This just requires translating the style value into a WebRender value. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement keyword sizes for intrinsic contributions (#33854)Oriol Brufau2024-10-261-38/+88
| | | | | | Correctly handle keyword sizes when computing the min-content or max-content contribution of a box. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Avoid crash in replaced layout, and fix behavior for non-auto aspect-ratio ↵Oriol Brufau2024-10-251-8/+8
| | | | | | | | | (#34006) Also, it was assuming that the aspect ratio would work with the content box dimensions, but that isn't the case for `aspect-ratio: <ratio>` with `box-sizing: border-box`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Avoid layout sometimes when stretching (#33967)Martin Robinson2024-10-2412-257/+490
| | | | | | | | | | | | | | | | | | | | This is the second flexbox caching change. It seeks to detect when a relayout can be avoided in the case of a stretching flex item. This heuristic can be combined, because currently we still do relayout sometimes when we do not need to. For instance currently we always relayout when a flex child is itself a column flex. This only needs to happen when the grandchildren themselves grow or shrink. That optimization is perhaps a lower priority as `flex-grow: 0 / flex-shrink: 1` is the default behavior for flex. Since this change means we more consistenly zero out the percentage part of `calc` expressions when they have circular dependencies, this causes one test to start failing (`/css/css-values/calc-min-height-block-1.html`). This is related to w3c/csswg-drafts#10969, which is pending on further discussion in the working group. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Consistent resolution of cyclic percentages in min sizing properties (#33988)Oriol Brufau2024-10-242-43/+54
| | | | | | | | | | | | | | | The spec says that cyclic percentages in min sizing properties should be resolved against zero when computing intrinsic contributions. We were already doing that in the inline axis, but we were treating the entire expression as `auto` in the block axis. With this patch we will follow the spec in both axes. But note that browsers don't follo the spec in either axis, so we may have to revisit (see https://github.com/w3c/csswg-drafts/issues/10969). calc-min-height-block-1.html now fails because it tests what browsers do instead of what the spec says. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Implement keyword sizes on absolute/fixed positioned elements (#33950)Oriol Brufau2024-10-222-47/+72
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Cache content block size contributions (#33964)Martin Robinson2024-10-223-10/+57
| | | | | | | | This is the first part of caching intermediary layout during flexbox layout. A later change will try to reuse these layouts, when possible, for actual item layout and re-layout due to stretching. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Prevent `stretch` from producing a negative size (#33951)Oriol Brufau2024-10-221-2/+3
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Replaced mem::replace with mem::take for old_min_size (#33959)chickenleaf2024-10-211-1/+1
| | | Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* CI: Fail the lint job when cargo-clippy reports some warnings (#33941)tanishka2024-10-211-1/+1
| | | | | | | | | | | | | | | | | | | * Fail the lint job when cargo-clippy reports some warnings Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Remove todo comment Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * clippy: use Option::take instead of mem::replace Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Refactor positioned layout (#33922)Oriol Brufau2024-10-212-254/+197
| | | | | | | | | | | | | | | This unifies the size resolution into AbsoluteAxisSolver, since it needs to know the size in order to resolve auto margins correctly anyways. This will allow adding support for sizing keywords in a follow-up patch. Also, this avoids doing multiple layouts due to min and max constraints, improving performance. Additionally, tables may end up having a custom size, different than what we would expect by just looking at the sizing properties. This patch ensures that we resolve margins correctly with the final size, resulting in 2 tests now passing. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* clippy: fix explicit lifetime warning in ↵Noble Chinonso2024-10-211-2/+2
| | | | | components\layout_2020\style_ext.rs:320:20 (#33936) Signed-off-by: Noble <nobleuwuja@gmail.com>
* clippy: fix using clone() warning in ↵Noble Chinonso2024-10-211-4/+4
| | | | | components\layout_2020\display_list\mod.rs:1365:25 (#33935) Signed-off-by: Noble <nobleuwuja@gmail.com>
* Upgrade Stylo to 2024-10-04 (#33767)Oriol Brufau2024-10-206-37/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Upgrade Stylo to 2024-10-04 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D220285 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://bugzilla.mozilla.org/show_bug.cgi?id=1918093 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222817 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222856 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222532 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222533 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D222534 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D223878 Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Remove BoxFragment::overconstrained (#33907)Oriol Brufau2024-10-192-71/+16
| | | | | | | | This was only used for serializing inset properties in getComputedStyle, but it was unnecessary and the logic was wrong anyways: an `auto` size doesn't imply that we won't be overconstrained, because it won't become negative even if the insets are big enough. Signed-off-by: Oriol Brufau <obrufau@igalia.com>