Commit graph

302 commits

Author SHA1 Message Date
Simon Sapin
80d471d5cf Merge branch 'master' into calc 2015-09-01 18:39:16 +02:00
bors-servo
dee6283483 Auto merge of #7474 - notriddle:master, r=pcwalton
Inline constraint resolver for absolutely positioned tables.

Fixes #7425.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7474)
<!-- Reviewable:end -->
2015-08-31 20:35:06 -06:00
Michael Howell
36759338c7 Inline constraint resolver for absolutely positioned tables.
Fixes #7425.
2015-08-31 16:45:17 -07:00
bors-servo
afc2c381db Auto merge of #7370 - bjwbell:bugfix-unequal-borders, r=pcwalton
gfx: Border radius support for asymmetric sized borders

When the border-top/right/bottom/left-widths are not equal, the angle on the border corner arc separating the borders isn't PI/4. 

For instance if the top border width is much larger than the left border width then most of the border corner should be drawn using the top border color.

This change adds support for calculating the correct angle in the border
corner arc for switching from one border to another e.g. the left border
to the top border.

It supports elliptical border radii for when elliptical border radii are
added.

A ref test is also included.

r? @Ms2ger 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7370)
<!-- Reviewable:end -->
2015-08-31 14:58:33 -06:00
Bryan Bell
d539b9b2e6 gfx: Border radius support for asymmetric borders
This change adds support for calculating the correct angle in the border
corner arc when switching from one border to another e.g. the left border
to the top border.

When the border-top/right/bottom/left-widths are not the same, the angle on
the border corner arc separating the borders isn't pi/4.

For example, if the top border width is much larger than the left border
width then most of the border corner should be drawn using the top
border color.

Elliptical border radii are supported for when elliptical border radii are
added.

The common case where borders have the same width sets the angle to
pi/4 directly.

A ref test is also included.
2015-08-31 13:02:05 -07:00
Josh Matthews
6e26fefad1 Allow setting preferences from the reftest manifest. Add a command-line arg to enable a given preference. 2015-08-28 10:50:55 -04:00
David Zbarsky
25829bbb12 Add calc reftest 2015-08-26 14:48:34 -07:00
Corey Farwell
574e11d70a Enable commented out inline_text_align_* ref test
At some point this test did not work, but now it does

Closes #1575
2015-08-25 23:25:23 -04: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
bors-servo
f79220f1a8 Auto merge of #7355 - servo:iframe_size_attributes_vertical_writing_mode, r=pcwalton
Refactor tests/ref/iframe/size_attributes_vertical_writing_mode.html

… to not use an arbitrary 104px offset that just happens to match the reference and relies on incorrect behavior.

See discussion in #7313.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7355)
<!-- Reviewable:end -->
2015-08-25 10:04:39 -06:00
ecoal95
6341c77700 webgl: Implement multiple calls and improve error detection
This commit implements WebGL's:
 * cullFace
 * frontFace
 * enable
 * disable
 * depthMask
 * colorMask
 * clearDepth
 * clearStencil
 * depthFunc
 * depthRange
 * hint
 * lineWidth
 * pixelStorei
 * polygonOffset
 * texParameteri
 * texParameterf
 * texImage2D (partially)

It inlines a lot of OpenGL calls to keep the file
`components/canvas/webgl_paint_task.rs` as small as possible while
keeping readability.

It also improves error detection on previous calls, and sets node damage
on the canvas in the drawing calls.

It adds a `TexImage2D` reftest, even though it's not enabled because:
 * WebGL paints the image when it loads (asynchronously), so the reftest doesn't wait for it and it finishes early
 * If we change the source for the base64 src of the image it works as expected in non-headless mode, but the test harness locks
2015-08-25 17:16:46 +02:00
Simon Sapin
97f71bb257 Refactor tests/ref/iframe/size_attributes_vertical_writing_mode.html
… to not use an arbitrary 104px offset that just happens to match the reference
and relies on incorrect behavior.
2015-08-25 12:39:49 +02: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
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
Kyle Zentner
e3bbcb50d2 Add reftests for basic flexbox functionality.
These tests (flex_row_direction.html and flex_column_direction.html) are
correct, but only test the small amount of current flexbox
functionality.
2015-08-21 15:59:19 -07:00
Patrick Walton
277cbf407e gfx: Sort layers according to their Z-index value before handing them
off to the compositor.

