Commit graph

1529 commits

Author SHA1 Message Date
bors-servo
42d74324e2 Auto merge of #7190 - Ms2ger:node-clone, r=jdm
Correct the default value for Node#cloneNode's deep argument.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7190)
<!-- Reviewable:end -->
2015-08-13 13:51:06 -06: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
Simon Sapin
39ce15f20d Fix Element::set_inline_style_property_priority’s handling of priority
Thanks to mwu for pointing out a copy-paste error.
2015-08-13 17:07:17 +02:00
Ms2ger
c007b66d97 Correct the default value for Node#cloneNode's deep argument. 2015-08-13 12:12:45 +02: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
3b1b3fe0a0 Auto merge of #7163 - Ms2ger:wpt_20150811, r=Ms2ger
Update web-platform-tests to revision 58133dd71b16037669a0aa011b2afd448b52d434.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7163)
<!-- Reviewable:end -->
2015-08-12 00:54:57 -06:00
Ms2ger
88ea7c4291 Update web-platform-tests to revision 58133dd71b16037669a0aa011b2afd448b52d434. 2015-08-12 08:21:50 +02:00
bors-servo
0c5158587d Auto merge of #6757 - mskrzypkows:document_hasFocus, r=jdm
Implementing document.hasFocus method, needs tests. #6475

I'm not sure if I have to implement some test for a new document method. As I remember there were tests for document methods, is it changed now? Where should I add tests?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6757)
<!-- Reviewable:end -->
2015-08-11 15:35:21 -06:00
bors-servo
7dc83e7820 Auto merge of #7024 - pcwalton:whitespace-stripping, r=mbrubeck
layout: Rewrite whitespace stripping.

This patch makes Servo unconditionally strip whitespace before text run
scanning (assuming that the `white-space` property allows it). Whitespace
stripping during reflow is now only used for handling whitespace at the ends of
lines; reflow now never attempts to handle ignorable whitespace.

Many CSS tests pass now. There are some new failures, however.

The following reference tests now fail due to a pre-existing bug whereby
whitespace is used to calculate the position of inline hypothetical boxes for
elements with `display: inline; position: absolute`:

* `absolute-replaced-height-036.htm`
* `vertical-align-sub-001.htm`
* `vertical-align-super-001.htm`

The following reference tests fail due to a pre-existing bug whereby we don't
handle `font-size: 0` properly in inline reflow:

* `font-size-zero-1.htm`
* `font-size-zero-2.htm`

The following reference test fails due to the fact that it relied on our
incorrect insertion of whitespace to make room for the black background:

* `inline-formatting-context-007.htm`

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7024)
<!-- Reviewable:end -->
2015-08-11 12:57:02 -06:00
Patrick Walton
ae378a8c3e layout: Rewrite whitespace stripping.
This patch makes Servo unconditionally strip whitespace before text run
scanning (assuming that the `white-space` property allows it). Whitespace
stripping during reflow is now only used for handling whitespace at the ends of
lines; reflow now never attempts to handle ignorable whitespace.

Many CSS tests pass now. There are some new failures, however.

The following reference tests now fail due to a pre-existing bug whereby
whitespace is used to calculate the position of inline hypothetical boxes for
elements with `display: inline; position: absolute`:

* `absolute-replaced-height-036.htm`
* `vertical-align-sub-001.htm`
* `vertical-align-super-001.htm`

The following reference tests fail due to a pre-existing bug whereby we don't
handle `font-size: 0` properly in inline reflow:

* `font-size-zero-1.htm`
* `font-size-zero-2.htm`

The following reference test fails due to the fact that it relied on our
incorrect insertion of whitespace to make room for the black background:

* `inline-formatting-context-007.htm`
2015-08-11 11:42:20 -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
84c4a26e4d Auto merge of #7070 - frewsxcv:merge-clonenode-tests, r=Ms2ger
Merge Servo Node.cloneNode test into WPT Node.cloneNode test

Fixes #5755

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7070)
<!-- Reviewable:end -->
2015-08-11 07:06:23 -06:00
bors-servo
d9925f5f92 Auto merge of #7104 - dzbarsky:add_color_stop, r=Ms2ger
CanvasGradient#addColorStop should throw for invalid colors and offsets

The new test failure is because the color stop has a value of 'currentColor' which we don't support yet.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7104)
<!-- Reviewable:end -->
2015-08-11 06:24:35 -06: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
bors-servo
b8d464f5dc Auto merge of #7151 - dzbarsky:style-setters, r=jdm
Make CSSStyleDeclaration setters rethrow errors instead of unwrapping



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7151)
<!-- Reviewable:end -->
2015-08-10 23:04:34 -06:00
David Zbarsky
a3ee46fc9c Make CSSStyleDeclaration setters rethrow errors instead of unwrapping and crashing. 2015-08-11 00:34:41 -04:00
bors-servo
b05b02e11f Auto merge of #7090 - pcwalton:overflow-scroll, r=glennw
layout: Implement basic `overflow: scroll` functionality.

Known issues:

* Display list optimization can sometimes optimize out elements that
  should be shown. This affects the Enyo demo.

* The `overflow: scroll` container doesn't clip the inner layer properly
  when borders, border radius, etc. are present.

* `overflow-x: scroll` and `overflow-y: scroll` don't work individually;
  elements are scrolled all at once.

