Commit graph

195 commits

Author SHA1 Message Date
Simon Wülker
3d320fa96a
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-03 11:26:53 +00:00
Euclid Ye
28cea920ec
layout: Merge BoxFragment::used_overflow into ComputedValuesExt::effective_overflow (#35670) (#35670)
* Update wpt-test



* Merge used_overflow to effective_overflow; remove duplicate call



* Remove more duplicate calls; update effective_overflow logic



* Update reference link&style



* Apply final review suggestions

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-03-02 21:44:59 +00:00
Euclid Ye
64e227005f
Update sensitivity naming in DisplayList::new (#35694)
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-02-27 12:22:26 +00:00
Simon Wülker
be6765447d
Update to rust 1.85 (#35628)
* Update to rust 1.85

This is needed for cargo-deny

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Upgrade crown

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Clippy fixes

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Re-upgrade cargo-deny to 0.18

Keeping it locked to 0.18 just in case they
update their required rustc version again

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-02-24 17:44:35 +00:00
Euclid Ye
03fc54e682
layout: Implement overflow scroll support for different axes (#35414)
* layout: Add AxesScrollSensitivity to enable control of scroll in axis

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout_2013: Be compatible with AxesScrollSensitivity

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout: update struct AxesScrollSensitivity to euclid::Vector2D

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* display_list: implement From<Overflow> for ScrollSensitivity

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout: simplify and reuse scroll related logic

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout_2013: simplify and reuse scroll related logic

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout, layout_2013: revert AxesScrollSensitivity to pair struct

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout: Reimport ComputedOverflow as #35103 depends on it

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout: Add AxesOverflow to replace PhysicalVec

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout: implement scroll of viewport for different axes

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* layout: explicitly handle overflow match

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* Update components/shared/webrender/Cargo.toml

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-02-14 08:14:57 +00:00
Oriol Brufau
3d9e7a95e0
layout: Remove BoxFragment::overflow_clip_rect() (#35443)
It had a single caller, and the relevant data was passed as parameters
because the caller needed it too. It seems simpler to just remove it
and inline the code into the caller.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-02-13 15:08:17 +00:00
batu_hoang
8c46749740
Implement overflow:clip (#35103)
* Implement overflow clip

Signed-off-by: longvatrong111 <longvatrong111@gmail.com>

* Modify test ini for overflow clip

Signed-off-by: longvatrong111 <longvatrong111@gmail.com>

* Update overflow_clip_rect calculation

Signed-off-by: batu_hoang <longvatrong111@gmail.com>

* Update overflow-clip-margin border-radius according to shadow box

Signed-off-by: longvatrong111 <longvatrong111@gmail.com>

---------

Signed-off-by: longvatrong111 <longvatrong111@gmail.com>
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
Signed-off-by: batu_hoang <55729155+longvatrong111@users.noreply.github.com>
2025-02-12 07:02:06 +00:00
Martin Robinson
643885e6f1
deps: Upgrade to webrender@0.66 (#35325)
In addition to some small API changes, this downstream version of
WebRender no longer depends on a very old version of time. This is the
last step toward removing the dependency on `time0.1`.

The review for this commit should also include: 9f552bebab

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-07 11:57:26 +00:00
batu_hoang
01eeb3e809
Add border radius to overflow scrollable frame (#35293)
Signed-off-by: longvatrong111 <longvatrong111@gmail.com>
2025-02-05 21:45:14 +00:00
Oriol Brufau
fdbfecf7dd
Upgrade Stylo to 2025-02-03 (#35289)
* Upgrade Stylo to 2025-02-03

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

* Fixup for https://phabricator.services.mozilla.com/D233218

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

* Fixup for https://phabricator.services.mozilla.com/D233758

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

* Fixup for https://phabricator.services.mozilla.com/D231255

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>
2025-02-05 02:35:58 +00:00
Oriol Brufau
27c40fcd29
layout: Don't let table grid boxes inherit display: inline-table (#35264)
The outer display type of a table element applies to the table wrapper
box. The table grid box needs to be block-level as defined in
https://drafts.csswg.org/css-tables/#table-grid-box

Therefore this sets `display: table` on table grid boxes, and then when
painting collapsed table borders we can use the usual logic to compute
the StackingContextSection.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-02-03 17:11:49 +00:00
Oriol Brufau
7301af8468
layout: Fix painting order of collapsed table borders (#35219)
In #35075 I painted them in front of the decorations (backgrounds and
borders) of any block-level box in the same stacking context. I did that
because other browsers paint them in front of the decorations of the
descendants of the table, but my approach also painted them in front of
decorations of following siblings of the table, which was wrong.

This patch makes it so that collapsed table orders are painted in the
same step as decorations. However, tables defer painting their collapsed
borders after the decorations of their descendants.

This matches Blink and WebKit, and brings us closer to Gecko (which is
slightly different in some corner cases).

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-02-03 14:46:40 +00:00
Oriol Brufau
3122de08f3
Let resolve_color() take its parameter by reference (#35247)
Bumps Stylo to https://github.com/servo/stylo/pull/116

This way the callers don't have to clone it if they don't have ownership
or want to use the value later.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-31 23:34:40 +00:00
Oriol Brufau
38847d4991
layout: Correctly resolve currentcolor on collapsed borders (#35163)
If a collapsed border has the `currentcolor` color, we were resolving it
using the color of the table. Now we resolve it using the color of the
box which owns the border that wins and becomes the collapsed border.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-27 19:58:18 +00:00
Oriol Brufau
aa54a0b1a6
layout: simplify CollapsedBorderLine (#35125)
This used to be a struct that had a list of `CollapsedBorder`s, and the
maximum border width among that list.

However, this cached maximum border width was only used when resolving
the borders of the table. Therefore, for all grid lines except the first
and last ones per axis, this data was useless.

Also, in order to address #35123 I plan to retroactively zero out some
collapsed borders, which could invalidate this cache.

So this patch just removes the field and turns `CollapsedBorderLine`
into an alias of `Vec<CollapsedBorder>`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-23 12:38:24 +00:00
Martin Robinson
102b77aef8
Make naming of variables consistent with SpecificLayoutInfo (#35104)
This is a followup to #34926.

Fixes #35078.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-21 17:28:14 +00:00
Oriol Brufau
a54add0159
layout: Fix border widths of table wrapper with collapsed borders (#35097)
For a table wrapper in collapsed-borders mode we were just halving the
border widths from the computed style. However, it needs to actually
receive half of the resulting collapsed border, which can be bigger.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-21 15:14:17 +00:00
Oriol Brufau
d00d76c1e8
layout: Paint collapsed table borders on their own (#35075)
We were previously splitting collapsed borders into two halves, and then
paint each one as part of the corresponding cell. This looked wrong when
the border style wasn't solid, or when a cell spanned multiple tracks
and the border wasn't the same for all of them.

Now the borders of a table wrapper, table grid or table cell aren't
painted in collapsed borders mode. Instead, the resulting collapsed
borders are painted on their own.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-21 13:10:27 +00:00
Oriol Brufau
9b388da9cb
layout: Fix clientWidth & friends for tables (#35096)
`clientWidth` shouldn't include the borders of a box. The problem was
that we pretend that table wrapper boxes have the border specified on
the table element, even though this border actually applies to the
table grid box instead of the table wrapper box.

Therefore, `clientWidth` was wrong when it subtracted the borders.
This patch fixes it.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-20 17:18:20 +00:00
Martin Robinson
de780dcde4
layout: Make Fragment hold ArcRefCell inside (#34923)
Push the interior mutability into enum variants of `Fragment`, so that
they can be cloned. This saves memory in the `Fragment` tree as the
`Fragment` enum is now a relatively wee 16 bytes and the interior parts
can be a variety of sizes. Before, every `Fragment` was the size of the
biggest kind (`BoxFragment` - 248 bytes).

This a step on the way toward incremental layout.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-01-13 09:59:59 +00:00
Oriol Brufau
e2be55b873
layout: Improve painting of collapsed borders in table layout (#34933)
This is still not the right approach, because we are not painting
collapsed borders as a single thing. Instead, we are splitting them
into two halves and paint each half on a different cell. This only
looks good for solid borders.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-01-11 00:38:31 +00:00
Martin Robinson
621ddd749c
Elide lifetimes where possible after rustup (#34824)
The new version of rust allows us to elide some lifetimes and clippy is
now complaining about this. This change elides them where possible and
removes the clippy exceptions.

Fixes #34804.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-03 18:54:44 +00:00
Martin Robinson
3e052676ef
script: Manage <iframe> sizes in Window (#34643)
Manage `<iframe>` size updates in `Window`. In addition to removing
duplicated code, this will allow setting `<iframe>` sizes synchronously
on child `Pipeline`s of the same origin in the script process in a
followup change. The goal is remove flakiness from `<iframe>` sizing.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-16 15:05:33 +00:00
Nico Burns
63793ccbb7
Use webrender_api::units::DevicePixel rather than 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>
2024-11-25 23:42:04 +00:00
Martin Robinson
c11e0e8e70
layout: Add a hit test item that covers all scroll frame contents (#34347)
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>
2024-11-24 19:04:57 +00:00
Delan Azabani
caf2467649
Set all tracing spans to trace level for now (#34256)
* 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>
2024-11-19 02:53:43 +00:00
atbrakhi
85a9ca7cb6
layout: Add instrumentation for display_list (#34128)
* 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>
2024-11-08 09:05:07 +00:00
eri
01820e2a8a
Improve how intrinsic sizes work for videos (#31746)
* 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>
2024-10-29 22:42:22 +00:00
Martin Robinson
d5554235fe
layout: Add support for mix-blend-mode: plus-lighter (#34057)
This just requires translating the style value into a WebRender value.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-29 17:50:33 +00:00
Noble Chinonso
c550a70f5c
clippy: fix using clone() warning in components\layout_2020\display_list\mod.rs:1365:25 (#33935)
Signed-off-by: Noble <nobleuwuja@gmail.com>
2024-10-21 05:54:22 +00:00
Oriol Brufau
c75f6627ba
Upgrade Stylo to 2024-10-04 (#33767)
* 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>
2024-10-20 19:53:38 +00:00
Martin Robinson
bd632fc814
layout: Add support for object-fit and object-position (#33479)
This also makes a couple small improvements:
 - Rename `IntrinsicSizes` to `NaturalSizes` which reflects more
   modern spec language.
 - Move the conversion of Stylo's `ImageRendering` to WebRender's
   version to a `ToWebRender` trait implementation.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-09-18 06:20:28 +00:00
Simon Wülker
7df30f3788
Replace .map_or(false with Option::is_some_and (#33468)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-16 10:03:52 +00:00
atbrakhi
f76692035b
uses app units in display_list (#33420)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-13 10:49:59 +00:00
Oriol Brufau
52f89c95b9
Fix inset box-shadow to use the padding box (#33433)
As specified in https://drafts.csswg.org/css-backgrounds-3/#shadow-shape

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-13 10:47:50 +00:00
Oriol Brufau
9175e598ad
Let table-related boxes adjust their overflow values (#33400)
The `overflow` property doesn't apply to table track and track groups,
and table elements only accept a few `overflow` values.

Therefore, this patch adds an `effective_overflow()` method to get the
actual value that needs to be used.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-11 15:30:17 +00:00
Martin Robinson
027fc53e2f
layout: Right-to-left support for other layout modes (#33375)
This change removes the `effective_writing_mode` concept and tries to
properly implement right-to-left layout support for all non-inline
writing modes. In general, what needs to happen is that rectangles
need to be converted to physical rectangles using the containing block.
A right-to-left rectangle's inline start is on the right physical side
of the containing block. Likewise a positive inline offset in
right-to-left text is a negative physical one.

The implementation here is pretty good for most layout modes, but floats
are still a bit in process. Currently, floats are processed in the
logical layout of the block container, but there still might be issues
with float interaction with mixed RTL and LTR.

While this does move us closer to supporting vertical writing modes,
this is still unsupported.

New failures:
 - Vertical writing mode not supported:
   - `/css/CSS2/floats/floats-placement-vertical-001b.xht`
   - `/css/CSS2/floats/floats-placement-vertical-001c.xht`
 - Absolutes inlines should avoid floats (#33323)
   - `/css/css-position/position-absolute-dynamic-static-position-floats-004.html`
 - No support for grid
   - `/css/css-align/self-alignment/self-align-safe-unsafe-grid-003.html`
   - `/css/css-position/static-position/inline-level-absolute-in-block-level-context-009.html`
   - `/css/css-position/static-position/inline-level-absolute-in-block-level-context-010.html`
 - Cannot reproduce these locally on any platform. Very mysterious:
   - `/css/css-tables/row-group-margin-border-padding.html`
   - `/css/css-tables/row-margin-border-padding.html`
 - Exposes bugs we have related to hanging whitespace in preserved
   whitespace inlines:
   - `/css/css-text/white-space/trailing-space-and-text-alignment-rtl-003.html`
   - `/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-023.html`

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-09-11 13:40:11 +00:00
atbrakhi
095590e224
layout: Use Au in ComputedValuesExt (#33396)
* Use app unit in `ComputedValuesExt`

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: atbrakhi <atbrakhi@igalia.com>

* Some miscellaneous fixes

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* remove redundant defination of `containing_block_inline_size`

Signed-off-by: atbrakhi <atbrakhi@igalia.com>

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-10 21:35:17 +00:00
Martin Robinson
e70507ca40
tidy: Fix rustdoc warnings and add a tidy check for a common URL issue (#33366)
This change fixes all rustdoc errors and also adds a tidy check for a
very common rustdoc URL issue. Eventually rustdoc warnings should likely
cause the build to fail, but this catches those issues sooner in order
to not waste so much developer time.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-08 15:04:19 +00:00
Chocolate Pie
590527176e
layout: Add initial support for clip-path: [<basic-shape> || <shape-box>] (#33107)
* Turn on clip-path tests and add results

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* enhance: Add support for `clip-path: [<basic-shape> || <shape-box>]`

Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>

* Changes from review

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-28 15:00:34 +00:00
Martin Robinson
0d94a8acd2
layout: Prepare for bidi by guarding all access to writing-mode (#33082)
We want to selectively enable right-to-left writing modes per layout
context. This change makes that possible by allowing access to
`writing-mode` though an interface that always returns the default
horizontal top-to-bottom (implicitly left-to-right) writing mode.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-08-16 11:38:04 +00:00
Josh Matthews
3d3621b652
Update stylo for latest changes. (#33079)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-16 10:47:12 +00:00
Martin Robinson
d941d2fd67
layout: Convert the FragmentTree to physical geometry (#33030)
This converts all geometry in the FragmentTree into physical geometry,
doing conversions ahead of time instead of when traversing the fragment
tree. This is necessary to properly implement BiDi in Servo as we need
to know what side borders are on in mixed RTL and LTR contexts.

In addition, fragments are laid out in a particular context and only
that context knows its writing mode. There were issues where were using
one writing mode to lay out and another to convert to phyisical
coordinates. This isn't an issue now since we only use the default
writing mode, but starts to be an issue with BiDi text.

Closes #25564.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-14 12:22:06 +00:00
Ashwin Naren
ea5cf75169
clippy: Fix various clippy warnings throughout the code (#33003)
* replace u64::max_value() with u64::MAX

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed redundant import

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* Fixed dereference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* Fixed a probable bug

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed dereference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* dereference formatting

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed unnessicary number imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed unnessicary number imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed excess borrow

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* ran mach fmt

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed doc comment

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed deref on an immutable reference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed minor syntax error

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* reverted clamping

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* formatting

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* reverted final clamp

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Ashwin Naren <ashwin@pixelators.org>
2024-08-13 05:16:47 +00:00
Martin Robinson
564ba5969f
layout: Non-auto z-index should always make stacking contexts for flex items (#32961)
Fixes #32756.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-12 12:15:20 +00:00
Martin Robinson
f1602005a0
deps: Upgrade to WebRender 0.65 (#32930)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-05 14:35:21 +00:00
Martin Robinson
e23dc0bf6f
layout: Port border-image support for legacy layout (#32874)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-30 06:41:23 +00:00
atbrakhi
d9b99723f5
Remove unused ToWebRender implementation (#32729) 2024-07-08 16:10:34 +00:00
Martin Robinson
4b63043c6a
clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674) 2024-07-04 14:18:58 +00:00
atbrakhi
4357751f28
use au in TextFragment (#32653) 2024-07-03 07:27:08 +00:00