Commit graph

1529 commits

Author SHA1 Message Date
bors-servo
8d7ba12f28 Auto merge of #7600 - pcwalton:body-overflow-scroll, r=mbrubeck
layout: Allow the overflow area of the `<body>` to be scrolled.

Fixes scrolling on Twitter.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7600)
<!-- Reviewable:end -->
2015-09-11 11:20:13 -06:00
bors-servo
c3f9e1813a Auto merge of #7550 - pcwalton:block-formatting-context-overflow, r=mbrubeck
layout: Defend the block formatting context speculation against going wrong in the presence of blocks that overflow in the inline direction.

Makes the Google search result links appear.

Closes #7298.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7550)
<!-- Reviewable:end -->
2015-09-11 10:03:39 -06:00
Patrick Walton
99587cf105 layout: Allow the overflow area of the <body> to be scrolled.
Fixes scrolling on Twitter.
2015-09-10 18:07:21 -07:00
bors-servo
4c64c870c6 Auto merge of #7592 - nox:nonelementparentnode, r=jdm
Introduce NonElementParentNode

This is the interface where Document.getElementById() belong.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7592)
<!-- Reviewable:end -->
2015-09-10 07:29:47 -06:00
bors-servo
c349b7b3a1 Auto merge of #7426 - dzbarsky:surroundcontents, r=glennw
Implement Range#surroundContents



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7426)
<!-- Reviewable:end -->
2015-09-09 21:54:06 -06:00
Anthony Ramine
dc125f9eb1 Implement NonElementParentNode for DocumentFragment 2015-09-10 01:33:13 +02:00
bors-servo
7b6c341900 Auto merge of #7581 - connorimes:power-profiling, r=larsbergstrom
Add energy monitoring and characterization scripts

Add the energy-profiling feature.  Users can compile the proper (or their own) version of energymon libraries to capture power/energy data at runtime.  The results are accessed through heartbeats.

Additionally, there are a couple of python scripts to enable heartbeats for profiler categories and process the results into some visualizations to help understand how time and energy is being spent in Servo.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7581)
<!-- Reviewable:end -->
2015-09-09 15:24:48 -06:00
bors-servo
f29ddb4b5d Auto merge of #7577 - bjwbell:borders_pixel_rounding_bug, r=mbrubeck
gfx: Fix bug with 1px width borders disappearing

In to_nearest_azure_rect when rounding to pixel coordinates, maintain
the invariant of rect non-overlap (if before rounding two rects don't overlap).

The previous code rounded the rect top left corner to the nearest pixel with
the size rounded to the nearest pixel multiple which can violate the
non-overlap condition, e.g.
10px×9.60px at (0px,6.6px) & 10px×9.60px at (0px,16.2px)
would round to
10px×10.0px at (0px,7.0px) & 10px×10.0px at (0px,16.0px), which overlap.

Instead round each corner to the nearest pixel.

For rects that dont need to satify the non-overlap condition and with
width or height between 0.5px and 1px, rounding each rect corner to the
nearest pixel can yield an empty rect e.g.
10px×0.6px at 0px,28.56px -> 10px×0px at 0px,29px.

For this scenario a new function to_nearest_non_empty_azure_rect
rounds the rect top left corner to the nearest pixel and the rect size
to the nearest pixel multiple. It's possible for non-overlapping rects
after this rounding to overlap.

This should fix https://github.com/servo/servo/issues/7184 "rounding ...borders not to be visible", without breaking https://github.com/servo/servo/issues/7152 "Underlines less than 1px high sometimes invisible".

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7577)
<!-- Reviewable:end -->
2015-09-09 13:30:41 -06:00
Michael Howell
029af81570 Actually store the overflow for inline-block elements.
Fixes #7571
2015-09-09 12:24:28 -07:00
Bryan Bell
1f44686415 position-relative-035 reftest -> expected fail
There is no easy way to pass position-relative-035 & also
pass both tests/ref/border_rounding_1px_invisible_issue_7184 and
tests/ref/text_decoration_underline_subpx.

https://github.com/servo/servo/pull/7161, "Snap rectangles to nearest
pixels...", did fix position-relative-035 (except
for OS X) but broke 1px borders.
2015-09-09 11:58:21 -07:00
Connor Imes
3c25f47dbc Add energy monitoring and characterization scripts 2015-09-09 13:35:21 -05:00
bors-servo
c0381c7325 Auto merge of #7563 - mrobinson:layerize-stacking-contexts, r=pcwalton
Layerize StackingContexts that are on top of layers

StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7563)
<!-- Reviewable:end -->
2015-09-09 10:52:56 -06:00
Martin Robinson
184238c348 Layerize StackingContexts that are on top of layers
StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.
2015-09-09 09:13:14 -07:00
Bryan Bell
642b34865f gfx: Fix bug with 1px width borders disappearing
In to_nearest_azure_rect when rounding to pixel coordinates, maintain
the invariant of rect non-overlap (if before rounding two rects don't overlap).

The previous code rounded the rect top left corner to the nearest pixel with
the size rounded to the nearest pixel multiple which can violate the
non-overlap condition, e.g.
10px×9.60px at (0px,6.6px) & 10px×9.60px at (0px,16.2px)
would round to
10px×10.0px at (0px,7.0px) & 10px×10.0px at (0px,16.0px), which overlap.

Instead round each corner to the nearest pixel.

For rects that dont need to satify the non-overlap condition and with
width or height between 0.5px and 1px, rounding each rect corner to the
nearest pixel can yield an empty rect e.g.
10px×0.6px at 0px,28.56px -> 10px×0px at 0px,29px.

For this scenario a new function to_nearest_non_empty_azure_rect
rounds the rect top left corner to the nearest pixel and the rect size
to the nearest pixel multiple. It's possible for non-overlapping rects
after this rounding to overlap.
2015-09-09 03:20:52 -07:00
David Zbarsky
3bec4d37dd Implement Range#surroundContents 2015-09-08 22:01:49 -07:00
bors-servo
4221b354cf Auto merge of #7557 - glennw:fix-layout-panic, r=pcwalton
Handle cases where the layout root is None. Fixes #6375.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7557)
<!-- Reviewable:end -->
2015-09-08 20:39:09 -06:00
bors-servo
68f32f7bef Auto merge of #7388 - paulrouget:issue-7332, r=metajack
Test for flexbox crasher

Closes #7332

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7388)
<!-- Reviewable:end -->
2015-09-08 12:45:24 -06:00
bors-servo
ef8a145233 Auto merge of #7561 - servo:update-css, r=SimonSapin
Update CSS tests to revision 09d27d61d637da536af1d86a8d7bea157592ff9e



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7561)
<!-- Reviewable:end -->
2015-09-08 03:46:36 -06:00
Simon Sapin
84f2ae6c93 Update CSS tests expected data to revision 09d27d61d637da536af1d86a8d7bea157592ff9e 2015-09-08 11:42:20 +02:00
Simon Sapin
5abfa12a4c Update CSS tests to revision 09d27d61d637da536af1d86a8d7bea157592ff9e 2015-09-08 11:01:17 +02:00
bors-servo
5a0be12e43 Auto merge of #7531 - nox:template, r=Ms2ger
Implement <template>

All tests using iframes can't currently pass, same for innerHTML-related tests with <template> elements. The latter contradicts the spec, see the links below.

Apart from this, they work, AFAICT.

https://github.com/servo/html5ever/issues/164
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27314

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7531)
<!-- Reviewable:end -->
2015-09-08 02:29:00 -06:00
Anthony Ramine
b3820047da Fix HTMLTemplateElement.innerHTML
https://github.com/w3c/DOM-Parsing/issues/1
2015-09-08 10:28:24 +02:00
Anthony Ramine
a5cefe41d0 Implement adopting and cloning steps for HTMLTemplateElement 2015-09-08 10:28:23 +02:00
Anthony Ramine
663f1d65e3 Fix tests in template-contents-owner-document-type.html
HTMLDocument isn't a thing anymore.
2015-09-08 10:28:22 +02:00
Anthony Ramine
a7476a758e Bump html5ever to 0.2.4, <template> support!
The failing <img> test comes from the now-correct parsing of <font face> elements
in SVG.
2015-09-08 10:28:21 +02:00
Anthony Ramine
880364b56d Enable template tests
All tests using iframes can't currently pass, same for innerHTML-related tests
with <template> elements. The latter contradicts the spec, see the links below.

https://github.com/servo/html5ever/issues/164
https://github.com/w3c/DOM-Parsing/issues/1
2015-09-08 09:32:50 +02:00
Michael Howell
6228edfb4c Include the overflow of the inline block itself.
Closes #7372.
2015-09-07 20:27:06 -07:00
Glenn Watson
a02d28a732 Handle cases where the layout root is None. Fixes #6375. 2015-09-08 11:19:58 +10:00
Paul Rouget
f6582e7f21 Test for flexbox crasher 2015-09-07 09:02:53 +02:00
Patrick Walton
683290e109 layout: Use a special path that treats margin: auto as zero for inline-block
inline size computation.

Places the search icon in the right place on the Google SERPs.
2015-09-04 20:42:57 -07:00
bors-servo
aeb8dce2d9 Auto merge of #7534 - pcwalton:inline-absolute-out-of-flow, r=mbrubeck
layout: Lay absolutely-positioned blocks with inline containing blocks out of flow.

Removes the long space before the site-specific drop-down in the Google SERPs.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7534)
<!-- Reviewable:end -->
2015-09-04 19:59:11 -06:00
bors-servo
5bad6b1b6e Auto merge of #7502 - bjwbell:elliptical-borders, r=pcwalton
gfx: Add elliptical border radius support

TODO: Add code for parsing shorthand border-radius e.g. "border-radius: 10px 5% / 20px".

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7502)
<!-- Reviewable:end -->
2015-09-04 18:46:24 -06:00
Patrick Walton
ded4a5793e layout: Defend the block formatting context speculation against going wrong in
the presence of blocks that overflow in the inline direction.

