Commit graph

180 commits

Author SHA1 Message Date
Ms2ger
3984e39011 Replace the StyledNode trait with inherent methods. 2015-07-27 19:57:33 +02:00
Matt Brubeck
dfac8ce4a1 Basic support for bidirectional text 2015-07-23 20:05:55 -07:00
Patrick Walton
c84368b703 layout: Make the output of flow tree dumping easier to read when there
are many fragments.
2015-07-07 15:01:18 -07:00
Simon Sapin
75e3e787f6 Upgrade to rustc 1.3.0-dev (f3b97a74a 2015-07-03) 2015-07-04 11:32:41 +02:00
Matt Brubeck
a3b339c358 Simplify next_fragment and fix obsolete docs 2015-06-22 15:23:00 -07:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
Manish Goregaokar
94fa868d2b Add unsafe blocks to make_unique
See #6376
2015-06-14 20:52:27 +05:30
Corey Farwell
5c408d2be9 rust-geom API changes
https://github.com/servo/rust-geom/pull/81
2015-06-13 12:28:21 -07:00
bors-servo
a8b6632a5a Auto merge of #6328 - mbrubeck:line-comment, r=pcwalton
r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6328)
<!-- Reviewable:end -->
2015-06-10 17:44:55 -06:00
Matt Brubeck
775953b11e Fix indices in Line::range doc comment 2015-06-10 14:04:15 -07:00
Manish Goregaokar
af364a412e Audit and reduce unstable usage in layout
Reasons behind existing unstable features:

alloc:

 - `make_unique()`
 - direct calls into `heap::allocate()`, etc
 - `boxed::into_raw()` (naming)

collections:

 - `slice_chars()` (needs to prove its worth)

core:

 - lots and lots of pointer manip
 - `raw` stuff

std_misc:

 - Handle stuff
 - hasher stuff

str_char:

 - CharRange
2015-06-10 00:54:14 +05:30
Patrick Walton
6a197719b3 compositing: Implement display ports and avoid creating display lists
for items outside it.

This improves Servo's performance on large pages.
2015-05-19 16:53:51 -07:00
Patrick Walton
d5ca1a18dc layout: Support percentage widths in inline-blocks.
Improves Twitter.
2015-05-19 13:35:02 -07:00
Matt Brubeck
ec5c333347 Use the correct writing mode for Floats fields
Fixes #6113 (assertion failures caused by floats in mixed-direction pages).
2015-05-18 17:24:43 -07:00
Kevin Butler
dcf91d9eba Skip empty fragments when justifying inline fragments.
Fixes #5856
2015-05-18 16:03:13 +01:00
Ms2ger
db61c54858 Remove an unused import. 2015-05-14 13:10:56 +02:00
Patrick Walton
a299a2c71c layout: Minor whitespace and formatting cleanups. 2015-05-13 12:00:55 -07:00
Patrick Walton
1f0b5889da layout: Allow inline elements to be containing blocks for
absolutely-positioned elements.

This also implements a little bit of the infrastructure needed to
support for fragmentation via support for multiple positioned fragments
in one flow.

Improves Google.
2015-05-13 12:00:53 -07:00
Patrick Walton
3875c9db4a layout: Support block-direction margins for inline-blocks.
Improves linux.com.
2015-05-11 17:49:12 -07:00
Patrick Walton
4b9cd4e65d layout: Implement <table width> and <center>.
Improves Hacker News.
2015-05-11 12:53:45 -07:00
Patrick Walton
614c877527 layout: Support vertical-align for inline-blocks.
Improves Twitter.
2015-05-08 17:59:01 -07: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
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
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
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
Ms2ger
903305416a Implement Clone for Copy types. 2015-04-28 23:31:10 +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
6a55ae06d7 Remove some as_slice calls. 2015-04-24 17:44:47 +02:00
bors-servo
68f03c9dbb Auto merge of #5805 - pcwalton:whitespace-effect-on-minimum-inline-sizes, r=glennw
Improves Amazon.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5805)
<!-- Reviewable:end -->
2015-04-22 20:23:17 -05:00
Patrick Walton
f8b9b31680 layout: Take the white-space property into account when computing
intrinsic sizes of inline flows.

Improves Amazon.
2015-04-22 17:45:16 -07:00
Ms2ger
4d41f1c991 Stop using the deprecated range function. 2015-04-22 20:26:40 +02:00
Patrick Walton
acd08c67c6 layout: Use the same code path for computing static positions of regular
flows and static positions of hypothetical boxes.

Before this change, Servo used one code path that computed the position
of flows with `position: static` or `position: relative` and another
separate code path that computed the position of flows with `position:
absolute` or `position: fixed`. The latter code attempted to duplicate
the former code to determine the static position of hypothetical boxes,
but this was both fragile and incorrect in the case of hypothetical
boxes nested inside floats. In fact, it's impossible to determine the
static position of an absolute flow relative to its containing block at
inline-size assignment time, because that static position could depend
on a float that cannot be placed until block-size assignment!

This patch changes block layout to use the same code path for static
positioning of regular flows and static positioning of absolute flows
where applicable. This both simplifies the code and improves its
efficiency, since it allows the `hypothetical_position` field and
`static_block_offsets` data structure to be removed. Moreover, it
improves correctness in the above case (which the new reftest checks).
This allows the sidebar in Facebook Timeline to be positioned properly.
2015-04-14 13:00:10 -07:00
Glenn Watson
3815cb4a81 Remove unneeded assert (code below handles it) and a warning. Fixes #5230. 2015-04-10 09:55:59 +10:00
bors-servo
d7b6961104 Auto merge of #5623 - pcwalton:nested-inline-vertical-align, r=glennw
This allows things like `<sup><span>Foo</span></sup>` to work and
improves Wikipedia.

r? @glennw
2015-04-09 17:20:23 -05:00
Patrick Walton
18074bf908 layout: Lay out nested inline elements with different vertical-align
values properly in simple cases.

This allows things like `<sup><span>Foo</span></sup>` to work and
improves Wikipedia.
2015-04-09 14:55:05 -07:00
Patrick Walton
00a2685cbe layout: During inline layout, make place_between_floats use the same
line height computation logic as final block size assignment.

Improves Wikipedia.
2015-04-09 14:23:08 -07:00
Patrick Walton
6d61468160 layout: Simplify and improve the correctness of whitespace stripping in
text layout, and unify the inline layout paths for pre- and
normally-formatted text.

This fixes a lot of "jumpiness" and removes the `new_line_pos` stuff.

Closes #2260.
2015-04-08 14:29:23 -07:00
Ms2ger
a0ad6ba2d4 Use usize for indices into InlineFragments. 2015-04-02 14:53:30 +02:00
Ms2ger
232dadc81d Use isize for FragmentIndex. 2015-04-02 14:53:10 +02:00
Ms2ger
43ed033eff Use isize/usize in range. 2015-03-28 15:36:36 +01:00
Manish Goregaokar
3479d3fa7f Replace unsafe_blocks by unsafe_code. 2015-03-21 10:27:32 +01:00
bors-servo
646f821479 auto merge of #5268 : mbrubeck/servo/append, r=jdm
The new `Vec::append` method is clearer and potentially faster.
2015-03-18 21:39:49 -06:00
Matt Brubeck
94a7563aea Use append instead of extend where possible
The new `Vec::append` method is clearer and potentially faster.
2015-03-18 17:17:33 -07:00
Glenn Watson
d61d3ad4ba Fixes positioning of inline blocks that generate stacking contexts. 2015-03-19 07:38:33 +10:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00