Commit graph

4748 commits

Author SHA1 Message Date
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
bors-servo
eb556c1ce6 Auto merge of #7602 - bjwbell:improve_err_msg_when_writing_png, r=pcwalton
Improve err msg when failing to output png

Before on at least Linux the following failure is hard to root cause:

    [~/servo] ./target/debug/servo -o tmp.png ./tests/html/lipsum.html
    thread '<main>' panicked at 'assertion failed: res.is_ok()', .../compositor.rs:1508
    thread '<main>' panicked at 'You should have disposed of the
    pixmap...', .../rust-layers/.../surface.rs:166

Now:

    [~/servo] ./target/debug/servo -o tmp.png ./tests/html/lipsum.html
    thread '<main>' panicked at 'Error writing png: Permission
    denied (os error 13)', .../compositor.rs:1508
    thread '<main>' panicked at 'You should have disposed of the pixmap
    properly with destroy()! This pixmap will leak!', .../rust-layers/.../surface.rs:166

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7602)
<!-- Reviewable:end -->
2015-09-10 23:55:41 -06:00
Bryan Bell
b7ea7de136 Improve err msg when failing to output png
Before on at least Linux the following failure is hard to root cause:

    [~/servo] ./target/debug/servo -o tmp.png ./tests/html/lipsum.html
    thread '<main>' panicked at 'assertion failed: res.is_ok()', .../compositor.rs:1508
    thread '<main>' panicked at 'You should have disposed of the
    pixmap...', .../rust-layers/.../surface.rs:166

Now:

    [~/servo] ./target/debug/servo -o tmp.png ./tests/html/lipsum.html
    thread '<main>' panicked at 'Error writing png: Permission
    denied (os error 13)', .../compositor.rs:1508
    thread '<main>' panicked at 'You should have disposed of the pixmap
    properly with destroy()! This pixmap will leak!', .../rust-layers/.../surface.rs:166
2015-09-10 21:45:58 -07: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
Anthony Ramine
4dbf391e83 Fix NodeIterator.root attributes
It should be [SameObject].
2015-09-11 02:57:41 +02:00
Anthony Ramine
d93c8da7d7 Fix Element missing attributes
Attributes classList and attributes are [SameObject].
2015-09-11 02:57:24 +02:00
Anthony Ramine
42254bac7e Fix ParentNode missing attributes
ParentNode.children is [SameObject], querySelectorAll() is [NewObject].
2015-09-11 02:57:02 +02:00
Anthony Ramine
a33e5f9179 Fix Node.childNodes attributes 2015-09-11 02:56:45 +02:00
bors-servo
f190ba360e Auto merge of #7595 - connorimes:update-hbs, r=larsbergstrom
Refresh cef and gonk lock files; update heartbeats dependencies



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7595)
<!-- Reviewable:end -->
2015-09-10 13:31:57 -06:00
bors-servo
4e69f301e1 Auto merge of #7593 - connorimes:energy-profiling-doc, r=larsbergstrom
Add documentation to profile crate on Heartbeats and energy-profiling



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7593)
<!-- Reviewable:end -->
2015-09-10 11:29:29 -06:00
Connor Imes
7cd953c9d1 Update heartbeats sys dependencies 2015-09-10 10:04:00 -05:00
Connor Imes
0d3fb75a63 Add documentation to profile crate on Heartbeats and energy-profiling feature 2015-09-10 09:40:26 -05: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
Corey Farwell
a4027f0259 Link to Servo issue instead of Gecko bug 2015-09-10 10:54:30 +02: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
Anthony Ramine
3f5b3053b9 Introduce NonElementParentNode
This is the interface where Document.getElementById() belong.
2015-09-10 01:14:26 +02:00
bors-servo
c838259383 Auto merge of #7527 - bjwbell:simd_advance_for_char_range, r=metajack
Use SIMD in fast path for advance_for_char_range

In advance_for_char_range add a fast SIMD code path for the the common
case where there are no detailed glyphs.


r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7527)
<!-- Reviewable:end -->
2015-09-09 16:55:16 -06:00
Bryan Bell
0c99b7e6a9 Add fast SIMD code path in advance_for_char_range
In advance_for_char_range add a SIMD code path for the the common
case of no detailed glyphs.

