Commit graph

926 commits

Author SHA1 Message Date
David Zbarsky
67db4fbc2e Remove stray changes 2015-08-26 14:15:01 -07:00
David Zbarsky
cb4d878169 Implement Calc for LengthOrPercentageOrAuto 2015-08-26 14:14:45 -07:00
David Zbarsky
9556141e57 Implement Calc for LengthOrPercentage 2015-08-26 14:14:43 -07:00
Patrick Walton
5c51a6214e layout: Fix calculation of overflow for stacking contexts that contain
`position: relative` fragments.

Fixes placement of the header on espn.go.com.
2015-08-25 15:08:28 -07:00
Patrick Walton
35c67b22e5 layout: Don't crash if quotes: none is specified and generated content
uses quotes.

Avoids a crash on The Verge.
2015-08-24 17:00:23 -07:00
bors-servo
524b02dbf7 Auto merge of #7331 - paulrouget:issue-7316, r=SimonSapin
prevent division by 0

Fix #7316

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7331)
<!-- Reviewable:end -->
2015-08-24 05:08:41 -06:00
bors-servo
fa06a96f8a Auto merge of #7334 - servo:active, r=SimonSapin
Parse :active pseudo-class selector.

This is #7258 with a spec link added in doc-comment.

The pseudo-class is never matched, but this can still help with stylesheets like `a:hover, a:active { color: something }` where failing to parse one pseudo-class makes the entire selector list invalid.

I filed #7333 about actually making it match.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7334)
<!-- Reviewable:end -->
2015-08-24 04:23:13 -06:00
Paul Rouget
4987e320d4 prevent division by 0
Fix 7316
2015-08-24 08:53:37 +02:00
bors-servo
7945c174a6 Auto merge of #7291 - pcwalton:has-layer-flag, r=mbrubeck
layout: Centralize the logic that determines whether fragments get layers in the fragment.

…so that it can be activated when we're forcing
the creation of extra layers due to positioned descendants that
themselves have layers.

The newly failing tests were tests that accidentally passed due to
incorrect stacking order.

Closes #7281.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7291)
<!-- Reviewable:end -->
2015-08-22 15:56:05 -06:00
Patrick Walton
ec1c90df41 layout: Centralize the logic that determines whether fragments get
layers in the fragment, so that it can be activated when we're forcing
the creation of extra layers due to positioned descendants that
themselves have layers.

The newly failing tests were tests that accidentally passed due to
incorrect stacking order.

Closes #7281.
2015-08-22 12:41:33 -07:00
Patrick Walton
fed904fff5 layout: Make position: relative with non-auto z-index create a
stacking context.

Improves imgur.com and Fast Company articles.
2015-08-22 12:22:33 -07:00
Patrick Walton
930dfbb7ad layout: Fix merge fallout. 2015-08-21 16:08:13 -07:00
Simon Sapin
2fa2a3b5a9 Sort imports. 2015-08-21 15:59:20 -07:00
Kyle Zentner
0e18f645f4 Implement FlexFlow::assign_block_size(). 2015-08-21 15:59:19 -07:00
Kyle Zentner
e95c15816d Implement FlexFlow::assign_inline_sizes(). 2015-08-21 15:59:18 -07:00
Kyle Zentner
0488a36862 Create FlexFlow's for 'display: flex' nodes.
This commit doesn't implement any flexbox behavior at all.
It just constructs FlexFlow's, which act just like the BlockFlow from
which they "inherit."
2015-08-21 15:59:18 -07:00
Simon Sapin
21d69314d4 Don’t mark flow_ref::deref_mut as unsafe.
See discussion in https://github.com/servo/servo/pull/7237
2015-08-21 21:16:25 +02:00
Simon Sapin
649250130b Replace FlowRef with Arc<Flow>, now that Arc supports DST.
… and WeakFlowRef with Weak<Flow>.
2015-08-20 16:49:48 +02:00
Simon Sapin
2d22aa8e7e Replace the unsound impl DerefMut for FlowRef with an unsafe function.
See #6503.
2015-08-20 16:24:26 +02:00
bors-servo
a5fbb2f2a6 Auto merge of #7265 - tafia:tidy-use, r=Ms2ger
Add alphabetical order check for use statements

