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

Rollup of changes #515

Merged
merged 25 commits into from Jun 14, 2013
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a53a7f6
Add link following and refactor the profiler.
Jun 6, 2013
9085b88
Implement scrolling and better zooming
Jun 6, 2013
abe6a06
Update rust-layers for GL_LINEAR zooming
pcwalton Jun 6, 2013
bf4df24
Provide an interface to the engine for the script task
Jun 6, 2013
ff1178f
handle relative url's when clicking
Jun 6, 2013
0bbf2fc
Refactor flow tree construction and actually use display property.
Jun 8, 2013
1fbfd7d
Implement horizontal scrolling and pinch-to-zoom
pcwalton Jun 9, 2013
7b28462
Send status messages to the compositor
Jun 7, 2013
a9ed2d8
Spin the event loop every 50 ms to allow Rust channels to be processed.
pcwalton Jun 10, 2013
e50cee9
Resolve relative URLs that begin with '//'
pcwalton Jun 10, 2013
f3ad95f
Added a command-line argument for rendering tiles at higher resolutions
Jun 11, 2013
1aa8d64
Fix URL relativization so that links on Wikipedia work
pcwalton Jun 11, 2013
96b9be6
Add a cheesy progress indicator
pcwalton Jun 11, 2013
204c5b6
Add a spinner for layout
pcwalton Jun 11, 2013
aad5113
Update submodules
pcwalton Jun 12, 2013
162ba83
Fix merge fallout
pcwalton Jun 12, 2013
aee2611
Make script and style display:none
pcwalton Jun 12, 2013
e1b9e01
Fix merge fallout which was disabling all CSS classes.
pcwalton Jun 12, 2013
327e799
test: Add a box model smoketest
pcwalton Jun 12, 2013
b75b2de
Compute percent widths/margins properly and fix numerous small visual…
Jun 4, 2013
4017839
Fix padding
Jun 4, 2013
badf1b8
Vertical margins now contribute to content height.
Jun 4, 2013
f3cdbaf
Stop sorting after every profiler datum comes in.
pcwalton Jun 13, 2013
2ec3412
Fix submodules and test_slam_layout
pcwalton Jun 13, 2013
c35abb2
Update rust-glut
pcwalton Jun 14, 2013
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Compute percent widths/margins properly and fix numerous small visual…

… layout bugs.
  • Loading branch information
Eric Atkinson authored and pcwalton committed Jun 12, 2013
commit b75b2de8bb8c5d2103ed99ae2a8f87975a33cde6
@@ -196,15 +196,15 @@ impl BlockFlowData {
let available_width = remaining_width - model.noncontent_width();

// Top and bottom margins for blocks are 0 if auto.
let margin_top = MaybeAuto::from_margin(style.margin_top());
let margin_top = margin_top.spec_or_default(Au(0));
let margin_bottom = MaybeAuto::from_margin(style.margin_bottom());
let margin_bottom = margin_bottom.spec_or_default(Au(0));
let margin_top = MaybeAuto::from_margin(style.margin_top(),
remaining_width).spec_or_default(Au(0));
let margin_bottom = MaybeAuto::from_margin(style.margin_bottom(),
remaining_width).spec_or_default(Au(0));

let (width, margin_left, margin_right) =
(MaybeAuto::from_width(style.width()),
MaybeAuto::from_margin(style.margin_left()),
MaybeAuto::from_margin(style.margin_right()));
(MaybeAuto::from_width(style.width(), remaining_width),
MaybeAuto::from_margin(style.margin_left(), remaining_width),
MaybeAuto::from_margin(style.margin_right(), remaining_width));

// FIXME(pcwalton): We discard the width here. Is that correct?
let (_, margin_left, margin_right) = self.compute_horiz(width,
@@ -218,7 +218,7 @@ impl BlockFlowData {
model.margin.left = margin_left;

x_offset = model.offset();
remaining_width = remaining_width - model.noncontent_width();
remaining_width = width;
}

do box.with_mut_base |base| {
@@ -243,10 +243,12 @@ impl BlockFlowData {

pub fn assign_height_block(@mut self, ctx: &LayoutContext) {
let mut cur_y = Au(0);
let mut top_offset = Au(0);

for self.box.each |&box| {
do box.with_model |model| {
cur_y += model.margin.top + model.border.top + model.padding.top;
top_offset = model.margin.top + model.border.top + model.padding.top;
cur_y += top_offset;
}
}

@@ -260,22 +262,24 @@ impl BlockFlowData {
let height = if self.is_root {
Au::max(ctx.screen_size.size.height, cur_y)
} else {
cur_y
cur_y - top_offset
};

//TODO(eatkinson): compute heights using the 'height' property.
self.common.position.size.height = height;


let mut pb = Au(0);
self.box.map(|&box| {
do box.with_mut_base |base| {
//The associated box is the border box of this flow
base.position.origin.y = base.model.margin.top;

let pb = base.model.padding.top + base.model.padding.bottom +
pb = base.model.padding.top + base.model.padding.bottom +
base.model.border.top + base.model.border.bottom;
base.position.size.height = height + pb;
}
});

//TODO(eatkinson): compute heights using the 'height' property.
self.common.position.size.height = height + pb;

}

pub fn build_display_list_block<E:ExtraDisplayListData>(@mut self,
@@ -37,24 +37,23 @@ pub enum MaybeAuto {
Specified(Au),
}

impl MaybeAuto {
pub fn from_margin(margin: CSSMargin) -> MaybeAuto{
impl MaybeAuto{
pub fn from_margin(margin: CSSMargin, cb_width: Au) -> MaybeAuto{
match margin {
CSSMarginAuto => Auto,
//FIXME(eatkinson): Compute percents properly
CSSMarginPercentage(_) => Specified(Au(0)),
CSSMarginPercentage(percent) => Specified(cb_width.scale_by(percent/100.0)),
//FIXME(eatkinson): Compute pt and em values properly
CSSMarginLength(Px(v)) |
CSSMarginLength(Pt(v)) |
CSSMarginLength(Em(v)) => Specified(Au::from_frac_px(v)),
}
}

pub fn from_width(width: CSSWidth) -> MaybeAuto{
pub fn from_width(width: CSSWidth, cb_width: Au) -> MaybeAuto{
match width{
CSSWidthAuto => Auto,
//FIXME(eatkinson): Compute percents properly
CSSWidthPercentage(_) => Specified(Au(0)),
CSSWidthPercentage(percent) => Specified(cb_width.scale_by(percent/100.0)),
//FIXME(eatkinson): Compute pt and em values properly
CSSWidthLength(Px(v)) |
CSSWidthLength(Pt(v)) |
@@ -165,12 +164,12 @@ impl RenderBox {
let border_width = border.top;
let bounds = Rect {
origin: Point2D {
x: abs_bounds.origin.x,
y: abs_bounds.origin.y,
x: abs_bounds.origin.x + border_width.scale_by(0.5),
y: abs_bounds.origin.y + border_width.scale_by(0.5),
},
size: Size2D {
width: abs_bounds.size.width,
height: abs_bounds.size.height
width: abs_bounds.size.width - border_width,
height: abs_bounds.size.height - border_width
}
};

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.