Commit graph

318 commits

Author SHA1 Message Date
João Oliveira
0038580abf Replace uses of for foo in bar.iter() and for foo in bar.iter_mut()
closes #7197
2015-08-15 02:27:39 +01:00
bors-servo
2b9590c5a5 Auto merge of #6778 - nox:childnodes, r=jdm
Optimise Node.childNodes



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6778)
<!-- Reviewable:end -->
2015-08-10 14:05:02 -06:00
Patrick Walton
0a589d413d layout: When repairing styles for incremental reflow, only repair
styles of nodes that represent the dirty node, *including its
pseudo-element*.

Fixes lots more jumpiness.

A manual test, `inline-pseudo-repair-jumpiness.html`, has been added. I
was unable to automate it, so I will file a followup issue on that.
2015-08-04 09:02:41 -07:00
Anthony Ramine
a49eb14615 Cache the number of children of each node 2015-07-31 23:32:30 +02:00
Ms2ger
cf793a8813 Inline ThreadSafeLayoutNode::get_style. 2015-07-27 19:57:38 +02:00
Ms2ger
3984e39011 Replace the StyledNode trait with inherent methods. 2015-07-27 19:57:33 +02:00
Patrick Walton
bb99b2f3c8 script: Make most of 2D canvas and WebGL run over IPC.
To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.
2015-07-25 00:50:12 -07:00
bors-servo
f44d75e5b2 Auto merge of #6715 - Ms2ger:layoutelement, r=jdm
Implement more methods on LayoutJS.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6715)
<!-- Reviewable:end -->
2015-07-23 12:40:52 -06:00
Ms2ger
487eef88e3 Move the state getters to LayoutElementHelpers. 2015-07-23 20:30:59 +02:00
Ms2ger
849eb7837a Move the flag getters to LayoutNodeHelpers. 2015-07-23 20:13:06 +02:00
Simon Sapin
055a1c5cee Update rust-selectors
Update for https://github.com/servo/rust-selectors/pull/37
2015-07-23 18:53:57 +02:00
Ms2ger
751a367eb9 Don't call type_id_for_layout directly in LayoutElement::is_link. 2015-07-22 18:29:38 +02:00
Ms2ger
9cc1e017ee Move local_name and namespace to LayoutJS<Element>. 2015-07-22 18:28:17 +02:00
Ms2ger
23c679d55a Implement style_attribute() on LayoutJS<Element>. 2015-07-22 17:27:23 +02:00
Corey Farwell
b1b03a32db Upgrade rust-selectors, pass ':empty' tests
https://github.com/servo/rust-selectors/pull/36
2015-07-22 18:27:33 +07:00
Ms2ger
94e1d4d34c Don't call mutate_layout_data in get_{before,after}_pseudo.
We don't mutate anything.
2015-07-21 22:58:16 +02:00
Ms2ger
093204a224 Replace get_{before,after}_display by get_{before,after}_pseudo. 2015-07-21 22:27:40 +02:00
Ms2ger
2e6a723970 Merge has_{before,after}_pseudo into get_{before,after}_display. 2015-07-21 22:27:38 +02:00
Ms2ger
cc356e58ae Remove unused ThreadSafeLayoutNode::get_normal_display. 2015-07-21 22:27:36 +02:00
Ms2ger
930e111713 Scope ThreadSafeLayoutNode::first_child to ThreadSafeLayoutNodeChildrenIterator::new.
It is only used there.
2015-07-21 19:53:34 +02:00
Ms2ger
b3892b74f7 Simplify ThreadSafeLayoutNodeChildrenIterator::next(). 2015-07-21 19:53:23 +02:00
Ms2ger
bb444df679 Remove unused ThreadSafeLayoutNode::traverse_postorder_mut. 2015-07-17 13:26:23 +02:00
Ms2ger
c018863201 Stop using Option in ThreadSafeLayoutNodeChildrenIterator::parent_node. 2015-07-17 11:41:57 +02:00
Ms2ger
3e2c44114c Move the traversal traits into the traversal module. 2015-07-17 11:40:40 +02:00
Ms2ger
928f843392 Remove unused has_children method. 2015-07-10 19:34:04 +02:00
bors-servo
cc73aad447 Auto merge of #6546 - michaelwu:slim-layoutdatawrapper, r=Ms2ger
Remove LayoutChan from LayoutDataWrapper

