aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
Commit message (Collapse)AuthorAgeFilesLines
* Clean up and document the `send_display_list` interfaceMartin Robinson2023-05-241-16/+11
| | | | | | This moves more members to the CompositorDisplayListInfo struct, which now holds all miscellaneous, non-WebRender data when sending display lists. It also documents what each things sent with a display list does.
* Auto merge of #29745 - mrobinson:compositor-side-scroll-tree, r=mukilanbors-servo2023-05-231-39/+76
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a compositor-side scroll tree This will allow the compositor to properly chain scrolling requests up when a node has reached the extent of the scroll area. In addition, it removes the use of the deprecated WebRender `scroll()` API. This fixes scrolling on servo.org. --- <!-- 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 #29402. - Fix #27996. - Fix #27624. - Fix #24028. - Fix #23918. - Fix #21165. - [x] There are tests for these changes
| * Add a compositor-side scroll treeMartin Robinson2023-05-191-39/+76
| | | | | | | | | | | | This will allow the compositor to properly chain scrolling requests up when a node has reached the extent of the scroll area. This fixes scrolling on servo.org.
* | Auto merge of #29748 - Loirooriol:sync, r=mrobinsonbors-servo2023-05-191-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport several style changes from Gecko <!-- 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: --> - [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. -->
| * Further changes required by ServoOriol Brufau2023-05-161-2/+2
| |
* | Start the transition to workspace dependenciesMartin Robinson2023-05-171-19/+19
|/ | | | | | | This will ultimately make it simpler to update crate dependencies and reduce duplicate when specifying requirements. Generally, this change does not touch dependencies that are only used by a single crate. We could consider moving them to workspace dependencies in the future.
* Combine DOM-related concepts in Layout 2020 into dom.rsMartin Robinson2023-05-134-25/+3
|
* Simplify our setup for font metric queries from styleOriol Brufau2023-05-112-3/+2
| | | | | | | | This is a backport of https://phabricator.services.mozilla.com/D157589, by Emilio Cobos Álvarez, plus some additions so that Servo compiles, and some parts from https://phabricator.services.mozilla.com/D144455. Should have no change in behavior.
* Eliminate duplicate Layout DOM wrappersMartin Robinson2023-05-051-2/+6
| | | | | | | | | | There are duplicate sets of Layout DOM wrappers: one for Layout 2013 and one for Layout 2020. As part of cleaning up and simplifying the wrappers, this change parameterizes them on the specific layout data they contain. This allows them to be shared again. In addition, various small cleanups are included. Fixes #29691.
* Detect body elements during layoutMartin Robinson2023-05-043-18/+42
| | | | | | | | | | | | | | | | | During layout it is often useful, for various specification reasons, to know if an element is the `<body>` element of an `<html>` element root. There are a couple places where a brittle heuristic is used to detect `<body>` elements. This information is going to be even more important to properly handle `<html>` elements that inherit their overflow property from their `<body>` children. Implementing this properly requires updating the DOM wrapper interface. This check does reach up to the parent of thread-safe nodes, but this is essentially the same kind of operation that `parent_style()` does, so is ostensibly safe. This change should not change any behavior and is just a preparation step for properly handle `<body>` overflow.
* Clean up debug optionsMartin Robinson2023-05-014-8/+8
|
* Round text decoration thickness to >= 1 device pixelsOriol Brufau2023-04-271-3/+15
| | | | | | | | | | | | | | | | | | Previously the thickness coming from font metrics could be something like 0.7px, so with 1dppx it would be painted as either 1 or 0 device pixels. Enforcing at least 1 device pixel ensures that the decoration will be visible, and rounding to an integral amount of device pixels ensures that the thickness won't vary depending on the position. The specification requires this behavior when text-decoration-thickness is set to a length or percentage. It's not clear if it should also happen by default, but this seems to match other browsers (except for WebKit rounding up instead of to the nearest integer). The test text-decoration-thickness-from-zero-sized-font.html is now failing because of #29675.
* Add support for <iframe> elements for Layout 2020Martin Robinson2023-04-041-9/+8
| | | | | | This change adds support for the <iframe> element to Layout 2020. In addition, certain aspects of the implementation are made the same between both layout systems.
* Move hit testing information out of WebRenderMartin Robinson2023-03-153-12/+17
| | | | | | | | | Store hit testing information in a data structure that sits alongside the display list in the compositor. This will allow the compositor to store more information per-node. The data structure also takes care of de-duplicating information between successive display list entries. In the future, the data structure can be even more aggressive in producing smaller side hit testing lists, if necessary.
* Move more code into ClipScrollState during WebRender DL buildingMartin Robinson2023-03-101-74/+99
| | | | | | | | This change moves a bit more code into the `ClipScrollState` helper during WR display list building as well as inlines build_common_item_properties. This is all in preparation of modifications to this code which will build a Compositor-side scroll tree. It should not change any behavior.
* Bump euclid to 0.22Martin Robinson2023-01-266-29/+47
| | | | | | | | | | | | | - Also updates raqote to latest with an upgrade of font-kit to 0.11 applied on as a patch - Update lyon_geom to the latest version Major change: - All matrices are now stored in row major order. This means that parameters to rotation functions no longer should be negated. - `post_...()` functions are now named `then()`. `pre_transform()` is removed, so `then()` is used and the order of operations changed.
* Auto merge of #28880 - wusyong:fix-footer, r=delanbors-servo2023-01-182-1/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix absolute descendents being replaced when retreiving root <!-- Please describe your changes on the following line: --> The cause of #16410 is because calling `try_get_layout_root` will replace its `abs_descendants` even itself isn't absolute positioned. So I pushed them instead if the root isn't absolute. Also add a few docs and comments to help understand how block size of absolute flow is being calculated. --- <!-- 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 #16410 (GitHub issue number if applicable) <!-- Either: --> - [x] There are tests for these changes: Reduced testcase from the issue. ```html <style> html { min-height: 100%; position: relative; } div { position: absolute; bottom: 0; width: 100%; height: 25px; border: 1px solid black; } </style> <div> </div> ``` <!-- 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. -->
| * Actually check if root is absolute positionedWu Yu Wei2022-04-192-1/+28
| |
* | Fix some typosDirk Stolle2022-12-175-8/+8
| | | | | | | | Signed-off-by: Dirk Stolle <striezel-dev@web.de>
* | chore(deps): bump `smallvec` from 0.6 to 1.9 in all local packagesyvt2022-10-101-1/+1
|/ | | | | `smallvec ^0.6` no longer compiles after `nightly-2022-07-15` if the `union` feature is enabled.
* Add trace logs when assigning inline/block sizesWu Yu Wei2022-04-177-8/+68
|
* Update html5ever/xml5ever.Josh Matthews2022-04-011-1/+1
|
* Update parking_lot.Josh Matthews2022-04-011-1/+1
|
* Update nightly rustc.Josh Matthews2021-11-013-4/+4
|
* Fix compiler warningsBryce Wilson2021-08-141-1/+1
|
* Auto merge of #27865 - servo:github-actions-dev, r=jdmbors-servo2021-03-111-0/+3
|\ | | | | | | Add Github Actions workflow for mac/linux/windows builds
| * Adjust size test for debug/release differences.Josh Matthews2021-02-261-0/+3
| |
* | Miscellaneous build / tidy fixes.Emilio Cobos Álvarez2021-02-263-4/+16
| |
* | Fix warnings introduced in newer Rust NightlySimon Sapin2021-02-251-3/+5
|/ | | | | | | | | | | | This does not (yet) upgrade ./rust-toolchain The warnings: * dead_code "field is never read" * redundant_semicolons "unnecessary trailing semicolon" * non_fmt_panic "panic message is not a string literal, this is no longer accepted in Rust 2021" * unstable_name_collisions "a method with this name may be added to the standard library in the future" * legacy_derive_helpers "derive helper attribute is used before it is introduced" https://github.com/rust-lang/rust/issues/79202
* Revert "Revert "Update font-kit and freetype and unicode-script.""Josh Matthews2020-08-101-2/+2
| | | | This reverts commit 10ae3bfbbb2383d349de6150434cc47c6ad1c8e9.
* Revert "Revert "Update harfbuzz, freetype, unicode-script.""Josh Matthews2020-08-101-1/+1
| | | | This reverts commit 6b520850f34d55e88678999ff85aa70ba949d10c.
* Revert "Update harfbuzz, freetype, unicode-script."Josh Matthews2020-08-041-1/+1
| | | | This reverts commit 327fed6084a99cfeede4752dc7b71416b5d83032.
* Revert "Update font-kit and freetype and unicode-script."Josh Matthews2020-08-041-2/+2
| | | | This reverts commit 5c0d7998bd28ceb383f553cd7af5a60f472a47ba.
* Update font-kit and freetype and unicode-script.Josh Matthews2020-07-311-2/+2
|
* Update harfbuzz, freetype, unicode-script.Josh Matthews2020-07-311-1/+1
|
* Move clip resolution code into styleManish Goregaokar2020-07-271-21/+2
|
* Implement GPUSwapChain and GPUCanvasContext and interface with WebrenderKunal Mohan2020-06-132-0/+3
|
* Store resolved font style in canvas context stateUtsav Oza2020-06-101-9/+12
|
* Add todos for missing steps while processing parse font queryUtsav Oza2020-06-101-37/+79
|
* Query layout to resolve canvas font property valueUtsav Oza2020-06-101-2/+79
|
* Auto merge of #26823 - jdm:single-renderapi, r=asajeffreybors-servo2020-06-091-3/+7
|\ | | | | | | | | | | | | | | | | Update webrender These changes reflect changes in webrender's API that make RenderApiSender and RenderApi objects more challenging to share. This PR moves us to a model where: * the compositor owns the main RenderApi object * other threads that need to create transactions or manipulate fonts proxy those operations to the compositor (script/layout use IPC, while other threads use non-IPC channels) * the webgl thread owns its own independent RenderApi
| * Proxy all WR interactions for layout/font/script/canvas threads to the ↵Josh Matthews2020-06-091-3/+7
| | | | | | | | | | | | | | compositor thread. There is now a single RenderApi that is used, and all transactions are serialized through the compositor.
* | Auto merge of #26758 - jdm:stacking-context-transform-zero, r=mrobinsonbors-servo2020-06-096-1/+50
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | Don't create empty stacking contexts in display lists A recent change to euclid exposed that our display lists can contain Rects that contain NaN values. These NaNs originate from creating stacking contexts with transforms that scale the horizontal or vertical dimensions to 0. WebRender isn't prepared to handle these, so we need to not produce these empty stacking contexts when building the display list. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26592 and fix #26590 - [x] There are tests for these changes
| * layout: Don't built stacking contexts or display lists for empty blocks.Josh Matthews2020-06-096-1/+50
| |
* | Remove some unused dependency declarationsSimon Sapin2020-05-291-2/+0
|/ | | | | | This is based on compiling with `RUSTFLAGS="-W unused_crate_dependencies"` (CC https://github.com/rust-lang/rust/pull/72342) in a recent Nightly (more so than used in the tree as of this writing, CC https://github.com/servo/servo/issues/26661 for work-arounds). Only one crate is actually removed from the dependency graph, others are still dependended from other places.
* Remove use of nightly features in parking_lot. Update many uses from 0.9 to ↵Josh Matthews2020-05-261-1/+1
| | | | 0.10.
* Implement concept of dirty rootAnthony Ramine2020-05-192-2/+25
|
* More Cargo.toml cleanupsAlex Touchet2020-05-141-21/+21
|
* Auto merge of #26335 - jdm:wrup, r=SimonSapinbors-servo2020-05-125-111/+73
|\ | | | | | | Update webrender.
| * Use new webrender rounded clip API.Josh Matthews2020-05-123-99/+57
| |