aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread_2020/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* remove `extern crate` (#30311)Samson2023-09-081-9/+4
| | | | | | | | | | | * 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>
* Try to `use` WebRender types moreMartin Robinson2023-07-101-7/+8
| | | | | The newer versions of WebRender move types around between `webrender` and `webrender_api` and this will reduce the churn during the upgrade.
* Remove unused variableOriol Brufau2023-07-011-1/+0
| | | | Just a remnant from #29850, it was causing a build warning.
* It was removed from the spec and it's disabled everywhere.Emilio Cobos Álvarez2023-06-301-23/+1
| | | | This also removes the meta viewport support (which was implemented on top), but that also had a single test and is disabled everywhere, so I'm not too concerned, it can be implemented again if / when needed.
* Layout-2020: Serialize access to stylo thread pool.Mukilan Thiyagarajan2023-05-261-4/+7
| | | | | | | | | | | | | | | | | | | | When rendering a page containing an iframe, layout 2020 creates parallel 'Layout' threads which share workers in the stylo thread pool. Because of the way the 'StyleSharingCache' is designed using TLS for storage of the LRU cache, this leads to a double borrow of the cache when both layout threads run concurrently. More details about the issue can be found here: https://gist.github.com/mukilan/ed57eb61b83237a05fbf6360ec5e33b0 This PR is a workaround until we find a more elegant/optimal design that also can work for gecko. The fix for now is simply to not allow multiple layouts in parallel. Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
* Clean up and document the `send_display_list` interfaceMartin Robinson2023-05-241-10/+7
| | | | | | 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 #29748 - Loirooriol:sync, r=mrobinsonbors-servo2023-05-191-6/+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-6/+2
| |
* | Refactor Layout 2020 layout for a compositor-side scroll treeMartin Robinson2023-05-171-10/+20
|/ | | | | | | | | | | | | | | | | | | | This change refactors how layout is done in Layout 2020 in preparation for a compositor-side scroll tree: 1. Now the SpatialId and ClipId of each fragment is stored separately. This will allow storing a scroll node id instead of only the handle to the WebRender spatial node. 2. Separate out stacking context tree construction and display list building. This change will make it possible to eventually build the stacking context tree without the full display list if we find that necessary. For instance, this might be useful to cache containing block boundaries. 3. Add a `DisplayList` struct that stores both the WebRender display list builder and the compositor info. This exposes the API to the layout thread for display list building. In addition, this change adds a lot of missing documentation. This should not change behavior.
* Combine DOM-related concepts in Layout 2020 into dom.rsMartin Robinson2023-05-131-14/+13
|
* Eliminate duplicate Layout DOM wrappersMartin Robinson2023-05-051-16/+24
| | | | | | | | | | 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.
* Clean up arguments passed to and stored in LayoutThreadMartin Robinson2023-05-011-82/+20
|
* Fix scrolling from script in Layout 2020Martin Robinson2023-04-251-1/+2
| | | | | | | | | Script will only scroll if it detects that an element has a scrolling box, so this change adds an implementation of the scroll area query to Layout 2020. This allows some scrolling tests to start passing. This change also updates all expected results in css-backgrounds and cssom-view.
* Scroll from script should trigger a reflowMartin Robinson2023-04-251-17/+19
| | | | | | | | | Scrolling from script should flow layout and send a display list to WebRender. This allows all of the scroll nodes to exist in WebRender before asking it to move the node. See https://gist.github.com/paulirish/5d52fb081b3570c81e3a. Fixes #29659.
* Add support for <iframe> elements for Layout 2020Martin Robinson2023-04-041-12/+68
| | | | | | 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.
* Fix some build warningsMartin Robinson2023-03-271-1/+0
|
* Fix test-tidy for Layout 2020Martin Robinson2023-03-211-1/+0
| | | | It seems this wasn't caught by CI when landing the build fix yesterday.
* Fix the Layout 2020 buildMartin Robinson2023-03-201-5/+3
|
* Move hit testing information out of WebRenderMartin Robinson2023-03-151-2/+6
| | | | | | | | | 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.
* feat: shorten thread namesyvt2021-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel imposes a 15-byte limit on thread names[1]. This means information that does not fit in this limit, e.g., the pipeline ID of layout and script threads, is lost in a debugger and profiler (see the first column of the table below). This commit shortens the thread names used in Servo to maximize the amount of information conveyed. It also rectifies some inconsistencies in the names. | Before | After | |-------------------|-------------------| | `BluetoothThread` | `Bluetooth` | | `CanvasThread` | `Canvas` | | `display alert d` | `AlertDialog` | | `FontCacheThread` | `FontCache` | | `GLPlayerThread` | `GLPlayer` | | `HTML Parser` | `Parse:www.examp` | | `LayoutThread Pi` | `Layout(1,1)` | | `Memory profiler` | `MemoryProfiler` | | `Memory profiler` | `MemoryProfTimer` | | `OfflineAudioCon` | `OfflineACResolv` | | `PullTimelineMar` | `PullTimelineDat` | | `ScriptThread Pi` | `Script(1,1)` | | `WebWorker for h` | `WW:www.example.` | | `ServiceWorker f` | `SW:www.example.` | | `ServiceWorkerMa` | `SvcWorkerManage` | | `Time profiler t` | `TimeProfTimer` | | `Time profiler` | `TimeProfiler` | | `WebGL thread` | `WebGL` | | `Choose a device` | `DevicePicker` | | `Pick a file` | `FilePicker` | | `Pick files` | `FilePicker` | [1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars
* feat(layout_2020): implement `offset{Parent, Top, Left, Width, Height}`yvt2021-06-191-1/+2
|
* Miscellaneous build / tidy fixes.Emilio Cobos Álvarez2021-02-261-1/+7
|
* Fix warnings introduced in newer Rust NightlySimon Sapin2021-02-251-5/+0
| | | | | | | | | | | | 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
* ensure clean shutdown of all threads running JSGregory Terzian2020-06-301-15/+10
|
* Add DocumentAnimationSet and AnimationSetKeyMartin Robinson2020-06-151-10/+10
| | | | | | | This will be used in order to hold animations for pseudo elements in the DocumentAnimationSet. Also no longer store the OpaqueNode in the animation and transition data structures. This is already part of the DocumentAnimationSet key.
* Fix ./mach build --release --with-layout-2020Utsav Oza2020-06-101-2/+8
|
* Store resolved font style in canvas context stateUtsav Oza2020-06-101-2/+4
|
* Fix ./mach build --release --with-layout-2020Utsav Oza2020-06-101-1/+2
|
* Query layout to resolve canvas font property valueUtsav Oza2020-06-101-0/+1
|
* Remove unecessary webrender document from layout.Josh Matthews2020-06-091-17/+3
|
* Cache animation computed values when animations changeMartin Robinson2020-06-051-1/+8
| | | | | | | | Instead of recalculating the animation style every tick of an animation, cache the computed values when animations change. In addition to being more efficient, this will allow us to return animation rules as property declarations because we don't need to consult the final style to produce them.
* Reconstruct the box tree incrementally in some caseAnthony Ramine2020-06-041-14/+18
|
* Auto merge of #26484 - servo:layout-2020-style-prep, r=SimonSapinbors-servo2020-05-191-12/+11
|\ | | | | | | Implement concept of dirty root
| * Implement concept of dirty rootAnthony Ramine2020-05-191-12/+11
| |
* | layout_2020: Add support for transitions and animationsMartin Robinson2020-05-191-4/+36
|/
* Correctly paint the CSS canvas’ backgroundSimon Sapin2020-05-151-5/+2
| | | | | | | https://drafts.csswg.org/css-backgrounds/#special-backgrounds Fixes https://github.com/servo/servo/issues/25559 Closes https://github.com/servo/servo/pull/26121, as it is an alternative.
* Rename BoxTreeRoot/FragmentTreeRoot to BoxTree/FragmentTreeSimon Sapin2020-05-151-19/+17
|
* layout_2020: Fix WebRender display list dumpingMartin Robinson2020-05-151-4/+8
| | | | | We need to enable display list serialization before building the display list for it to work properly.
* Move most animation processing to scriptMartin Robinson2020-05-121-4/+0
| | | | | | | This is preparation for sharing this code with layout_2020 and implementing selective off-the-main-thread animations. We still look for nodes not in the flow tree in the layout thread.
* layout_2020: Add initial support for getComputedStyleMartin Robinson2020-05-111-2/+8
| | | | | | | This implementation is more-or-less on par with the one from layout_2013 and in some cases better. There are still some cases where we don't return the correct "resolved value," but this is enough to test animations and transitions.
* Start having animations conform to the HTML specMartin Robinson2020-05-051-19/+4
| | | | | | | | | | | | | | This is a small step toward fixing #19242. The main idea is that the clock for animations should advance as the event loop ticks. We accomplish this by moving the clock from layout and naming it the "animation timeline" which is the spec language. This should fix flakiness with animations and transitions tests where a reflow could move animations forward while script was running. This change also starts to break out transition and animation events into their own data structure, because it's quite likely that the next step in fixing #19242 is to no longer send these events through a channel.
* Use a restyle for animation ticksMartin Robinson2020-05-051-69/+11
| | | | | | | | | | | | | | This change corrects synchronization issues with animations, by reworking the animation processing model to do a quick restyle and incremental layout when ticking animations. While this change adds overhead to animation ticks, the idea is that this will be the fallback when synchronous behavior is required to fulfill specification requirements. In the optimistic case, many animations could be updated and applied off-the-main-thread and then resynchronized when style information is queried by script. Fixes #13865.
* Add ElementAnimationState and PossibleElementAnimationStateMartin Robinson2020-04-241-23/+5
| | | | | | | | | | | | This refactor is preparation for implementing a specification compliant transitions and animations processing model. These data structures hold all the animation information about a single node. Since adding, updating, and modifying animations for a single node are all interdependent, it makes sense to start encapsulating animation data and functionality into a single data structure. This also opens up the possibility for easier concurrency in the future by more easily allowing per-node mutexes.
* Auto merge of #26244 - mrobinson:animation-cancel, r=jdmbors-servo2020-04-221-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for canceling CSS transitions This change adds support for canceling CSS transitions when a property is no longer transitionable. Support for canceling and replacing CSS transitions when the end value changes is still pending. This change also takes advantage of updating the constellation message to fix a bug where transition events could be sent for closed pipelines. Fixes #15079. <!-- 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 #15079. <!-- 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. -->
| * Add support for canceling CSS transitionsMartin Robinson2020-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | This change adds support for canceling CSS transitions when a property is no longer transitionable or when an element becomes styled with display:none. Support for canceling and replacing CSS transitions when the end value changes is still pending. This change also takes advantage of updating the constellation message to fix a bug where transition events could be sent for closed pipelines. Fixes #15079.
* | Make the rule tree actually threadsafeAnthony Ramine2020-04-201-3/+1
|/ | | | | | RuleTree::gc is now a safe method that any thread can call at any time, and StrongRuleNode values can all be dropped whenever their owner want to, on any thread.
* Don't go through the layout thread to retrieve a node's primary styleAnthony Ramine2020-04-071-11/+4
|
* Auto merge of #26110 - servo:layout-2020-rm-note-dirty-descendant, r=emiliobors-servo2020-04-041-8/+0
|\ | | | | | | Kill ServoLayoutElement::note_dirty_descendant
| * Kill ServoLayoutElement::note_dirty_descendantAnthony Ramine2020-04-041-8/+0
| | | | | | | | | | | | There is no need to set the dirty descendants flag unsafely from the layout side for elements with pending restyles, we can do that on the DOM side when draining the restyles from the Document.
* | Make DOM own the style and layout data, in an UnsafeCellAnthony Ramine2020-04-041-8/+0
| | | | | | | | The previous Cell was a lie.