Note that multiple layers per stacking context aren't needed for the Enyo demo; rather the issue is that the height of the main area is being calculated incorrectly. (It looks like JS is measuring the height and poking in an explicit value that is too tall.)

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7090)
<!-- Reviewable:end -->
2015-08-10 22:29:40 -06:00
Patrick Walton
dd7345ad64 tests: Add a simple test case for overflow: scroll. 2015-08-10 21:27:05 -07:00
bors-servo
166bb41baa Auto merge of #7122 - dzbarsky:cssom, r=jdm
Enable CSSOM wpt tests

We don't support a lot of these features but this did expose a crash(es?)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7122)
<!-- Reviewable:end -->
2015-08-10 21:32:55 -06:00
bors-servo
c079c1cf6d Auto merge of #7147 - glennw:abs-explicit-height, r=pcwalton
Fix explicit height edge case with absolute / relative nested divs.

Needed for #6643.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7147)
<!-- Reviewable:end -->
2015-08-10 20:58:12 -06:00
David Zbarsky
fef2a33043 Enable CSSOM tests 2015-08-10 22:50:13 -04: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
Maciej Skrzypkowski
07c0cd8a18 Implementing document.hasFocus method. #6475 2015-08-10 21:23:09 +02:00
Ms2ger
727d89bb44 Run word-spacing tests under wpt. 2015-08-10 17:51:16 +02:00
Corey Farwell
a6797ac813 Merge Servo Node.cloneNode test into WPT Node.cloneNode test
Fixes #5755
2015-08-10 09:48:18 -04:00
David Zbarsky
92d8058947 Enable CSS Color wpt tests 2015-08-09 23:35:20 -04:00
David Zbarsky
7315b50973 CanvasGradient#addColorStop should throw for invalid colors and offsets 2015-08-09 23:19:56 -04:00
bors-servo
44d93bc37a Auto merge of #7089 - dzbarsky:createtbody, r=Ms2ger
Implement HTMLTableElement#createTBody



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7089)
<!-- Reviewable:end -->
2015-08-09 13:56:47 -06:00
Ms2ger
97c79bbb99 Avoid a panic when clicking a link whose href is unparsable. 2015-08-09 20:05:35 +02:00
Ms2ger
ecb6551efa Add a test for following malformed hyperlinks. 2015-08-09 19:59:20 +02:00
David Zbarsky
54adae26c6 Implement HTMLTableElement#createTBody 2015-08-09 12:24:15 -04:00
bors-servo
6a8bc85284 Auto merge of #7092 - dzbarsky:putimagedata, r=jdm
Clean up and fix PutImageData



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7092)
<!-- Reviewable:end -->
2015-08-09 07:00:56 -06:00
bors-servo
dbce4c5bd8 Auto merge of #6975 - dzbarsky:get-tiny, r=jdm
Fix getImageData with sizes < 1 pixel



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6975)
<!-- Reviewable:end -->
2015-08-09 06:32:30 -06:00
bors-servo
f41834e321 Auto merge of #7063 - dzbarsky:caption, r=Ms2ger
Implement createCaption and deleteCaption on HTMLTableElement



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7063)
<!-- Reviewable:end -->
2015-08-09 04:45:28 -06:00
Ms2ger
47d6d958f5 Revert "Auto merge of #7103 - frewsxcv:python-venv, r=metajack" for breaking web-platform-tests.
This reverts commit c315404db8, reversing
changes made to b00583bd4e.
2015-08-09 11:20:40 +02:00
bors-servo
c315404db8 Auto merge of #7103 - frewsxcv:python-venv, r=metajack
Use one Python virtual environment for all mach commands

*See individual commits for more information*

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7103)
<!-- Reviewable:end -->
2015-08-08 19:42:14 -06:00
Corey Farwell
2d841e1d91 Remove unused imports 2015-08-08 18:47:28 -04: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
David Zbarsky
2f47bdff4b Fix getImageData with sizes < 1 pixel 2015-08-08 15:43:22 -04:00
David Zbarsky
51938d579f Switch PutImageData to using CopySurface 2015-08-08 15:35:08 -04:00
David Zbarsky
e24a867ab6 Implement createCaption and deleteCaption on HTMLTableElement
Update web-platform-tests expected data
2015-08-08 15:24:05 -04:00
bors-servo
530d4547c9 Auto merge of #7046 - Ms2ger:base-url, r=dzbarsky
Implement a base_url getter and use it for style attributes.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7046)
<!-- Reviewable:end -->
2015-08-08 06:53:32 -06:00
bors-servo
a0af7a1581 Auto merge of #7075 - Ms2ger:load_url, r=dzbarsky
Improve code around Window::load_url.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7075)
<!-- Reviewable:end -->
2015-08-08 06:09:13 -06:00
Ms2ger
bd31b51a87 Use the base URL to parse style attributes. 2015-08-08 11:26:34 +02:00
bors-servo
d8b4611a79 Auto merge of #7066 - Ms2ger:ws-event, r=metajack
Dispatch message events for WebSocket.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7066)
<!-- Reviewable:end -->
2015-08-08 03:00:50 -06:00
Ms2ger
352229b6fa Implement WebSocket#onmessage. 2015-08-08 10:29:03 +02: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