aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface
Commit message (Collapse)AuthorAgeFilesLines
* Refactor scrolls on the window object (#29680)Martin Robinson2023-09-152-4/+4
| | | | | | | | | | | | | | Refactor the scrolling and scrollable area calculation on the window object, to make it better match the specification. This has some mild changes to behavior, but in general things work the same as they did before. This is mainly preparation for properly handling viewport propagation of the `overflow` property but seems to fix a few issues as well. There is one new failure in Layout 2020 regarding `position: sticky`, but this isn't a big deal because there is no support for `position: sticky` in Layout 2020 yet. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-113-22/+18
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-083-5/+5
| | | | | | | | | | | * 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-3/+4
| | | | | The newer versions of WebRender move types around between `webrender` and `webrender_api` and this will reduce the churn during the upgrade.
* Start the transition to workspace dependenciesMartin Robinson2023-05-171-10/+10
| | | | | | | 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-131-1/+6
|
* Remove DangerousThreadSafeLayoutNodeMartin Robinson2023-05-121-8/+0
| | | | | | Remove this trait and replace it by two non-public functions on ServoThreadSafeLayoutNode. This requires making the iterator not generic, which simplifies things a little bit as well.
* Simplify our setup for font metric queries from styleOriol Brufau2023-05-111-3/+0
| | | | | | | | 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-0/+2
| | | | | | | | | | 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-041-0/+10
| | | | | | | | | | | | | | | | | 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.
* Scroll from script should trigger a reflowMartin Robinson2023-04-251-6/+6
| | | | | | | | | 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.
* */Cargo.toml: use the shmem feature for the dependency on the selectors cratreFederico Mena Quintero2023-02-141-1/+1
|
* Bump euclid to 0.22Martin Robinson2023-01-261-1/+1
| | | | | | | | | | | | | - 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.
* Update html5ever/xml5ever.Josh Matthews2022-04-011-1/+1
|
* Update parking_lot.Josh Matthews2022-04-011-1/+1
|
* ensure clean shutdown of all threads running JSGregory Terzian2020-06-301-1/+1
|
* Auto merge of #26921 - mrobinson:animation-set-key, r=jdmbors-servo2020-06-161-4/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add DocumentAnimationSet and AnimationSetKey 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. --- <!-- 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 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. -->
| * Add DocumentAnimationSet and AnimationSetKeyMartin Robinson2020-06-151-4/+2
| | | | | | | | | | | | | | 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.
* | Implement GPUSwapChain and GPUCanvasContext and interface with WebrenderKunal Mohan2020-06-131-0/+1
|/
* Store resolved font style in canvas context stateUtsav Oza2020-06-102-6/+6
|
* Query layout to resolve canvas font property valueUtsav Oza2020-06-102-0/+7
|
* More Cargo.toml updatesatouchet2020-05-301-14/+14
|
* 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-191-0/+2
|
* Correctly paint the CSS canvas’ backgroundSimon Sapin2020-05-151-0/+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.
* Move most animation processing to scriptMartin Robinson2020-05-122-7/+11
| | | | | | | 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.
* Start having animations conform to the HTML specMartin Robinson2020-05-051-2/+2
| | | | | | | | | | | | | | 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-9/+2
| | | | | | | | | | | | | | 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 support for animationend eventMartin Robinson2020-05-011-1/+1
| | | | | | | | | | This is triggered when an animation finishes. This is a high priority because it allows us to start rooting nodes with animations in the script thread. This doesn't yet cause a lot of tests to pass because they rely on the existence of `Document.getAnimations()` and the presence of `animationstart` and animationiteration` events.
* Remove unused `#![feature(…)]` attributesSimon Sapin2020-04-151-1/+0
|
* Don't go through the layout thread to retrieve a node's primary styleAnthony Ramine2020-04-072-11/+3
|
* Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutDataAnthony Ramine2020-04-062-30/+27
|
* Rename a bunch of style/layout data itemsAnthony Ramine2020-04-061-8/+13
| | | | | | | | | | | | | GetLayoutData::get_style_and_layout_data becomes GetOpaqueStyleAndLayoutData::get_opaque_style_and_layout_data. GetRawData::get_raw_data becomes GetStyleAndLayoutData::get_style_and_layout_data. LayoutNode::init_style_and_layout_data becomes LayoutNode::init_opaque_style_and_layout_data. LayoutNode::take_style_and_layout_data becomes LayoutNode::take_opaque_style_and_layout_data.
* Make DOM own the style and layout data, in an UnsafeCellAnthony Ramine2020-04-043-22/+9
| | | | The previous Cell was a lie.
* Make OpaqueLayoutAndStyleData just a bit less opaqueAnthony Ramine2020-04-041-1/+30
| | | | It now stores a NonNull<dyn Any>.
* Make LayoutNodeHelpers::text_content return a cowAnthony Ramine2020-03-311-1/+2
|
* Pass pending restyles instead of draining them from layoutAnthony Ramine2020-03-281-0/+2
|
* Move PendingRestyle to the style_layout_interface crateAnthony Ramine2020-03-281-1/+28
|
* Add a 'dom lifetime to GetLayoutDataAnthony Ramine2020-03-261-25/+22
|
* Make Background Hang Monitor OptionalKunal Mohan2020-02-231-1/+1
| | | | | | This is done by wrapping all channels of communication and related objects inside Option which are configured using flag inside servo_config.
* Update ipc-channel and crossbeam-channel.Josh Matthews2020-02-201-2/+2
|
* remove option for origin and mirror changes to layout_thread_2020Kunal Mohan2020-02-181-2/+2
|
* Take origin from window instead of creating a new one in case of reflowKunal Mohan2020-02-152-2/+5
| | | | | | | | | | Everytime a new LayoutContext was created, it created a new origin which caused endless stream of image loads to occur in case of reflow. The reason for this was that the existing image, although cached successfully, was not used because the entry in hashmap did not match because of different(new) origin. This is solved by storing the origin of a window in enum ScriptReflow and used in creating new LayoutContext in case of reflow.
* Improve the name the NodeGeometryQueryMartin Robinson2020-02-051-3/+3
| | | | | | | This query is used to get the clientTop, clientWidth, clientHeight, clientLeft properties of DOM objects. "NodeGeometry" doesn't really capture what these properties do as they often are returning the width of element border.
* Use non-IPC webrender API over explicit IPC channels.Josh Matthews2019-11-271-1/+1
|
* Fix some warnings new in Rust NightlySimon Sapin2019-11-081-3/+0
|
* Ensure layout/script always have a correct viewport size when a new pipeline ↵Josh Matthews2019-11-061-0/+1
| | | | is created.
* dom: Calculate the viewport size of iframes when they are first added to the ↵Josh Matthews2019-11-063-1/+9
| | | | tree.
* Update rand to 0.7 (fixes #24448)Anthony Ramine2019-10-231-1/+1
|
* Remove unused dependenciesShotaro Yamada2019-10-011-2/+0
|