aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread_2020/dom_wrapper.rs
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate duplicate Layout DOM wrappersMartin Robinson2023-05-051-1537/+0
| | | | | | | | | | 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-17/+41
| | | | | | | | | | | | | | | | | 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.
* Miscellaneous build / tidy fixes.Emilio Cobos Álvarez2021-02-261-20/+21
|
* Add animation and transition support for pseudo-elementsMartin Robinson2020-06-161-7/+17
| | | | | | | | | | This change extends the DocumentAnimationSet to hold animations for pseudo-elements. Since pseudo-elements in Servo are not in the DOM like in Gecko, they need to be handled a bit carefully in stylo. When a pseudo-element has an animation, recascade the style. Finally, this change passes the pseudo-element string properly to animation events. Fixes: #10316
* Add DocumentAnimationSet and AnimationSetKeyMartin Robinson2020-06-151-40/+15
| | | | | | | 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.
* Include animations and transitions in the cascadeMartin Robinson2020-06-091-7/+57
| | | | | | Instead of applying animations and transitions to styled elements, include them in the cascade. This allows them to interact properly with things like font-size and !important rules.
* Better computation of animation keyframesMartin Robinson2020-06-051-0/+4
| | | | | | | | | This begins to address #26625 by properly applying CSS variables during keyframe computation and no longer using `apply_declarations`. Instead, walk the declarations, combining them into IntermediateComputedKeyframe, maintaining declarations that modify CSS custom properties. Then compute a set of AnimationValues for each keyframe and use those to produce interpolated animation values.
* Cache animation computed values when animations changeMartin Robinson2020-06-051-2/+7
| | | | | | | | 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.
* Print element name when panicking in ThreadSafeLayoutElement::style_dataAnthony Ramine2020-05-181-1/+4
|
* Some servo build fixes.Emilio Cobos Álvarez2020-04-161-9/+0
|
* Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutDataAnthony Ramine2020-04-061-31/+30
|
* Rename a bunch of style/layout data itemsAnthony Ramine2020-04-061-25/+25
| | | | | | | | | | | | | 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.
* Auto merge of #26110 - servo:layout-2020-rm-note-dirty-descendant, r=emiliobors-servo2020-04-041-15/+0
|\ | | | | | | Kill ServoLayoutElement::note_dirty_descendant
| * Kill ServoLayoutElement::note_dirty_descendantAnthony Ramine2020-04-041-15/+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-15/+11
| | | | | | | | The previous Cell was a lie.
* | Don't expose any AtomicRefCell directly from style traitsAnthony Ramine2020-04-041-9/+18
| | | | | | | | This lets us experiment with how we store this data on the DOM side.
* | Make OpaqueLayoutAndStyleData just a bit less opaqueAnthony Ramine2020-04-041-16/+9
|/ | | | It now stores a NonNull<dyn Any>.
* Make LayoutShadowRootHelpers::get_style_data_for_layout return a &CascadeDataAnthony Ramine2020-04-011-1/+1
| | | | That return type is Sync, which thus means that the method can be safe.
* Make synthesize_presentational_hints_for_legacy_attributes be safeAnthony Ramine2020-04-011-4/+2
|
* Make LayoutDocumentHelpers::style_shared_lock be safeAnthony Ramine2020-04-011-1/+1
| | | | StyleSharedRwLock is Sync.
* Make LayoutNodeHelpers::composed_parent_node_ref be safeAnthony Ramine2020-04-011-11/+7
| | | | | | For clarity, I introduce <LayoutDom<Element>>::parent_node_ref to contain the remaining unsafety bits out of composed_parent_node_ref which is more complex than just a field access.
* Make LayoutShadowRootHelpers::get_host_for_layout be safeAnthony Ramine2020-03-311-1/+1
|
* Make a bunch of LayoutNodeHelpers be safeAnthony Ramine2020-03-311-6/+6
|
* Introduce LayoutDom::isAnthony Ramine2020-03-311-1/+1
| | | | Just like Castable::is.
* Make layout methods accessing rare data be safeAnthony Ramine2020-03-311-11/+7
| | | | | | They don't do anything fancy so there is no additional unsafety calling them compared to using LayoutDom in the first place, the usual story of all those changes.
* Make a bunch of LayoutDocumentHelpers be safeAnthony Ramine2020-03-311-2/+2
| | | | The other methods are actually unsafe.
* Make a bunch or trivial LayoutElementHelpers safeAnthony Ramine2020-03-311-6/+4
|
* Introduce <LayoutDom<Element>>::attrs()Anthony Ramine2020-03-311-30/+24
| | | | | | This safe method is the basic block to access element attributes from layout. We reuse it in the other attr-related layout methods to remove a pretty big source of rampant unsafe code between script and layout.
* Merge RawLayoutElementHelpers into LayoutElementHelpersAnthony Ramine2020-03-311-10/+8
|
* Make LayoutNodeHelpers::text_content return a cowAnthony Ramine2020-03-311-3/+3
|
* Make LayoutCharacterDataHelpers::data_for_layout be safeAnthony Ramine2020-03-311-1/+1
|
* Clean up LayoutShadowRootHelpers::get_style_data_for_layoutAnthony Ramine2020-03-301-6/+1
| | | | Parameter E is unused and the result should be bound by 'dom.
* Give a lifetime parameter to LayoutDomAnthony Ramine2020-03-281-85/+31
|
* Pass pending restyles instead of draining them from layoutAnthony Ramine2020-03-281-9/+0
|
* Make ServoLayoutNode::new return a free lifetime valueAnthony Ramine2020-03-281-1/+1
| | | | | Binding the scope of the ServoLayoutNode value to the originating TrustedNodeAddress is just theater.
* Move PendingRestyle to the style_layout_interface crateAnthony Ramine2020-03-281-1/+1
|
* Add a 'dom lifetime to GetLayoutDataAnthony Ramine2020-03-261-13/+13
|
* :defined worksPatrick Shaughnessy2020-01-301-0/+1
|
* style: Fix servo build.Emilio Cobos Álvarez2019-11-301-0/+22
|
* Call BoxTreeRoot::construct from layout_thread_2020Anthony Ramine2019-10-041-0/+7
|
* Make layout_2020 be layout_2013Anthony Ramine2019-07-311-0/+1550