Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have ContentBox(es)Queries consult the flow tree #3857

Closed
wants to merge 1 commit into from

Conversation

@mrobinson
Copy link
Member

mrobinson commented Oct 30, 2014

Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.

Fixes #3790.

@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented Oct 30, 2014

Critic review: https://critic.hoppipolla.co.uk/r/3033

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@mrobinson mrobinson force-pushed the mrobinson:queries branch from f48d887 to 77ac5fb Oct 30, 2014
}

self.process_content_box_request(data.content_box_request, &mut layout_root, &mut rw_data);
self.process_content_boxes_request(data.content_boxes_request, &mut layout_root, &mut rw_data);

This comment has been minimized.

@pcwalton

pcwalton Oct 31, 2014

Contributor

It's a little strange that we have content_box_request, content_boxes_request, and so forth, instead of an enum specifying which one script wants. Does it have to be done this way?

This comment has been minimized.

@mrobinson

mrobinson Oct 31, 2014

Author Member

Not at all. I reimplemented this using an enum and everything is much cleaner. Thanks for the suggestion!


pub fn content_boxes_query(&self, content_boxes_request: TrustedNodeAddress) -> Vec<Rect<Au>> {
self.flush_layout(ReflowForScriptQuery, None, Some(content_boxes_request));
self.join_layout(); //FIXME: is this necessary, or is layout_rpc's mutex good enough?

This comment has been minimized.

@pcwalton

pcwalton Oct 31, 2014

Contributor

This will soon go away with #3844.

@@ -1499,3 +1505,13 @@ bitflags! {
static IntrinsicInlineSizeIncludesSpecified = 0x08,
}
}

/// A top-down fragment bounds traversal.
pub trait FragmentBoundsTraversal {

This comment has been minimized.

@pcwalton

pcwalton Oct 31, 2014

Contributor

Usually I call "traversals" things that target the flow tree, since fragments are just flat lists.

This comment has been minimized.

@pcwalton

pcwalton Oct 31, 2014

Contributor

Maybe FragmentIterator or something?

@pcwalton
Copy link
Contributor

pcwalton commented Oct 31, 2014

Can we get rid of PseudoDisplayItem now as well?

@mrobinson mrobinson force-pushed the mrobinson:queries branch from 77ac5fb to 4982966 Oct 31, 2014
@mrobinson
Copy link
Member Author

mrobinson commented Oct 31, 2014

I don't think we can eliminate it yet. Hit box and mouse over testing is still done using the display list and I think a flow tree implementation is more difficult, because of z-index considerations. The paint order is encoded more readily in the display list than the flow tree, though admittedly I don't understand the mechanism ATM.

@pcwalton
Copy link
Contributor

pcwalton commented Oct 31, 2014

That shouldn't matter, because you can't mouse-over an element that has no display items. (Gecko does mouseover and hit box testing using the display list and has no PseudoDisplayItem.)

@mrobinson
Copy link
Member Author

mrobinson commented Oct 31, 2014

Oh, in that case, I can try removing it in a followup commit. It will be nice to remove that from the display list.

@pcwalton
Copy link
Contributor

pcwalton commented Oct 31, 2014

Sounds good for a followup. (BTW, on the maze solver pseudo-DL items outnumber real DL items 2-1—that's why I'm keen to remove it) :)

Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.

Fixes #3790.
@mrobinson mrobinson force-pushed the mrobinson:queries branch from 4982966 to 2d72f00 Nov 3, 2014
@mrobinson

This comment has been minimized.

Copy link
Owner Author

mrobinson commented on 2d72f00 Nov 3, 2014

r=pcwalton

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented on 2d72f00 Nov 3, 2014

saw approval from pcwalton
at mrobinson@2d72f00

This comment has been minimized.

Copy link
Contributor

bors-servo replied Nov 3, 2014

merging mrobinson/servo/queries = 2d72f00 into auto

This comment has been minimized.

Copy link
Contributor

bors-servo replied Nov 3, 2014

mrobinson/servo/queries = 2d72f00 merged ok, testing candidate = c9089c4

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

bors-servo replied Nov 3, 2014

fast-forwarding master to auto = c9089c4

bors-servo pushed a commit that referenced this pull request Nov 3, 2014
Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.

Fixes #3790.
@bors-servo bors-servo closed this Nov 3, 2014
@mrobinson mrobinson deleted the mrobinson:queries branch Nov 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.