Commit graph

424 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
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
Oriol Brufau
61ca2dde29
Upgrade Stylo to 2024-12-04 (#34501)
* Upgrade Stylo to 2024-12-04

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

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

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>
2024-12-06 01:05:54 +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
6be99241c6
Fix warnings after latest rust upgrade (#33043)
This fixes various unused code warnings after the recent rust upgrade.
Some of the dead code is maintained, as it is quite likely that it will
be used in future changes.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-14 07:00:16 +00:00
danik292
5d6840873a
clippy: Fix missing indentation in comments and remove on unecessary cast (#33026)
* Add missing indendations in comments.

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>

* Fix test tidy error

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>

---------

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>
2024-08-13 11:28:09 +00:00
Martin Robinson
569fd5d8b5
Upgrade stylo to 2024-07-16 (#32812)
* Upgrade stylo to 2024-07-16

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

* Use the new `dom` crate from stylo

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

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-07-24 14:37:08 +00:00
Martin Robinson
3398fc017b
Move non-gfx things out of gfx_traits and create a base crate (#32296)
For a long time, `gfx_traits` has held a lot of things unrelated to graphics
and also unrelated to the `gfx` crate (which is mostly about fonts).
This is a cleanup which does a few things:

1. Move non `gfx` crate things out of `gfx_traits`. This is important in
   order to prevent dependency cycles with a different integration between
   layout, script, and fonts.
2. Rename the `msg` crate to `base`. It didn't really contain anything
   to do with messages and instead mostly holds ids, which are used
   across many different crates in Servo. This new crate will hold the
   *rare* data types that are widely used.

Details:

 - All BackgroundHangMonitor-related things from base to a new
   `background_hang_monitor_api` crate.
 - Moved `TraversalDirection` to `script_traits`
 - Moved `Epoch`-related things from `gfx_traits` to `base`.
 - Moved `PrintTree` to base. This should be widely useful in Servo.
 - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it
   to `WebRenderFontApi`.
2024-05-17 12:28:58 +00:00
Oriol Brufau
5acfce5b89
Upgrade Stylo to 2023-12-01 (#32032)
* Upgrade Stylo to 2023-12-01

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

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

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

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

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

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

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

* Update test expectations
2024-04-10 13:03:56 +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
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
2024-01-22 13:13:48 +00:00
Delan Azabani
66258bfbbd
Temporarily convert existing cfg(debug_assertions) crashes to warnings (#30578) 2023-10-18 13:16:11 +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
Wu Yu Wei
f5a3d282fb Actually check if root is absolute positioned 2022-04-19 17:43:43 +08:00
Wu Yu Wei
b978f83e52 Add trace logs when assigning inline/block sizes 2022-04-17 16:18:32 +08:00
Emilio Cobos Álvarez
ef16c5844f Rustfmt recent changes. 2019-12-16 14:23:56 +01:00
Emilio Cobos Álvarez
7d30a7da75 Servo build fixes. 2019-12-16 14:23:56 +01:00
Paul Rouget
0ea9f69ca8 layout: Ensure abs-pos elements establish block formatting contexts 2019-11-14 12:16:23 +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
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
fc75719ff2 Remove BlockFlowDisplayListBuilding
Replaced by inherent methods on BlockFlow, the only implementor of that trait.
2019-01-14 10:37:41 +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
Shotaro Yamada
c44a2febe6 Remove redundant .clone()s 2018-12-11 10:43:51 +09: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
bors-servo
3961e8d1eb
Auto merge of #19184 - bobthekingofegypt:fix/18706-abs-image-with-padding, r=mbrubeck
fix block size for absolute replaced element

Absolutely replaced elements with padding were incorrectly setting their
block size to include twice the padding values.  This attempts to stop
that extra padding for replaced elements but leave the working flow for
non replaced elements

<!-- 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 #18706 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/19184)
<!-- Reviewable:end -->
2018-07-13 20:18:27 -04:00
Emilio Cobos Álvarez
895946bb18
layout: script: Fix build. 2018-06-23 20:34:10 +02:00
Pyfisch
c0be925bed Move DL items from gfx to layout
Implement corner clipping.
Remove PixelFormat from WebrenderImageInfo.
Use WebRender text shadow.
Remove MallocSizeOf and Deserialize for DL items.

Closes #19649, #19680, #19802
2018-04-22 13:13:45 +02:00
Martin Robinson
e100a72122 Stop using LocalClip::RoundedRect
We would like to remove this functionality from WebRender, so convert
its use to clip scroll nodes. This change also removes the redundant
BlocBlockStackingContextType in favor of Option<StackingContextType>,
which is just as expressive. This simplifies the code a bit.
2018-03-06 21:26:22 +01:00
Manish Goregaokar
265a2ab2cc Allow for build_display_list to be called immutably 2018-02-16 16:01:48 -08:00
Manish Goregaokar
db6ec58e6b Generate display lists for table cells during display list generation for their table parent 2018-02-16 16:01:46 -08:00
Manish Goregaokar
f3531d1d35 Factor out BlockFlow::background_border_section() 2018-02-16 16:01:44 -08:00
janczer
661d234c3c Change debug assertions to specific ones 2018-02-07 09:21:24 +01:00
Pyfisch
af52233ae5 Introduce MaxRect trait
It is implemented for LayoutRect and Rect<Au>.
Replaces the max_rect() function from servo_geometry.
2018-01-17 23:29:57 +01: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