close #7112

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7265)
<!-- Reviewable:end -->
2015-08-20 07:43:56 -06:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
bors-servo
39b7508aa2 Auto merge of #7251 - nox:text-transform-length-change, r=SimonSapin
Correctly handle length-changing mappings in text-transform



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7251)
<!-- Reviewable:end -->
2015-08-20 06:40:33 -06:00
Patrick Walton
a516042edb layout: Don't panic if requestAnimationFrame() is called before first layout.
Closes #7115.
2015-08-20 13:17:07 +02:00
Patrick Walton
4df4d1a1a9 layout: Put iframes that form stacking contexts in the right place.
Improves eBay.

Closes #7282.
2015-08-19 12:08:36 -07:00
bors-servo
5c284a546a Auto merge of #7280 - pcwalton:style-specified-img-intrinsic-width, r=mbrubeck
layout: Take the style-specified width into account when computing the intrinsic inline sizes of images.

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/7280)
<!-- Reviewable:end -->
2015-08-19 11:39:33 -06:00
bors-servo
0234bbe444 Auto merge of #7279 - pcwalton:tile-image-divide-by-zero, r=mbrubeck
layout: Avoid a division by zero in `tile_image()`.

Fixes a crash on 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/7279)
<!-- Reviewable:end -->
2015-08-19 04:41:54 -06:00
Anthony Ramine
bb3d3db333 Correctly handle length-changing mappings in text-transform 2015-08-19 12:05:31 +02:00
bors-servo
195d267e23 Auto merge of #7276 - pcwalton:inline-absolute-hypothetical-clip, r=mbrubeck
layout: Make inline absolute hypothetical boxes not clip their contents.

Improves the logo on ebay.com.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7276)
<!-- Reviewable:end -->
2015-08-19 03:54:10 -06:00
bors-servo
30a1339ed1 Auto merge of #7274 - pcwalton:table-minimum-width, r=mbrubeck
layout: Make table cells' minimum inline sizes override explicitly specified widths if the latter are too small.

Improves ebay.com.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7274)
<!-- Reviewable:end -->
2015-08-19 03:20:37 -06:00
Patrick Walton
66473625db layout: Take the style-specified width into account when computing the
intrinsic inline sizes of images.

Improves Facebook Timeline.
2015-08-18 18:46:07 -07:00
Patrick Walton
02b15e016d layout: Avoid a division by zero in tile_image().
Fixes a crash on Facebook Timeline.
2015-08-18 18:44:50 -07:00
Patrick Walton
c328c38804 layout: Make inline absolute hypothetical boxes not clip their contents.
Improves the logo on ebay.com.
2015-08-18 16:58:18 -07:00
Patrick Walton
9d41841964 layout: Make table cells' minimum inline sizes override explicitly
specified widths if the latter are too small.

Improves ebay.com.
2015-08-18 14:38:49 -07:00
bors-servo
19d466b062 Auto merge of #7256 - pcwalton:block-formatting-contexts-max-width, r=mbrubeck
layout: Use the value of the `max-width` property when speculating what the inline sizes of block formatting contexts are likely to be.

Usually, Web developers set this property on block formatting contexts
in order to avoid running into floats, and we can use this as a
speculation hint.

