Commit graph

610 commits

Author SHA1 Message Date
Patrick Walton
b026a8ecf6 layout: Store overflow for flows impacted by floats.
Makes qz.com visible.

In order to work around a compiler bug involving Sized, this patch moves
`store_overflow` to be a virtual method.
2015-05-11 12:59:55 -07:00
bors-servo
844ac2915e Auto merge of #5997 - mbrubeck:table-direction, r=pcwalton
Table columns should be layed out according to the 'direction' property of the
table flow, regardless of the 'direction' property of any table-row,
table-rowgroup, etc. flows.

This fixes a number of the `direction-applies-to-*` tests in the CSS2.1 test
suite.

This also simplifies `propagate_column_inline_sizes_to_child` by separating
the code used for table cells from the code for non-cell flows.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5997)
<!-- Reviewable:end -->
2015-05-11 07:50:09 -05:00
Ms2ger
fa31d7d909 Replace TElement::get_link() by specific methods. 2015-05-11 10:52:58 +02:00
bors-servo
c76d73d124 Auto merge of #5994 - pcwalton:vertical-align-inline-block, r=glennw
Improves Twitter.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5994)
<!-- Reviewable:end -->
2015-05-10 16:23:10 -05:00
Ms2ger
34e35df986 Move get_attr and get_attrs into TElementAttributes.
These methods are only called on LayoutElement.
2015-05-10 18:26:06 +02:00
Matt Brubeck
e36a498cfb Fix direction of columns in mixed LTR/RTL tables.
Table columns should be layed out according to the 'direction' property of the
table flow, regardless of the 'direction' property of any table-row,
table-rowgroup, etc. flows.

This fixes a number of the `direction-applies-to-*` tests in the CSS2.1 test
suite.

This also simplifies `propagate_column_inline_sizes_to_child` by separating
the code used for table cells from the code for non-cell flows.

r? @pcwalton
2015-05-08 21:29:02 -07:00
Patrick Walton
614c877527 layout: Support vertical-align for inline-blocks.
Improves Twitter.
2015-05-08 17:59:01 -07:00
Patrick Walton
7b92b99c6d layout: Take the width attribute of <img> into account when
computing the intrinsic widths of the associated fragment.

Fixes sites that use spacer gifs for table layout, such as the comments
page on Hacker News.
2015-05-08 13:30:27 -07:00
bors-servo
0872ed922f Auto merge of #5940 - pcwalton:inline-margins, r=glennw
Improves the Google SERPs.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5940)
<!-- Reviewable:end -->
2015-05-07 19:10:31 -05:00
Patrick Walton
b17b90c8df layout: Implement inline margins.
Improves the Google SERPs.

We mark `html/rendering/replaced-elements/images/space.html` as failing.
This test tested whether `<img hspace>` and inline margins do the same
thing. Since this was trivially the case before (since we implemented
neither) and now is not, this test now fails.
2015-05-07 16:25:05 -07:00
Patrick Walton
be8a5a2939 layout: Don't rerun selector matching unless we need to when resizing
the window.
2015-05-07 15:48:14 -07:00
bors-servo
ccf1e6b9a7 Auto merge of #5361 - luniv:css-device-adapt, r=mbrubeck
Spec: http://dev.w3.org/csswg/css-device-adapt/

Currently, the actual viewport is used by the layout task as part of the reflow, and the compositor uses the zoom constraints. I'm not sure if anywhere else currently needs access to the constraints (i.e. there's no CSSOM as far as I can tell).

