Commit graph

596 commits

Author SHA1 Message Date
James Gilbertson
138596e861 Constrain the viewport & zoom when reflowing 2015-05-06 00:34:33 -06: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
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
Ms2ger
ed052bc080 Move the sink into util::vec. 2015-04-27 23:44:22 +02:00
Patrick Walton
f0954f8799 layout: Generate anonymous table objects as necessary per CSS 2.1 §
17.2.1.

Improves Facebook Timeline.
2015-04-27 14:12:44 -07:00
Ms2ger
811ea395bc Avoid creating a vector in can_share_style_with. 2015-04-27 20:25:19 +02:00
Simon Sapin
11b3e3b775 Remove some usage of .as_slice(). 2015-04-27 17:38:37 +02:00
Patrick Walton
0b6f84e6a1 Tidy fix 2015-04-27 17:12:08 +02:00
Patrick Walton
4d46d257cd Address review comments 2015-04-27 17:12:08 +02:00
Patrick Walton
48299a53cb layout: Implement most of border-collapse per CSS 2.1 § 17.6.2.
Known issues:

* Collapsed borders do not correctly affect the border-box of the table
  itself.

* The content widths of all cells in a column and the content height of
  all cells in a row is the same in this patch, but not in Gecko and
  WebKit.

* Corners are not painted well. The spec does not say what to do here.

* Column spans are not handled well. The spec does not say what to do
  here either.
2015-04-27 17:12:07 +02:00
Ms2ger
e3440c8a59 Move bgcolor over to the new infrastructure.
Note that I call is_htmltabledatacellelement in
synthesize_presentational_hints_for_legacy_attributes, rather than
is_htmltablecellelement (which was used in
get_simple_color_attribute_for_layout), because that function was never called
for th elements.
2015-04-26 22:25:11 +02:00
Anthony Ramine
4e7b9d319c Remove useless unsafe methods on LayoutJS<T> 2015-04-26 21:39:11 +02:00
Ms2ger
582ee1c2b3 Create a new infrastructure for presentational hints. 2015-04-26 21:25:06 +02:00
Ms2ger
9185c3de79 Remove as_mut_slice() calls. 2015-04-26 11:09:03 +02:00
Patrick Walton
8741d9e8c4 layout: Use a flag to record whether we need to perform a line break if
wrapping on newlines rather than searching for a newline character.

Since the newline character might have been stripped out during
whitespace stripping, this was incorrect.

Fixes the "jumpiness" seen on the Google home page, Wikipedia, and many
other places.
2015-04-24 13:16:34 -07:00
Ms2ger
6a55ae06d7 Remove some as_slice calls. 2015-04-24 17:44:47 +02:00
Adenilson Cavalcanti
4f210eb8fe Fixing inline elements filtering rendering.
It required to move create_stacking_context() outside of BlockFlow,
as a method of FragmentDisplayListBuilding. This allowed the reuse
for inline fragments that need a stacking context.

As we now create stacking contexts (SC) for inline elements, this stresses
the code in Fragment that calculates the need for a SC.

For while, we create a SC only if there are filters associated with the
Inline element. Companion issue is #5812.
2015-04-23 12:32:18 -07:00