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

layout: Re-enable parallel layout and refactor boxes significantly #2174

Merged
merged 1 commit into from May 2, 2014

Conversation

@pcwalton
Copy link
Contributor

pcwalton commented Apr 18, 2014

layout: Re-enable parallel layout by removing all RefCell instances from Flows; in the process, remove InlineInfo in favor of the range-based design that was originally planned and halfway implemented.

Now, the DOM tree structure for inline flows is reflected not by a
series of arrays but instead by a flat list of ranges into the list of
boxes. As part of this, the border and padding fields, which were
incorrect in the case of inlines and necessitated separate
noncontent_inline_foo methods, have been merged into a single
border_padding field that is always guaranteed to be correct after
width assignment, even for inlines.

r? @SimonSapin and/or @larsbergstrom

Closes #1280
Closes #1926
Closes #1999
Closes #2013
Closes #2018

@highfive
Copy link

highfive commented Apr 18, 2014

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify layout code, but no reftests are modified. Please consider adding a reftest!
  • @pcwalton, please confirm that src/test/html/acid1.html and your favourite wikipedia page still render correctly!
@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented Apr 18, 2014

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

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.

@pcwalton pcwalton changed the title Reparallelize layout: Re-enable parallel layout and refactor boxes significantly Apr 18, 2014
@pcwalton
Copy link
Contributor Author

pcwalton commented Apr 19, 2014

Added a small commit to fix up a safety issue that I realized we have.

@Ms2ger
Copy link
Contributor

Ms2ger commented Apr 19, 2014

Left a few comments on critic

@SimonSapin
Copy link
Member

SimonSapin commented Apr 22, 2014

@pcwalton Does this obsolete #2141? The first commit seems identical.

@pcwalton
Copy link
Contributor Author

pcwalton commented Apr 23, 2014

@SimonSapin It's meant to be "based on top of" #2141, but I'll just close it.

@SimonSapin
Copy link
Member

SimonSapin commented Apr 28, 2014

I’ve edited the PR message to add "Closes #2018". Hopefully GitHub will do its magic.

/// New-line chracter(\n)'s positions(relative, not absolute)
///
/// FIXME(pcwalton): This is very inefficient; remove.

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2260

@@ -67,7 +66,7 @@ use url::Url;
/// content such as images are resized differently from tables, text, or other content. Different
/// types of boxes may also contain custom data; for example, text boxes contain text.
///
/// FIXME(pcwalton): This can be slimmed down quite a bit.
/// FIXME(pcwalton): This can be slimmed down some.

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2260

} else {
(Au(0), Au(0))
};

// FIXME(pcwalton): This won't work well for inlines: is this OK?

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2261

@@ -825,35 +649,14 @@ impl Box {
}

/// Returns the left offset from margin edge to content edge.
///
/// FIXME(pcwalton): I think this method is pretty bogus, because it won't work for inlines.

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2262

// FIXME(pcwalton): This is a bit of an abuse of the logging infrastructure. We
// should have a real `SERVO_DEBUG` system.

// FIXME(pcwalton): This is a bit of an abuse of the logging

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2263

map: mut map
} = mem::replace(boxes, InlineBoxes::new());

// FIXME(pcwalton): This is slow because vector shift is broken. :(

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2264


/// Propagates text alignment flags from an appropriate parent flow per CSS 2.1.
///
/// FIXME(pcwalton): It would be cleaner and faster to make this a derived CSS property

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2265


/// Returns the dimensions of the padding in this fragment range.
pub fn padding(&self) -> SideOffsets2D<Au> {
// FIXME(pcwalton): Is Au(0) right here for the containing block?

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2266

/// DOM has changed, then the flow constructor will need to do more complicated surgery than
/// this function can provide.
///
/// FIXME(pcwalton): It would be more efficient to not have to clone boxes all the time; i.e.

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self. #2267

let mut old_list_iter = old_list.move_iter().peekable();
let mut new_fragments_iter = new_fragments.iter().enumerate().peekable();

// FIXME(pcwalton): I don't think this will work if multiple old fragments correspond to

This comment has been minimized.

Copy link
@pcwalton

pcwalton Apr 29, 2014

Author Contributor

Note to self: #2270

@pcwalton
Copy link
Contributor Author

pcwalton commented Apr 30, 2014

re-r? @SimonSapin. I had to fix an issue in border styles.

@pcwalton
Copy link
Contributor Author

pcwalton commented May 1, 2014

re-r? @SimonSapin

Filed #2288.

from `Flow`s; in the process, remove `InlineInfo` in favor of the
range-based design that was originally planned and halfway implemented.

Now, the DOM tree structure for inline flows is reflected not by a
series of arrays but instead by a flat list of ranges into the list of
boxes. As part of this, the `border` and `padding` fields, which were
incorrect in the case of inlines and necessitated separate
`noncontent_inline_foo` methods, have been merged into a single
`border_padding` field that is always guaranteed to be correct after
width assignment, even for inlines.
@pcwalton

This comment has been minimized.

Copy link
Owner Author

pcwalton commented on 27276c0 May 2, 2014

r=SimonSapin

@bors-servo

This comment has been minimized.

Copy link
Contributor

bors-servo commented on 27276c0 May 2, 2014

saw approval from SimonSapin
at pcwalton@27276c0

This comment has been minimized.

Copy link
Contributor

bors-servo replied May 2, 2014

merging pcwalton/servo/reparallelize = 27276c0 into auto

This comment has been minimized.

Copy link
Contributor

bors-servo replied May 2, 2014

pcwalton/servo/reparallelize = 27276c0 merged ok, testing candidate = 1ab22d9

This comment has been minimized.

Copy link
Contributor

bors-servo replied May 2, 2014

fast-forwarding master to auto = 1ab22d9

bors-servo pushed a commit that referenced this pull request May 2, 2014
layout: Re-enable parallel layout by removing all `RefCell` instances from `Flow`s; in the process, remove `InlineInfo` in favor of the range-based design that was originally planned and halfway implemented.

Now, the DOM tree structure for inline flows is reflected not by a
series of arrays but instead by a flat list of ranges into the list of
boxes. As part of this, the `border` and `padding` fields, which were
incorrect in the case of inlines and necessitated separate
`noncontent_inline_foo` methods, have been merged into a single
`border_padding` field that is always guaranteed to be correct after
width assignment, even for inlines.

r? @SimonSapin and/or @larsbergstrom

Closes #1280 
Closes #1926
Closes #1999 
Closes #2013
Closes #2018
@bors-servo bors-servo merged commit 27276c0 into servo:master May 2, 2014
1 check passed
1 check passed
default all tests passed
@pcwalton pcwalton deleted the pcwalton:reparallelize branch May 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.