Commit graph

27 commits

Author SHA1 Message Date
Bobby Holley
fb70ee2c0c Drop style data from descendants on display:none.
MozReview-Commit-ID: 8ls43oAGWRg
2016-11-01 11:03:04 -07:00
Bobby Holley
71b9004d86 Replace begin_styling with a centralized mechanism to set a node up for either styling or restyling.
We also make sure that an element never has an ElementData with ElementDataStyles::Uninitialized,
and eagerly call prepare_for_styling whenever an ElementData is instantiated.

MozReview-Commit-ID: 9YP6eSmdMt0
2016-11-01 11:03:04 -07:00
Bobby Holley
be89f73675 Rename NodeData and associated data structures to Element*.
MozReview-Commit-ID: 96VsmsoZtjZ
2016-10-29 14:58:07 -07:00
Bobby Holley
5442fbec3f Hoist most styling functionality from TNode to TElement.
MozReview-Commit-ID: DZ8ZrsZIiAU
2016-10-29 13:45:40 -07:00
Bobby Holley
46e29184bd Move core pseudo-element handling to ThreadSafeLayoutElement. 2016-10-28 10:47:57 -07:00
Bobby Holley
1090abae87 Don't traverse text nodes during styling.
MozReview-Commit-ID: 6CtQMxbcLnF
2016-10-27 10:22:32 -07:00
Bobby Holley
1cfd5e8172 Hoist RestyleDamage onto TElement.
Instead of maintaining a dummy restyle damage field for text nodes, we can just
perform the necessary parent inheritance and is_changed adjustments on the fly
in ThreadSafeLayoutNode, simplifying the requirements on the style system.

MozReview-Commit-ID: DCqiCRLsLUF
2016-10-27 09:15:36 -07:00
Bobby Holley
a5cabda484 Teach Servo to compute text node style from layout.
MozReview-Commit-ID: IolVN5puF1i
2016-10-27 09:15:35 -07:00
Patrick Walton
fb2d1e1020 layout: Add a new cascading mode that inherits all properties, even
non-inheritable ones.

This works like the `modify_style_for_*` functions and will allow us to
easily migrate from them to real cascading.
2016-10-26 14:14:01 -07:00
Bobby Holley
adf0fe9b9a Rearrange some data structures in preparation for the new incremental restyle algorithm.
MozReview-Commit-ID: 8iOALQylOuK
2016-10-21 13:00:01 -07:00
bors-servo
bb271ef4af Auto merge of #13848 - mrobinson:remove-layers, r=glennw
Remove concept of Layers from Servo

<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this PR should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13848)
<!-- Reviewable:end -->
2016-10-21 01:43:25 -05:00
Martin Robinson
ccb7ab926a Remove concept of Layers from Servo
Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.
2016-10-21 08:38:34 +02:00
Bobby Holley
cc96b292c2 Simplify TNode a bit.
A couple of changes here:
* Remove the option to unset with the dirty bit setters.
* Add an explicit API for setting text node style.
* Hoist has_changed handling into the restyle damage setter and text node style setter.
* Make set_style take a non-Option.
2016-10-20 09:47:54 -07:00
Alexandrov Sergey
9876020c22 add SVGElement, SVGGraphicsElement interfaces and SVGSVGElement element 2016-10-06 18:22:53 +03:00
Bobby Holley
687e1f701c Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead of RefCell as a container.
This allows us to eliminate the unsafe borrows. \o/

MozReview-Commit-ID: 29hpGaWUFQz
2016-10-02 19:19:52 -07:00
Bobby Holley
5bcc4192bf Stop using Ref::map for selected_style and resolved_style.
Same concept as the previous patch.

MozReview-Commit-ID: RFC8s7qQPM
2016-10-02 19:19:52 -07:00
Bobby Holley
18d552a1e9 Stop using Ref::map for style().
It's not possible to implement a Ref::map equivalent method on AtomicRefCell
while having AtomicRefCell implemented on top of RwArc. We could potentially
reimplement AtomicRefCell to be more like RefCell and add a Ref::map equivalent
method, but I (and pcwalton) think we should try just cloning a few extra
Arcs at these callsites instead.

MozReview-Commit-ID: 6H8vAWguO3z
2016-10-02 19:19:52 -07:00
Bobby Holley
4aa3e589c0 Introduce the LayoutIterator newtype and return it for all children() methods in style and layout. 2016-09-20 17:48:31 -07:00
Bobby Holley
e6bbff110a Split out is_element and is_text_node into a helper trait. 2016-09-20 17:16:27 -07:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Bobby Holley
470368ecce Move rev_children and traverse_preorder to LayoutNode.
These impose additional requirements on the traversal code that we want to
avoid for Gecko (for now).
2016-08-26 09:36:53 -07:00
Simon Sapin
bc71e8b65b Add some fmt::Debug implementations 2016-08-21 03:40:28 +02:00
Simon Sapin
fdb2071b2d Update to selectors 0.8.2 2016-08-09 18:18:38 +02:00
Simon Sapin
6d0e48f6cc Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
Bobby Holley
1d8d1cb9d9 Upgrade rust-selectors. 2016-07-05 18:03:40 -07:00
Simon Sapin
f7f81e0ed0 Use our copy of RefCell for style data.
This allows removing `#![feature(as_unsafe_cell)]` in geckolib
and make progress towards #11815.
2016-06-23 16:13:49 +02:00
Ms2ger
0d0b268138 Move LayoutNode and related traits to script_layout_interface. 2016-06-20 19:07:54 +02:00