aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove legacy layout (layout 2013) (#35943)Oriol Brufau2025-03-131-2456/+0
| | | | | | We were already not compiling it and not running tests on it by default. So it's simpler to just completely remove it. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-3/+3
| | | | | | | | | | | | | * 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>
* layout: Remove the obsolete layout tracing functionality (#35001)Martin Robinson2025-01-151-8/+0
| | | | | | | | | | | | | | | | | | | | 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>
* config: Remove legacy-layout and unused `Preferences` and `Opts` (#34994)Martin Robinson2025-01-141-8/+5
| | | | | | There are some preferences and options that are only used by legacy layout or not used at all. This PR removes them. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Elide lifetimes where possible after rustup (#34824)Martin Robinson2025-01-031-2/+2
| | | | | | | | | 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>
* Upgrade Stylo to 2024-12-04 (#34501)Oriol Brufau2024-12-061-33/+37
| | | | | | | | | | | | | | | | | * 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>
* fonts: Make `FontContext` thread-safe and share it per-Layout (#32205)Martin Robinson2024-05-021-16/+13
| | | | | | | | | | | | This allows sharing font templates, fonts, and platform fonts across layout threads. It's the first step toward storing web fonts in the layout versus the shared `FontCacheThread`. Now fonts and font groups have some locking (especially on FreeType), which will probably affect performance. On the other hand, we measured memory usage and this saves roughly 40 megabytes of memory when loading servo.org based on data from the memory profiler. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* script: Split style and layout data in DOM nodes (#31985)Martin Robinson2024-04-041-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change splits the style and layout data in DOM nodes that is populated by style and layout passes. This makes Servo's data design more like Gecko's. This allows: 1. Removing the various `StyleAndLayout` data structures used by layout. 2. Removing the `GetStyleAndLayoutData` and `GetStyleAndOpaqueLayoutData` traits. Accessing style and layout data are now just functions on the `LayoutNode` and `ThreadSafeLayoutNode` traits. 3. Styling now doesn't populate layout data. This is is postponed until layout itself. 4. Allows the DOM wrappers to no longer have to be generic over the layout data. This data was already stored using `std::any::Any` and the new code just makes layout responsible for downcasting. Cleaning up the generic type parameter in the DOM wrappers can happen in a followup change. The main benefit to all of this is that we should be able to remove unsafe creation of `ServoLayoutNode` in layout and `TrustedLayoutNodeAddress` entirely, because `ServoLayoutNode` will be able to be passed directly from script to layout. In addition, this removes one more abstraction layer from the layout DOM wrappers, making the code a lot more understandable. Note: This increases the measured size of DOM types, but the same data is stored. It's simply that before that data was stored behind a heap pointer.
* Update Stylo to 2023-10-16 (#31932)Oriol Brufau2024-03-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | * Update Stylo to 2023-10-16 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D188216 * Fixup for https://phabricator.services.mozilla.com/D185677 * Fixup for https://phabricator.services.mozilla.com/D188566 * Fixup for https://phabricator.services.mozilla.com/D188727 * Fixup for https://phabricator.services.mozilla.com/D189475 * Fixup for https://phabricator.services.mozilla.com/D189521 * Fixup for https://phabricator.services.mozilla.com/D188812 * Fixup for https://phabricator.services.mozilla.com/D189484 * Update test expectations
* clippy: Fix warnings in `components/layout` (#31612)eri2024-03-111-6/+8
| | | | | * clippy: fix warnings in components/layout * fix: formatting
* style: Remove dependency on servo_url (#31358)Martin Robinson2024-02-161-1/+1
| | | | | In order for stylo to be a separate crate, it needs to depend on less things from Servo. This change makes it so that stylo no longer depends on servo_url.
* Lint layout_2013 with clippy (#31221)Oriol Brufau2024-01-301-25/+19
| | | | | | | | | * Lint layout_2013 with clippy CARGO_BUILD_RUSTC=rustc cargo clippy --fix -p layout_2013 --broken-code * ./mach fmt * Cosmetic adjustments
* Add support for table fixups (#30868)Martin Robinson2023-12-221-2/+2
| | | | | | | | | | | | | | | | This adds support for fixing up tables so that internal table elements that are not properly parented in the DOM have the correct box tree structure according to the CSS Table specification [1]. Note that this only comes into play when building the DOM via script, as HTML 5 has its own table fixups that mean that the box tree construction fixups here are not necessary. There are no tests for this change. In general, it's hard to write tests against the shape of the box tree, because it depends on the DOM. We plan to test this via WPT tests once layout is complete. 1. https://drafts.csswg.org/css-tables/#table-internal-element Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Further changes required by ServoOriol Brufau2023-11-241-4/+5
|
* Anonymous boxes that wrap inlines should not inherit overflow (#30579)Martin Robinson2023-10-191-14/+14
| | | | | | | | | | | | | | In legacy layout, anonymous text wrappers were inheriting the `overflow` and `text-overflow` properties. This results in the creation of extra clipping for these anonymous wrappers which could clip away floats. We will likely implement `text-overflow` differently in non-legacy layout. This change marks all legacy layout pseudo elements as "legacy" and also adds a new pseudo element for non-legacy layout that does not inherit `overflow`. Fixes #30562. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-38/+35
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+2
| | | | | | | | | | | * 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>
* Make Layout 2013 style a superset of Layout 2020 styleMartin Robinson2023-06-281-0/+10
| | | | | This is the first step toward removing the compile-time difference in style between Layout 2020 and Layout 2013.
* Clean up debug optionsMartin Robinson2023-05-011-1/+1
|
* Miscellaneous build / tidy fixes.Emilio Cobos Álvarez2021-02-261-4/+10
|
* Add a 'dom lifetime to GetLayoutDataAnthony Ramine2020-03-261-17/+19
|
* style: Miscellaneous Servo build fixes.Emilio Cobos Álvarez2020-02-121-2/+6
|
* Make inline elements work in fullscreen modeFernando Jiménez Moreno2019-09-051-1/+3
|
* Fix Servo build and unify display representation.Emilio Cobos Álvarez2019-08-151-7/+10
|
* Revert change to render media controls breaking inline layoutFernando Jiménez Moreno2019-07-221-9/+3
|
* Only allow UA widgets as children of media elementsFernando Jiménez Moreno2019-07-221-3/+8
| | | | Do not allow pseudo-elements for replaced elements
* Media UI basic functionalityFernando Jiménez Moreno2019-07-221-2/+4
|
* Render media controlsFernando Jiménez Moreno2019-07-221-4/+10
|
* Remove ObjectElementAnthony Ramine2019-01-141-40/+19
|
* Remove ComputedValueUtilsAnthony Ramine2019-01-141-21/+14
|
* Remove FlowConstructionUtilsAnthony Ramine2019-01-141-17/+1
|
* Move is_image_data to the layout crateAnthony Ramine2019-01-091-1/+7
| | | | It's only used there.
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-6/+9
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-11/+21
|
* Format remaining filesPyfisch2018-11-061-2/+3
|
* Sort `use` statementsSimon Sapin2018-11-061-10/+10
|
* `cargo fix --edition`Simon Sapin2018-11-061-29/+29
|
* Layout: Remove redundant deny unsafe and formatPyfisch2018-10-221-2/+0
| | | | | | Add license to two files. Bypass DisplayListBuilder for some items.
* Revert import style formatFernando Jiménez Moreno2018-10-081-6/+4
|
* layout: instantiate SpecificFragmentInfo from node's media dataVíctor Manuel Jáquez Leal2018-10-081-5/+11
|
* Current-pixel-density tests passingpaavininanda2018-09-131-0/+3
|
* Rustfmt layout cratePyfisch2018-09-011-567/+824
|
* layout: script: Fix build.Emilio Cobos Álvarez2018-06-231-3/+3
|
* Fix Servo build.Emilio Cobos Álvarez2018-05-281-2/+3
|
* Fix Servo build.Emilio Cobos Álvarez2018-05-191-1/+1
|
* Auto merge of #20420 - pyfisch:corner-clipping, r=emiliobors-servo2018-04-291-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move DL items from gfx to layout and implement corner clipping Implement corner clipping. Remove PixelFormat from WebrenderImageInfo. Use WebRender text shadow. Remove MallocSizeOf and Deserialize for DL items. Closes #19649, closes #19680, closes #19802 <!-- 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 #__ (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/20420) <!-- Reviewable:end -->
| * Move DL items from gfx to layoutPyfisch2018-04-221-1/+1
| | | | | | | | | | | | | | | | | | Implement corner clipping. Remove PixelFormat from WebrenderImageInfo. Use WebRender text shadow. Remove MallocSizeOf and Deserialize for DL items. Closes #19649, #19680, #19802
* | Implement a URL-generic type for list-style-imageFausto Núñez Alberro2018-04-031-4/+3
|/ | | | | | | | | | This should fix the following two "expected to fail" tests: - getComputedStyle(elem) for url() listStyleImage uses the resolved URL and elem.style uses the original URL - getComputedStyle(elem) for url() listStyle uses the resolved URL and elem.style uses the original URL
* style: Move content property out of mako.Igor Gutorov2018-02-071-8/+7
|