Makes the Google search result links appear.

Closes #7298.
2015-09-04 17:00:15 -07:00
Bryan Bell
3e5fb49b6f gfx: Add elliptical border radius support 2015-09-04 14:42:44 -07:00
Patrick Walton
2276d642fd layout: Stop double-counting position: relative offsets for stacking
contexts.

Fixes the location of the gear menu on the Google SERPs.
2015-09-04 09:28:18 -07:00
bors-servo
14c6d5db41 Auto merge of #7540 - servo:update-css, r=Ms2ger
Update CSS tests to revision 584b6cdd10401df603bd7bdf4ec801fcddc65468



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7540)
<!-- Reviewable:end -->
2015-09-04 08:52:30 -06:00
Ms2ger
58b5cd27de Update CSS tests to revision 584b6cdd10401df603bd7bdf4ec801fcddc65468 2015-09-04 16:52:07 +02:00
João Oliveira
4a305d1e62 Add style_traits crate to improve crate separation,
closes #7353
2015-09-04 12:59:37 +01:00
Patrick Walton
dba3e41a63 layout: Lay absolutely-positioned blocks with inline containing blocks out of
flow.

Removes the long space before the site-specific drop-down in the Google SERPs.
2015-09-03 15:37:40 -07:00
bors-servo
05deb3dcc8 Auto merge of #7518 - servo:custom-properties, r=pcwalton
Initial support for CSS Custom Properties

https://drafts.csswg.org/css-variables/

Missing: 

* `var()` in shorthand property declarations.
* Correct handling of EOF in custom property declarations.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7518)
<!-- Reviewable:end -->
2015-09-03 16:09:02 -06:00
Simon Sapin
b0aedc6f4c Enable css-variables-1 tests
```
Summary
=======

Ran 548 tests (525 parents, 23 subtests)
Expected results: 242
Unexpected results: 306 (FAIL: 304, TIMEOUT: 2)
```
2015-09-03 23:02:23 +02:00
Simon Sapin
5fb6acb753 Rename DeclaredValue::SpecifiedValue to DeclaredValue::Value 2015-09-03 23:02:15 +02:00
bors-servo
0ad284766b Auto merge of #7443 - mbrubeck:get_table, r=pcwalton
Implement get_table_for_tag on FreeType

Updates freetype to pick up servo/rust-freetype#37

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7443)
<!-- Reviewable:end -->
2015-09-03 14:37:38 -06:00
Matt Brubeck
afafb0b71c Implement get_table_for_tag on FreeType
Also fixes use-after-free of FontTable buffers.
2015-09-03 13:35:44 -07:00
Patrick Walton
ee8741b7a8 layout: Fix several bugs relating to inline borders, padding, and
margins.

* The code that attempted to strip out borders that span multiple
  fragments in the same element could go wrong if fragments were
  stripped out due to text clumping or whitespace stripping. This patch
  rewrites that code to maintain flags in the inline fragment context
  specifying whether the node is the beginning or end of the element.
  Not only is this easier to maintain, it's closer in spirit to what roc
  originally suggested two years ago: it's isomorphic to "begin element,
  end element" markers for inline layout.

* Padding and margins for spans containing inline-blocks are now
  properly handled via a division of labor between the `InlineBlock`
  fragment and the `BlockFlow` that represents the inline-block.

* Unscanned text fragments may not be joined together into a text run if
  borders, padding, or margins separate them.

Because Servo now matches the rendering of Gecko and WebKit on the
`input_button_margins_a` reftest, I had to modify it to add some
vertical alignment.

The combined effect of all of these fixes places "Advertising" on the
right place on google.com.
2015-09-03 10:24:59 -07:00
Ms2ger
509b050712 Disable html tests in __dir__.ini rather than include.ini.
This ensures those tests are skipped when running ./mach test-wpt html.
2015-09-03 17:02:06 +02:00
Sean McArthur
a1a9db8ffd net: use connection pooling 2015-09-02 12:46:53 -04:00
bors-servo
e1ede2074d Auto merge of #7429 - GyrosOfWar:serialize_list_space_fix, r=jdm
Fixed serialize_list to no longer append an additional space at the e…

…nd of the string.

Fixes #7404

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7429)
<!-- Reviewable:end -->
2015-09-02 09:15:16 -06:00
bors-servo
4e6bbe2272 Auto merge of #7117 - frewsxcv:python-venv, r=jdm
Reenable "Use one Python virtual environment for all mach commands"

Address the issues brought up by https://github.com/servo/servo/pull/7103

The revert requires an upgrade to wptrunner (for the mozlog 3.0 compatibility) because the latest wptrunner depends on [this](https://github.com/w3c/wpt-tools/pull/27))

/cc @Ms2ger @metajack

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7117)
<!-- Reviewable:end -->
2015-09-02 08:44:27 -06:00
Corey Farwell
96dda031a0 Update web-platform-tests expected data 2015-09-02 10:23:05 -04:00