Commit graph

126 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
Martin Robinson
e81951a973
layout: Remove the obsolete layout tracing functionality (#35001)
There were two kinds of layout tracing controlled by the same debugging
option:

 - modern layout: Functionality that dumped a JSON serialization of the
   layout tree before and after layout.
 - legacy layout: A scope based tracing that reported the process of
   layout in a structured way.

I don't think anyone working on layout is using either of these two
features. For modern layout requiring data structure to implement
`serde` serialization is incredibly inconvenient and also generates a
lot of extra code.

We also have a more modern tracing functionality based on perfetto that
we have started to use for layout and IMO it's actually being used and
more robust.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-15 13:24:14 +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
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
Martin Robinson
882a855b8c
Convert layout to use Gecko's alignment style representation (#32790)
Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Nico Burns <nico@nicoburns.com>
2024-07-17 14:18:55 +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
Martin Robinson
e9281e2eda
build(deps): bump bitflags from 1.3.2 to 2.3.1 (#30273)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.3.2 to 2.3.1.
 - [Release notes](https://github.com/bitflags/bitflags/releases)
 - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
 - [Commits](https://github.com/bitflags/bitflags/compare/1.3.2...2.3.1)
2023-09-01 09:58:48 +00:00
Emilio Cobos Álvarez
7d30a7da75 Servo build fixes. 2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
est31
3efc5e59bc Remove unused code from gfx and layout crates 2019-05-29 21:51:28 +02:00
Emilio Cobos Álvarez
44ae191e72 Fix servo build. 2019-02-23 21:05:34 -08: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
Anthony Ramine
a92dd09fc9 Remove FlexFlowDisplayListBuilding 2019-01-14 16:10:26 +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
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +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
349047b096 Rustfmt layout crate 2018-09-01 13:24:57 +02:00
Emilio Cobos Álvarez
895946bb18
layout: script: Fix build. 2018-06-23 20:34:10 +02:00
Emilio Cobos Álvarez
744809a8b2
style: Add support for 'flex-basis:content' in the style system.
Bug: 1105111
Reviewed-by: xidorn
MozReview-Commit-ID: 5WhgHJJ0mDB
2018-04-02 03:17:56 +02:00
Pyfisch
ea062e6e47 Create own file for background calculations in layout
Move display_list_builder.rs and webrender_helpers.rs
along with the new file to components/layout/display_list/

Remove apparently unused IdType enum.
Only variant used was OverflowClip.

See #19676
2018-01-06 20:19:32 +01:00
Matt Brubeck
c60cfc5a9f Turn flow::base and friends into methods 2017-12-14 12:16:45 -06:00
Emilio Cobos Álvarez
af879523ea
style: Make all keywords CamelCase for consistency.
This prevents confusion and paves the ground for derive(Parse) of them.
2017-12-06 02:35:10 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Simon Sapin
b505c9e948 Introduce an unsafe HasBaseFlow trait for base()/base_mut() casts. 2017-10-14 00:03:57 +02:00
bors-servo
b2df99cb65 Auto merge of #18462 - mrobinson:cleanup-building-state, r=emilio
Do some minor cleanups in display list building

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18462)
<!-- Reviewable:end -->
2017-09-15 05:30:47 -05: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
Martin Robinson
ee46bc57ed Separate stacking context collection and display list building state
These are two different passes during layout, but previously they
shared a state object. While some of the members are the same, many are
different so we separate them out into two separate objects. We also
change the HashMaps of these state objects to use the FnvHashMap.
2017-09-12 17:15:06 +02:00
bors-servo
7e363d60bb Auto merge of #18175 - stshine:no-floats-in-flexbox, r=mbrubeck
layout: Stop call normal block size assignment for flex container

No need to call the `assign_block_size_block_base()` method of normal block in flex.rs since it is implemented for CSS2.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14813 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18175)
<!-- Reviewable:end -->
2017-08-29 19:15:59 -05:00
Pu Xingyu
9103743d0c layout: Stop calling normal block size assignment for flex container
No need to call the `assign_block_size_block_base()` method of normal
block since it is implemented for CSS2.
2017-08-29 01:30:09 +08:00
bors-servo
163f29ff63 Auto merge of #18243 - DominoTree:18224, r=stshine
[18224] Check if line_count is zero to calculate space around line

<!-- Please describe your changes on the following line: -->
Check line_count before attempting to calculate space around line

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18224 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because changes are minimal and the error was triggered by a test

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18243)
<!-- Reviewable:end -->
2017-08-26 17:07:28 -05:00
Nick Price
684816bfb3 Check if line_count is zero to calculate space around line 2017-08-26 12:48:07 -04:00
Keith Yeung
1df72ba935 Remove border collapse argument from compute_border_and_padding 2017-08-25 23:41:55 -07:00
Martin Robinson
57704b0481 Improve containing block creation for position:absolute flows
Instead of only promoting flows with positioned fragments to containing
blocks, also do this for flows which have the transform, perspective or
filter properties set. This is what the spec requires and also fixes
some failing tests. It will allow us to stop creating stacking contexts
for overflow:hidden and overflow:scroll flows.

Fixes #18091.
2017-08-17 20:46:27 +02:00
Simon Sapin
b5a4b8d6a0 Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) 2017-08-15 14:10:44 +02:00
Matt Brubeck
a08bc13df9 Rename compute_absolute_position to compute_stacking_relative_position 2017-08-08 10:53:17 -07:00
Boris Chiou
4cc97746f2 Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.
NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink.
GreaterThanOrEqualToOneNumber: for stroke-miterlimit.

MozReview-Commit-ID: Kgbt99BPdVA
2017-08-04 14:21:21 +08:00