Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstylo: avoid traversing non element/text nodes in style and layout #13172
Conversation
highfive
commented
Sep 4, 2016
|
@bors-servo: r+ |
|
|
stylo: Update bindings and avoid traversing non-stylable nodes r? @emilio <!-- 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/13172) <!-- Reviewable:end -->
|
|
|
Well, the stack traces in the builder are, er... not great, but basically, a bit of code in Servo's layout expects all the children layout data to be initialized, let me find a link to the actual problematic line... |
|
Yeah, basically, this is the problematic line: https://github.com/servo/servo/blob/master/components/layout/construct.rs#L1393. (The IMO the solution should be splitting the layout data and the style data properly, but that's probably too much for this patch, so probably you want different implementations for Servo and Gecko, and the assertion inside an Also, please put a |
|
|
… methods in style and layout.
|
@bors-servo try |
stylo: avoid traversing non element/text nodes in style and layout r? @emilio <!-- 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/13172) <!-- Reviewable:end -->
|
|
|
|
|
r? @emilio |
|
neat, r=me with the nits :) Also, a comment in the appropriate places indicating to this iterator would be awesome, since it might be tricky to find otherwise. |
| impl<'ln> NodeInfo for ServoThreadSafeLayoutNode<'ln> { | ||
| fn is_element(&self) -> bool { | ||
| if let Some(LayoutNodeType::Element(_)) = self.type_id() { true } else { false } | ||
| } |
This comment has been minimized.
This comment has been minimized.
| fn next(&mut self) -> Option<I> { | ||
| loop { | ||
| // Filter out nodes that layout should ignore. | ||
| let n = self.0.next(); |
This comment has been minimized.
This comment has been minimized.
emilio
Sep 21, 2016
•
Member
nit: maybe this would look clearer as:
match self.0.next() {
None => return None,
Some(node) if node.needs_layout() => return Some(node),
_ => {},
}Though I don't have a strong preference, so feel free to leave as-is.
|
@bors-servo r=emilio |
|
|
stylo: avoid traversing non element/text nodes in style and layout r? @emilio <!-- 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/13172) <!-- Reviewable:end -->
|
|
highfive
commented
Sep 21, 2016
|
|
@bors-servo: retry #13360 |
|
|
|
|
|
@bors-servo retry #12654 |
stylo: avoid traversing non element/text nodes in style and layout r? @emilio <!-- 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/13172) <!-- Reviewable:end -->
|
|
bholley commentedSep 4, 2016
•
edited by larsbergstrom
r? @emilio
This change is