Saves 32 bytes in Node.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6546)
<!-- Reviewable:end -->
2015-07-05 21:39:12 -06:00
Ms2ger
58a7c81530 Store a LayoutJS<Element> in LayoutElement. 2015-07-04 17:38:42 +02:00
Michael Wu
1a014beb08 Remove LayoutChan from LayoutDataWrapper 2015-07-04 03:54:40 -04:00
Ms2ger
2f88b84e07 Remove *Cast::from_actual.
Since JSRef was removed, from_actual duplicates from_ref.
2015-07-04 12:55:01 +02:00
Simon Sapin
9e1a674b16 Update rust-selectors 2015-06-26 12:35:08 -07:00
Ms2ger
8375e0914a Simplify ThreadSafeLayoutNodeChildrenIterator::next a bit. 2015-06-25 08:28:03 +02:00
Ms2ger
51d0f51dd9 Use a while let loop in ThreadSafeLayoutNode::traverse_postorder_mut. 2015-06-25 08:27:56 +02:00
Ms2ger
c87c7f1d84 Simplify ThreadSafeLayoutNode::text_content. 2015-06-25 08:27:53 +02:00
Ms2ger
e1cee995b7 Make {ThreadSafe,}LayoutNode::get_jsmanaged private.
There are no longer any callers outside wrapper.rs, and this makes it harder
to introduce buggy callers.
2015-06-24 15:14:19 +02:00
Ms2ger
2ea32829af Replace OpaqueNodeMethods::from_{threadsafe_,}layout_node by opaque methods. 2015-06-24 14:55:43 +02:00
Ms2ger
a42e11a95f Replace the LayoutDataAccess trait by inherent methods. 2015-06-22 11:34:31 +02:00
Ms2ger
167a396293 Replace TLayoutNode by inherent methods.
There is no reason for this trait to exist.
2015-06-22 11:04:43 +02:00
Ms2ger
50d4084e9a Remove TLayoutNode::first_child.
It is replaced by the TNode implementation for LayoutNode and an inherent
implementation for ThreadSafeLayoutNode.
2015-06-22 11:04:41 +02:00
Ms2ger
dc167ca343 Implement type_id as inherent methods.
This implies LayoutNode no longer needs to return an Option, as it never
represents a pseudo-element.

Also, fixes lies in the documentation.
2015-06-22 10:47:52 +02:00
Ms2ger
f0034b4ac9 Remove some dead code from ThreadSafeLayoutNode::first_child.
self.pseudo is always PseudoElementType::Normal at this point.
2015-06-22 10:47:44 +02:00
Ms2ger
13a07a4ed2 Move some TLayoutNode methods to ThreadSafeLayoutNode.
They are unused on LayoutNode.
2015-06-22 10:47:38 +02:00
Ms2ger
8f58dafbd6 Inline node_is_element and node_is_document into their only callers. 2015-06-22 10:47:35 +02:00
Ms2ger
54b9dc6563 Inline LayoutNode::text_content into its only caller, ThreadSafeLayoutNode::text_content. 2015-06-22 10:47:31 +02:00
Ms2ger
1398616ec1 Remove incorrect claim from a comment. 2015-06-22 10:47:27 +02:00
Ms2ger
ae5191275a Remove TLayoutNode::get.
It is highly unsafe and unused.
2015-06-22 10:47:23 +02:00
Ms2ger
eb2c508df0 Implement the LayoutData getters on LayoutJS<Node> rather than Node itself. 2015-06-22 10:47:21 +02:00
Simon Sapin
fc25397c91 Update rust-selectors
https://github.com/servo/rust-selectors/pull/30
2015-06-20 07:05:43 +02:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Corey Farwell
4f47b41fa7 Remove fnv & smallvec crate reexports from util
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.

These indirect dependencies through the util component are unnecessary.

This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.
2015-06-10 07:14:55 -07:00
Corey Farwell
435e551753 Remove get_ prefix on getters
Part of #6224

I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
2015-06-02 08:54:44 -04:00