Fixes the width of the search box on the Google SERPs.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7256)
<!-- Reviewable:end -->
2015-08-18 13:38:05 -06:00
Corey Farwell
6aaada64dc flow::Flow should follow *_mut naming conventions
Fixes #7148
2015-08-18 09:12:01 -04:00
bors-servo
3d0951cf25 Auto merge of #7243 - nox:border-collapse-panic, r=pcwalton
Avoid a panic when handling collapsing borders (fixes #7144)

There is no need to compute next_collapsed_borders_in_block_direction for all kind of flows when it's used only in the table row case. That also avoids a panic when the next child is a table colgroup (this should not happen when iterating over a table row).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7243)
<!-- Reviewable:end -->
2015-08-18 05:15:12 -06:00
Anthony Ramine
d885958621 Avoid a panic when handling collapsing borders (fixes #7144)
There is no need to compute next_collapsed_borders_in_block_direction for all
kind of flows when it's used only in the table row case. That also avoids a panic
when the next child is a table colgroup (this should not happen when iterating
over a table row).
2015-08-18 12:56:18 +02:00
Patrick Walton
6567c269cf script: Update rust-selectors to get :active support.
I couldn't find the place in the spec where the precise behavior of
`:active` is described, so I don't set it. However, all the machinery to
keep track of its status is in place.

Improves YouTube.
2015-08-17 17:52:21 -07:00
João Oliveira
067a22a868 Replace uses of for foo in bar.iter(),
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
2015-08-18 01:46:11 +01:00
Patrick Walton
69e5bd2e3d layout: Use the value of the max-width property when speculating what
the inline sizes of block formatting contexts are likely to be.

Usually, Web developers set this property on block formatting contexts
in order to avoid running into floats, and we can use this as a
speculation hint.

Fixes the width of the search box on the Google SERPs.
2015-08-17 17:01:20 -07:00
bors-servo
d654841288 Auto merge of #7177 - pcwalton:intervening-inline-block, r=mbrubeck
layout: Improve our handling of inline absolute containing blocks.

Several issues are addressed in this commit:

* Inline flows now bubble up their absolute descendants instead of
  making the inline flow the containing block for them. (In the future,
  we will need to make the inline flow *sometimes* be the containing
  block for them, but for now it improves sites to unconditionally
  bubble up.)

* Fragments now look at their inline fragment context to determine
  whether they are positioned.

* Inline flows now push the stacking-relative position of the absolute
  containing block down to their inline-block fragments.

* Inline absolute hypothetical fragments can be containing blocks.

* Fixes the logic in
  `containing_block_range_for_flow_surrounding_fragment_at_index`. The
  condition to determine whether fragments are positioned was inverted!

* `Descendants`/`AbsDescendants` has been refactored in order to become
  more friendly to inline absolute containing blocks in the future.

Improves the inline position of the green drop-down arrow in the Google
SERPs. (The block position is still wrong.)

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7177)
<!-- Reviewable:end -->
2015-08-17 13:56:53 -06:00
Patrick Walton
a30379975a layout: Improve our handling of inline absolute containing blocks.
Several issues are addressed in this commit:

* Inline flows now bubble up their absolute descendants instead of
  making the inline flow the containing block for them. (In the future,
  we will need to make the inline flow *sometimes* be the containing
  block for them, but for now it improves sites to unconditionally
  bubble up.)

* Fragments now look at their inline fragment context to determine
  whether they are positioned.

* Inline flows now push the stacking-relative position of the absolute
  containing block down to their inline-block fragments.

* Inline absolute hypothetical fragments can be containing blocks.

* Fixes the logic in
  `containing_block_range_for_flow_surrounding_fragment_at_index`. The
  condition to determine whether fragments are positioned was inverted!

* `Descendants`/`AbsDescendants` has been refactored in order to become
  more friendly to inline absolute containing blocks in the future.

Improves the inline position of the green drop-down arrow in the Google
SERPs. (The block position is still wrong.)
2015-08-17 12:43:12 -07:00
João Oliveira
1e20447746 replace len() !=0 with !is_empty() 2015-08-17 02:56:07 +01:00
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
João Oliveira
0038580abf Replace uses of for foo in bar.iter() and for foo in bar.iter_mut()
closes #7197
2015-08-15 02:27:39 +01:00
João Oliveira
9c11781880 replace .len() == 0 with is_empty()
closes #7198
2015-08-14 04:00:33 +01:00
Patrick Walton
8fe2f8930c layout: Make inline margins on <input type=button> and friends apply
only to the button and not to the text inside.

Improves the Google home page.
2015-08-13 09:51:17 -07:00
Glenn Watson
04581660b3 Add fix for compositor repainting tiles on scroll layers that have stale clipping results.
Needed for #6643. Fixes #7153.
2015-08-13 13:53:03 +10:00
Patrick Walton
8640cf5588 layout: Take relative position offsets for inlines and inline-blocks
into account only once.

There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

This commit also removes the `cascade_anonymous` function and the
related `Fragment` constructor. They were unused, and their
functionality has been replaced by the `modify_style_for_*` series of
functions.

Closes #7067.
2015-08-12 08:28:35 -07:00
Ms2ger
fdafc5c360 Store a Sender<ConstellationControlMsg> in LayoutTask. 2015-08-12 15:55:16 +02:00