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
Oriol Brufau
9597390d2b
Enable min-content, max-content, fit-content and stretch ( #33492 )
...
For the sizing properties.
We don't actually support them yet, just treating them as
the initial value.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-20 14:48:27 +00:00
Oriol Brufau
17f796dfc1
Let LengthPercentage::maybe_to_used_value()
accept Option<Au>
( #33450 )
...
Bump Stylo to servo/stylo#75 and remove conversions that are no longer
necessary.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-16 08:08:54 +00:00
eri
a6e25d555b
clippy: Fix warnings in components/layout
( #31612 )
...
* clippy: fix warnings in components/layout
* fix: formatting
2024-03-11 10:24:36 +00:00
Oriol Brufau
f7ead9bcb6
Lint layout_2013 with clippy ( #31221 )
...
* Lint layout_2013 with clippy
CARGO_BUILD_RUSTC=rustc cargo clippy --fix -p layout_2013 --broken-code
* ./mach fmt
* Cosmetic adjustments
2024-01-30 11:46:35 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) ( #30325 )
...
* strict imports formatting
* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
711dbbd4af
remove extern crate
( #30311 )
...
* remove extern crate
* Update components/script_plugins/lib.rs
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
---------
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-09-08 12:11:31 +00:00
Emilio Cobos Álvarez
7d30a7da75
Servo build fixes.
2019-12-16 14:23:56 +01:00
Anthony Ramine
4444c5a2ad
Import victor's layout system 🍷
2019-09-11 10:36:30 +02:00
Emilio Cobos Álvarez
c2819365f0
style: Rename MozLength to Size, and MaxLength to MaxSize.
...
MozLength is not a very descriptive name. If we're going to use it in both Gecko
and Servo we may as well name it something more accurate.
I would've chosen `ContentSize` per CSS2[1][2] if it wasn't a lie in presence
of box-sizing. I don't have better ideas than `Size`, given that.
[1]: https://drafts.csswg.org/css2/visudet.html#propdef-width
[2]: https://drafts.csswg.org/css2/box.html#content-width
Differential Revision: https://phabricator.services.mozilla.com/D19280
2019-02-12 02:28:00 +01:00
Emilio Cobos Álvarez
6daebcc5df
Fix servo build.
2019-02-10 07:23:51 +01:00
Emilio Cobos Álvarez
2a6cdaa30a
Rustfmt recent changes.
2019-01-08 12:01:28 +01:00
Emilio Cobos Álvarez
c7f30ad0df
style: Fix servo build.
2019-01-08 12:01:11 +01:00
Emilio Cobos Álvarez
4a31509215
style: Fix servo build.
...
This also fixes a bunch of calc handling issues and such.
Also remove tests that no longer compile and are covered by WPT.
2019-01-08 12:00:42 +01:00
Simon Sapin
be69f9c3e6
Rustfmt has changed its default style :/
2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4)
2018-11-19 14:47:27 +01:00
Pyfisch
9e92eb205a
Reorder imports
2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6
Format remaining files
2018-11-06 22:30:31 +01:00
Simon Sapin
76e59a46d3
Sort use
statements
2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee
cargo fix --edition
2018-11-06 15:26:02 +01:00
Pyfisch
d9b1950d74
Layout: Remove redundant deny unsafe and format
...
Add license to two files.
Bypass DisplayListBuilder for some items.
2018-10-22 16:15:48 +02:00
Pyfisch
2ff330a5c9
Split layout/background.rs file
...
Have background, border and gradient modules
for calculation functions.
Use shorter names for functions that are qualified
by the module name like `border::radii`.
Use push_item and push_iter to add items to WebRender.
2018-10-22 16:15:46 +02:00
Pyfisch
349047b096
Rustfmt layout crate
2018-09-01 13:24:57 +02:00
Simon Sapin
897a5b39c5
Fix some "unnecessary parentheses" warnings
2018-01-22 17:41:25 +01:00
Pyfisch
8a57bff59d
Remove mention of some old issues
...
* #228 was done (confirmed by mbrubeck)
* #2012 fixed TODO item
* servo/webrender#28 (zoom does work)
2018-01-04 20:31:41 +01:00
Martin Robinson
f37fa0cf6d
Update WR to use the new sticky positioning API
2017-10-30 10:15:30 +01:00
Emilio Cobos Álvarez
2ac1327e4b
style: Make border-spacing serialization consistent, and move it to precomputed_type.
2017-09-17 21:33:17 +02:00
Boris Chiou
b89286e8e7
Use CSSPixelLength in LengthOrPercentage{*}.
...
Replace Au with CSSPixelLength in LengthOrPercentage,
LengthOrPercentageOrAuto, and LengthOrPercentageOrNone.
2017-09-13 18:10:46 +08:00
Boris Chiou
5c2d8507be
Implement to_transform_3d_matrix for computing distance of mismatched transform lists.
...
We could use this method to convert a TransformList into a Matrix, and
use this matrix for computing distance for Stylo and rendering the transform
for Servo.
This is an equivalent of nsStyleTransformMatrix::ReadTransforms in Gecko.
2017-08-25 18:25:14 +08:00
Clément DAVID
c5fe235112
order derivable traits lists
...
Ignoring :
- **generated**.rs
- python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Manish Goregaokar
808b1f509b
stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it
2017-07-17 18:02:25 -07:00
Anthony Ramine
608e7f71a2
Make computed types hold Percentage instead of bare CSSFloat
2017-06-15 16:59:03 +02:00
Nicolas Silva
8617320500
Bump euclid to 0.14.
2017-06-14 16:00:59 +02:00
Anthony Ramine
862fc4f88d
Rename BorderRadiusSize to BorderCornerSize
2017-05-29 00:58:53 +02:00
Anthony Ramine
af3ede418b
Refactor BorderRadius and move it to the border modules
...
BorderRadius now parses itself reusing Rect<T>.
2017-05-28 14:36:37 +02:00
Anthony Ramine
d0b9bd9c64
Refactor how calc() clamping is done on computed values ( fixes #15296 )
2017-05-18 10:14:59 +02:00
Simon Sapin
8c9e5d9f9d
Fix future illegal_floating_point_literal_pattern warnings.
...
They make component/style fail to build, because of `#[deny(warnings)]`
2017-05-12 16:12:17 +02:00
Emilio Cobos Álvarez
c9ab75b013
layout: Fix radius percentage resolution.
...
By resolving against the corresponding dimension of the border box, instead of
against the width.
Fixes #16764
2017-05-08 11:48:29 +02:00
Ravi Shankar
0249270f61
Create a module for generics and make BorderRadiusSize generic
2017-04-25 17:13:41 +05:30
石博文
22f99c71b9
Add to_computed method for CalcLengthOrPercentage
...
* Add to_computed method to calculate `calc()` value with parent size,
if parent container size is `None`, the result will be `None`.
* Add from_option method for `MaybeAuto`, to construct from
`Option<Au>`.
* Update some test case.
2017-04-24 14:22:14 +08:00
Shing Lyu
4b2d80afcf
Activate flexbox layout tracing
2016-12-28 15:31:45 +08:00
Pu Xingyu
d3ab919745
Add new methods to Fragment for size calculation of replaced element
...
These new methods calculate both the used width and height of an
replaced element and the same time. The `has_intrinsic_ratio()` method
also exposes information about whether a fragment has intrinsic aspect
ratio.
2016-12-12 15:37:12 +08:00
Pu Xingyu
39780e894b
Rename the MinMaxConstraint to SizeConstraint and enhancement
...
Renamed to `SizeConstraint`, add an optional `border` parameter to
deal with `box-sizing: border-box`, and fix its bug when involving
with `calc`.
2016-12-11 00:54:00 +08:00
Pu Xingyu
eb22d33d4e
style: Add a "start_end()" method to LogicalMargin
...
Add a `LogicalMargin::start_end()` method that receives a `Direction'
parameter. This is useful for some layout that is symmetric in inline
and block directions, like flexbox.
2016-11-10 19:17:29 +08:00
Pu Xingyu
7f721e1f2c
layout: Mark flex items properly during construction
...
Set the flag of the fragment of children in a flex container according
to the direction of the container. The mark is done on the fragment
because flex item enstablish a stacking context when its z-index is
non-zero ,despite its `position' property.
2016-11-09 08:24:12 +08:00
Shing Lyu
8bea421329
Migrated -Z trace-layout to serde_json
2016-11-07 15:54:07 +08:00
Emilio Cobos Álvarez
bdf1d179ba
layout: Use the fragment's writing mode when computing sizes relevant to that fragment.
...
Otherwise we might mix writing modes. Not totally sure this change is correct in
the case we're mixing them, we might need to just not checking that operation.
2016-10-02 17:57:07 +02:00
Anthony Ramine
51768844ed
Update euclid to 0.10.1
2016-08-21 03:03:45 +02:00
Martin Robinson
6259df5e2d
Update to euclid 0.8
2016-08-12 03:12:06 +02:00
Pu Xingyu
7df5974456
Rename enum 'Mode' to 'Direction'
...
Rename the 'Mode' enum to 'Direction' and move it to 'model.rs', thus it
can be used to indicate logical direction.
2016-07-24 14:58:02 +08:00