Closes #7166.
2015-08-19 16:30:44 -07: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
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
118838aa01 Auto merge of #7264 - servo:ref, r=nox
Add missing tests to basic.list (fixes #7077).



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7264)
<!-- Reviewable:end -->
2015-08-19 02:14:06 -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
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
Ms2ger
860b5a1aa3 Add missing tests to basic.list (fixes #7077). 2015-08-18 16:48:53 +02: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
f4b526cfb4 Auto merge of #7222 - pcwalton:dashed-border-radius, r=glennw
gfx: Paint dashed borders with nonzero radii the same way Gecko does.

It's not ideal, but it was easy to implement and will do for now.

Closes #7157.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7222)
<!-- Reviewable:end -->
2015-08-17 16:53:58 -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
Patrick Walton
3f4487d81d gfx: Paint dashed borders with nonzero radii the same way Gecko does.
It's not ideal, but it was easy to implement and will do for now.

Closes #7157.
2015-08-14 16:42:47 -07: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
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
bors-servo
7ce47266ac Auto merge of #7137 - pcwalton:absolute-stacking-contexts, r=glennw
layout: Make absolutely-positioned elements with `z-index: auto` not stacking contexts.

Improves many sites.

Closes #7069.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7137)
<!-- Reviewable:end -->
2015-08-11 12:22:14 -06:00
Patrick Walton
d3d59ced36 layout: Make absolutely-positioned elements with z-index: auto not
stacking contexts.

Improves many sites.

Closes #7069.
2015-08-11 11:21:52 -07:00
bors-servo
9c528c6382 Auto merge of #7161 - mbrubeck:underline, r=pcwalton
Snap rectangles to nearest pixels consistently.

Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount.  Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size.

Fixes #7152. r? @pcwalton or @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7161)
<!-- Reviewable:end -->
2015-08-11 11:31:32 -06:00
Matt Brubeck
3b6dc09e47 Snap rectangles to nearest pixels consistently.
Snapping the top-left and bottom-right corners separately can cause a
rectangle to change size when offset by a subpixel amount.  Instead, this
patch snaps the top-left corner, then rounds the size to a whole pixel amount,
so any rectangle of a given size will always have the same snapped size.

Fixes #7152.
2015-08-11 10:30:32 -07:00
bors-servo
d0bb6d0c07 Auto merge of #7126 - Ms2ger:ref, r=jdm
Run word-spacing tests under wpt.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7126)
<!-- Reviewable:end -->
2015-08-11 02:16:24 -06:00
Glenn Watson
e83091d918 Fix explicit height edge case with absolute / relative nested divs.
Needed for #6643.
2015-08-11 11:25:26 +10:00
Ms2ger
727d89bb44 Run word-spacing tests under wpt. 2015-08-10 17:51:16 +02:00
Patrick Walton
7ca1137d25 layout: Allow list items to be absolute containing blocks.
Fixes overflowing highlight in the side menu on GitHub.
2015-08-08 13:32:24 -07:00
Patrick Walton
11fdb503df layout: Introduce infrastructure for tracking, backing up, and splitting
at the last known good split point, and use it for `white-space:
nowrap`.

Fixes overflowing tables on Wikipedia.

This infrastructure should form the basis of our fix for inline layout
of fragments that don't themselves constitute valid split points. That
will require some more work, however.
2015-08-08 00:01:31 -07:00
bors-servo
0a0fd30eb3 Auto merge of #7033 - frewsxcv:fix-english, r=jdm
Improve clarity of comment in ref test list



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7033)
<!-- Reviewable:end -->
2015-08-07 15:35:03 -06:00
bors-servo
17263a525b Auto merge of #7043 - pcwalton:th-width, r=Ms2ger
script: Make the legacy presentational attributes on `<td>` apply to `<th>` too.

Makes the Google SERPs not so narrow.

r? @Ms2ger

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7043)
<!-- Reviewable:end -->
2015-08-07 00:40:54 -06:00
bors-servo
78792cced2 Auto merge of #7017 - glennw:stb-update, r=pcwalton
Update stb-image to get JPEG progressive support.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7017)
<!-- Reviewable:end -->
2015-08-06 19:46:19 -06:00
bors-servo
da06c2dda0 Auto merge of #7011 - pcwalton:inline-margin-intrinsic-size, r=mbrubeck
layout: Take inline margins into account when determining the intrinsic sizes of fragments.

Avoids a needless wrapped line in the repository name on GitHub.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7011)
<!-- Reviewable:end -->
2015-08-06 18:28:13 -06:00
bors-servo
cf4b411832 Auto merge of #7008 - pcwalton:floated-negative-margins, r=mbrubeck
layout: Take negative margins of floats into account when placing them.

Removes extraneous inline space on GitHub pull requests.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7008)
<!-- Reviewable:end -->
2015-08-06 11:55:58 -06:00
Patrick Walton
df29b1e878 script: Make the legacy presentational attributes on <td> apply to
`<th>` too.

Makes the Google SERPs not so narrow.
2015-08-06 10:26:45 -07:00