I did not implement sections 9 (viewport <META>) or 10 (handling 'auto' for 'zoom').

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5361)
<!-- Reviewable:end -->
2015-05-06 12:41:09 -05:00
James Gilbertson
138596e861 Constrain the viewport & zoom when reflowing 2015-05-06 00:34:33 -06:00
bors-servo
5e59e77c41 Auto merge of #5753 - JIoJIaJIu:timeline, r=jdm
RequestAnimationFrame
[Task](https://github.com/servo/servo/issues/5681)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5753)
<!-- Reviewable:end -->
2015-05-06 00:50:13 -05:00
bors-servo
1721cf45ed Auto merge of #5951 - SimonSapin:au-cleanup, r=mbrubeck
Fix #5943.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5951)
<!-- Reviewable:end -->
2015-05-05 15:08:12 -05:00
Guro Bokum
be2cb665de Start using on_refresh_driver_tick #5681
Final
2015-05-06 02:08:39 +07:00
Ms2ger
475c27e966 Make DEBUG_ID_COUNTER a plain static.
Apparently it no longer needs to be static mut.
2015-05-05 19:04:53 +02:00
Simon Sapin
b1ecba9f3d Use i32 instead of isize in Au methods. 2015-05-05 18:40:00 +02:00
Simon Sapin
8b522f2e7d Rename Au methods with f32/f64 instead of frac32/frac/subpx 2015-05-05 18:23:29 +02:00
Simon Sapin
32d5e24922 Replace Au-related free functions in util::geometry with Au methods. 2015-05-05 17:36:03 +02:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Patrick Walton
33087497ac layout: Fix a couple of issues relating to intrinsic widths of inline
blocks.

* Stop double-counting border and padding for inline-block fragments.
  (Test case: `inline_block_border_intrinsic_size_a.html`.)

* Take clearance into account when determining intrinsic widths of
  blocks containing floats.

Improves the Amazon headers.
2015-05-01 18:07:07 -07:00
bors-servo
a346f95e68 Auto merge of #5918 - pcwalton:block-formatting-context-float-placement, r=mbrubeck
Improves Amazon.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5918)
<!-- Reviewable:end -->
2015-05-01 18:01:03 -05:00
Patrick Walton
986f81afa7 layout: Use the border box, not the margin box, for placement of block
formatting contexts.

Improves Amazon.
2015-05-01 15:11:46 -07:00
bors-servo
2f0b805fad Auto merge of #5916 - servo:prepare-rustup, r=jdm
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5916)
<!-- Reviewable:end -->
2015-05-01 14:44:19 -05:00
Ms2ger
0a5ffc4bb0 Remove an as_slice() call. 2015-05-01 21:17:14 +02:00
Ms2ger
ad4996b545 Remove a range() call. 2015-05-01 21:16:43 +02:00
bors-servo
5f6a740190 Auto merge of #5913 - glennw:bounding-rect, r=pcwalton
* Fix queries involving stacking contexts
 * The code was double accumulating stacking context origins.
* Handle queries of inline elements.
 * The node addresses being compared were incorrect (CharacterData vs. Span)
* Handle ScriptQuery reflows correctly.
 * The layout task was skipping the compute absolute positions traversal, so failed before window.onload.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5913)
<!-- Reviewable:end -->
2015-05-01 13:15:23 -05:00
Glenn Watson
a5a5214783 Various fixes to getClientBoundingRect()
* Fix queries involving stacking contexts
 * The code was double accumulating stacking context origins.
* Handle queries of inline elements.
 * The node addresses being compared were incorrect (CharacterData vs. Span)
* Handle ScriptQuery reflows correctly.
 * The layout task was skipping the compute absolute positions traversal, so failed before window.onload.
2015-05-01 12:40:37 +10:00
Nicholas Nethercote
092507d23c Add a profile_traits crate to reduce compile times.
A rebuild after touching components/profile/mem.rs now takes 48 seconds (and
only rebuilds `profile` and `servo`) which is much lower than it used to be.
In comparison, a rebuild after touching components/profile_traits/mem.rs takes
294 seconds and rebuilds many more crates.