- gfx/Cargo.toml
  Add simd dependency https://github.com/huonw/simd

- servo/Cargo.lock
  Add simd dependency https://github.com/huonw/simd @
  d9ad79d86eab50a8f36d45fe17aa9e3a533389ee.

- SIMD isn't used on non-x86_65/aarch64 architectures.
2015-09-09 15:20:20 -07: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
bors-servo
50f5ae1d35 Auto merge of #7583 - metajack:warning-police, r=jdm
Fix some build warnings



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7583)
<!-- Reviewable:end -->
2015-09-09 12:53:21 -06:00
Jack Moffitt
71c3c9a1ba Fix some build warnings 2015-09-09 12:44:18 -06: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
Akos Kiss
52d87097ae Bump up skia and js packages to follow recent fixes 2015-09-09 09:35:55 +00:00
bors-servo
be9a9ffda1 Auto merge of #7523 - eefriedman:unnecessary-unsafe, r=SimonSapin
Fix up some unnecessary uses of `unsafe`.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7523)
<!-- Reviewable:end -->
2015-09-09 00:05:17 -06:00
David Zbarsky
3bec4d37dd Implement Range#surroundContents 2015-09-08 22:01:49 -07:00
bors-servo
8397219660 Auto merge of #7568 - frewsxcv:os-agnostic-paths, r=jdm
Use OS-agnostic filesystem paths in Python

This will eventually need to be done for #1908

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7568)
<!-- Reviewable:end -->
2015-09-08 22:29:04 -06:00
bors-servo
2c77776428 Auto merge of #7567 - connorimes:script-heartbeats, r=jdm
Add heartbeats for new script profiler categories



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7567)
<!-- Reviewable:end -->
2015-09-08 21:59:54 -06: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
Corey Farwell
244af42d89 Use OS-agnostic filesystem paths in Python
This will eventually need to be done for #1908
2015-09-08 21:16:02 +02:00
Connor Imes
4bef102fa1 Add heartbeats for new script profiler categories 2015-09-08 14:05:50 -05:00
James Graham
e0a7b2b5bb Add get/set pref extensions to webdriver server.
This can be used by the test framework to ensure that the correct prefs are
set for a test without restarting the browser
2015-09-08 19:16:28 +01:00
bors-servo
ca36779a7e Auto merge of #7547 - connorimes:move_script_profiling, r=jdm
Combine script profiling with profile crates. Fixes #7514.

The script crate had its own built-in profiling which was basically doing the same thing as the profile crate.  This wraps the internal profiling around the main profile functionality.  Script-related tasks are now added to the ProfilerCategory enum.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7547)
<!-- Reviewable:end -->
2015-09-08 09:32:56 -06: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
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
e2b8febfd5 Implement adopting steps
https://dom.spec.whatwg.org/#concept-node-adopt
https://github.com/whatwg/dom/pull/66
2015-09-08 09:32:49 +02:00
bors-servo
282f9ade93 Auto merge of #7556 - ddrmanxbxfr:MutabilityCleanup, r=Ms2ger
Remove unnecessary `mut` on variables declared in components/layout/block.rs

Small cleanup over mutable variables in components/layout/block.rs.

Thanks for looking into it!

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7556)
<!-- Reviewable:end -->
2015-09-08 00:28:42 -06: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
Mathieu Rheaume
bd07426735 Remove unnecessary mut on variables declared in components/layout/block.rs 2015-09-07 20:58:20 -04:00
bors-servo
0bc7ad9b08 Auto merge of #7533 - pcwalton:inline-block-margin-auto, r=mbrubeck
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.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7533)
<!-- Reviewable:end -->
2015-09-04 21:53:17 -06: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
da0b9d7c01 Auto merge of #7337 - wilmoz:InheritanceDocumentation, r=mbrubeck
Documentation of inheritance in type ids

Aditional documentation about this issue https://github.com/servo/servo/issues/7205

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7337)
<!-- Reviewable:end -->
2015-09-04 21:18:52 -06:00