aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/data.rs
Commit message (Collapse)AuthorAgeFilesLines
* script: Split style and layout data in DOM nodes (#31985)Martin Robinson2024-04-041-28/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-1/+2
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+1
| | | | | | | | | | | * 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>
* build(deps): bump bitflags from 1.3.2 to 2.3.1 (#30273)Martin Robinson2023-09-011-2/+3
| | | | | | 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)
* 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.
* Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutDataAnthony Ramine2020-04-061-14/+3
|
* Make OpaqueLayoutAndStyleData just a bit less opaqueAnthony Ramine2020-04-041-2/+1
| | | | It now stores a NonNull<dyn Any>.
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-1/+1
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-1/+1
|
* Rustfmt layout cratePyfisch2018-09-011-1/+0
|
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-3/+3
|
* Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest ↵Gecko Backout2017-10-191-3/+3
| | | | | | failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE Backs out https://github.com/servo/servo/pull/18809
* Update bitflags to 1.0 in every servo crateBastien Orivel2017-10-191-3/+3
| | | | | It still needs dependencies update to remove all the other bitflags versions.
* layout: Stop doing unsafe transmutes between refcell references.Emilio Cobos Álvarez2017-05-251-9/+24
| | | | | | | | | This commit splits the style and layout data in two separate refcells. These transmutes have been a source of trouble (for example on Android), and they feel like a hack anyway. Fixes #16982
* Fix unsafe casting between PersistentLayoutData and PartialPersistentLayoutDataImanol Fernandez2017-05-111-0/+1
|
* Bug 1325734 - Remove Servo Layout's dependency on the initial-ness of the ↵Bobby Holley2017-01-091-1/+3
| | | | style. r=emilio
* Move children_to_process to layout.Bobby Holley2016-10-081-12/+5
| | | | | | | | | | | We don't need this for Gecko, and it's hard to implement in that case because there's nowhere obvious to put it (we don't plan to create TSDs for non-dirty nodes, and non-dirty nodes can have dirty children which require the children_to_process atomic). There are various solutions here, but punting is the easiest. We'll need to rethink this if/when we need to do a bottom-up traversal for Gecko.
* Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead ↵Bobby Holley2016-10-021-8/+8
| | | | | | | | of RefCell as a container. This allows us to eliminate the unsafe borrows. \o/ MozReview-Commit-ID: 29hpGaWUFQz
* Remove some type aliases that are now just re-exports.Simon Sapin2016-07-201-1/+1
|
* Introduce a script_layout_interface crate and move RestyleDamage to it.Ms2ger2016-06-201-1/+1
|
* Upgrade to bitflags 0.6.0 and selectors 0.5.6Matt Brubeck2016-04-301-1/+1
| | | | | Types generated by `bitflags!` are now private by default. This PR marks them `pub` where necessary.
* layout: Stop storing PrecomputedStyleData in LayoutNodeEmilio Cobos Álvarez2016-04-291-4/+3
| | | | Use the SharedStyleContext instead.
* style: Add infrastructure for non-eagerly-cascaded pseudo-elementsEmilio Cobos Álvarez2016-04-291-5/+7
| | | | This commit also removes StylistWrapper and uses Arc::get_mut instead.
* Get the fundamentals of the HTMLDetailsElement rendering stuff working.Michael Howell2016-03-191-0/+6
| | | | | | Still need to implement the style invalidation. Part of #9395
* Refactor style to be completely backend-independentEmilio Cobos Álvarez2016-02-131-1/+1
| | | | | | | | | | | This commit refactors the style crate to be completely independent of the actual implementation and pseudo-elements supported. This also adds a gecko backend which introduces parsing for the anonymous box pseudo-elements[1], although there's still no way of querying them. https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
* Separate style+layout and layout-specific wrapper functionality.Bobby Holley2015-12-291-28/+7
| | | | | | | | | | | This patch does a number of things, unfortunately all at once: * Hoists a large subset of the layout wrapper functionality into the style system. * Merges TElementAttributes into the newly-created TElement. * Reorganizes LayoutData by style vs layout, and removes LayoutDataShared. * Simplifies the API for borrowing style/layout data. There's still more to do to make the style system usable standalone, but this is a good start.
* layout: Make the compositor rather than layout determine the position ofPatrick Walton2015-09-291-26/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | each iframe. The old code that attempted to do this during layout wasn't able to work for multiple reasons: it couldn't know where the iframe was going to be on the page (because of nested iframes), and at the time it was building the display list for a fragment it couldn't know where that fragment was going to be in page coordinates. This patch rewrites that code so that both the sizes and positions of iframes are determined by the compositor. Layout layerizes all iframes and marks the iframe layers with the appropriate pipeline and subpage IDs so that the compositor can place them correctly. This approach is similar in spirit to Gecko's `RefLayer` infrastructure. The logic that determines when it is time to take the screenshot for reftests has been significantly revamped to deal with this change in delegation of responsibility. Additionally, this code removes the infrastructure that sends layout data back to the layout task to be destroyed, since it is now all thread-safe and can be destroyed on the script task. The failing tests now fail because of a pre-existing bug related to intrinsic heights and borders on inline replaced elements. They happened to pass before because we never rendered the iframes at all, which meant they never had a chance to draw the red border the tests expect to not render! Closes #7377.
* Fix match_refs and let_returns in layout, address review changesManish Goregaokar2015-09-041-4/+4
|
* make test-tidy check that = have space after themerneyja2015-09-011-1/+1
|
* Replace uses of `for foo in bar.iter()` and `for foo in bar.iter_mut()`João Oliveira2015-08-151-1/+1
| | | | closes #7197
* Remove LayoutChan from LayoutDataWrapperMichael Wu2015-07-041-2/+0
|
* Replace the LayoutDataAccess trait by inherent methods.Ms2ger2015-06-221-38/+2
|
* Replace TLayoutNode by inherent methods.Ms2ger2015-06-221-1/+1
| | | | There is no reason for this trait to exist.
* Implement the LayoutData getters on LayoutJS<Node> rather than Node itself.Ms2ger2015-06-221-4/+4
|
* layout: Allow inline elements to be containing blocks forPatrick Walton2015-05-131-1/+1
| | | | | | | | | | absolutely-positioned elements. This also implements a little bit of the infrastructure needed to support for fragmentation via support for multiple positioned fragments in one flow. Improves Google.
* Replace unsafe_blocks by unsafe_code.Manish Goregaokar2015-03-211-1/+1
|
* Merge in servo/masterDan Fox2015-03-051-7/+25
|
* layout/layout_data.rs -> layout/data.rsDan Fox2015-03-031-0/+117