This change also removes some unnecessary crate dependencies in `net` and
`net_traits`.
2015-04-30 17:58:47 -07:00
bors-servo
19a4a26364 Auto merge of #5895 - psdh:uniformiseMsgTypes, r=jdm
Fixes #5882

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5895)
<!-- Reviewable:end -->
2015-04-29 15:51:39 -05:00
Prabhjyot Singh Sodhi
b980278d90 Uniformise the various Msg types [#5882] 2015-04-30 01:22:16 +05:30
Matt Brubeck
50f982bb0c Fix text-align left/right in RTL layout 2015-04-29 07:07:58 -07:00
Matt Brubeck
81e8f18662 Support text-align: start and end 2015-04-29 07:07:58 -07:00
Jinwoo Song
f404853c99 Make NodeTypeId include CharacterData variant
NodeTypeId is supposed to reflect the WebIDL inheritance hierarchy.
All of Text/ProcessingInstruction/Comment inherit from CharacterData,
which inherits from Node. There should be a CharacterDataTypeId value
that differentiates between those, instead.
2015-04-29 13:30:21 +09:00
bors-servo
1e150140bd Auto merge of #5480 - SimonSapin:multicol, r=pcwalton
This add some properties to the style system and a new flow type, but the larger issues of dealing with fragmentation in the flow tree is still an open question.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5480)
<!-- Reviewable:end -->
2015-04-28 19:48:45 -05:00
Simon Sapin
544a02a250 Refactor flow construction to make float less of a special case. 2015-04-29 02:47:46 +02:00
Simon Sapin
cc4749373a Add MulticolFlow and use it for multicol elements.
It currently "inherits" from BlockFlow and does not override anything.
2015-04-29 02:29:33 +02:00
bors-servo
0a4db7ae0f Auto merge of #5889 - pcwalton:remove-absolute-static-i-offset, r=glennw
They haven't been used for hypothetical box calculation in quite some
time.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5889)
<!-- Reviewable:end -->
2015-04-28 18:30:38 -05:00
Patrick Walton
132658856f layout: Remove absolute_static_i_offset and fixed_static_i_offset.
They haven't been used for hypothetical box calculation in quite some
time.
2015-04-28 15:39:44 -07:00
Ms2ger
903305416a Implement Clone for Copy types. 2015-04-28 23:31:10 +02:00
bors-servo
b6fc83cf2b Auto merge of #5887 - pcwalton:border-collapse-missing-cells, r=mbrubeck
This was seen in Twitter and the Google SERPs (sometimes).

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5887)
<!-- Reviewable:end -->
2015-04-28 15:32:31 -05:00
Patrick Walton
577f1ea109 layout: Don't panic in border collapse when a row has fewer cells than
its previous sibling.

This was seen in Twitter and the Google SERPs (sometimes).
2015-04-28 13:16:01 -07:00
Matt Brubeck
cad5d8b670 Ignore border-spacing for tables with zero cells 2015-04-28 10:30:47 -07:00
Patrick Walton
f56eb0fe80 layout: Minor whitespace fixes. 2015-04-28 09:26:09 -07:00
Patrick Walton
44a30054a1 layout: Make margin: auto work properly with tables.
Improves the Amazon home page.
2015-04-28 09:26:08 -07:00
bors-servo
2fd5ecf3d7 Auto merge of #5694 - pcwalton:anonymous-table-objects, r=mbrubeck
Improves Facebook Timeline.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5694)
<!-- Reviewable:end -->
2015-04-28 07:13:53 -05:00
bors-servo
adec683333 Auto merge of #5878 - pcwalton:intrinsic-style-specified-width, r=mbrubeck
Improves the front page of Google.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5878)
<!-- Reviewable:end -->
2015-04-28 05:02:32 -05:00
bors-servo
1cb012fc50 Auto merge of #5857 - Ms2ger:preshints, r=pcwalton
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5857)
<!-- Reviewable:end -->
2015-04-28 03:24:14 -05:00
Patrick Walton
a92baf7683 layout: Make the style-specified width affect minimum width.
Improves the front page of Google.
2015-04-27 18:32:28 -07:00