Commit graph

6709 commits

Author SHA1 Message Date
Jack Moffitt
1615f173f7 Add browserhtml package 2016-03-04 10:23:27 -07:00
bors-servo
37bcc161fe Auto merge of #9832 - metajack:suppress-reflows, r=mbrubeck
Suppress reflows before RefreshTick or FirstLoad

This fixes a bug where partially loaded content is displayed to the user
before it should be, usually before stylesheets have loaded. This commit
supresses reflows until either FirstLoad or RefreshTick, whichever comes
first.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9832)
<!-- Reviewable:end -->
2016-03-04 04:00:30 +05:30
Jack Moffitt
2507bfb2cf Suppress reflows before RefreshTick or FirstLoad
This fixes a bug where partially loaded content is displayed to the user
before it should be, usually before stylesheets have loaded. This commit
supresses reflows until either FirstLoad or RefreshTick, whichever comes
first.

Unfortunately, hit_test and mouse_over did not do reflows if they were
necessary, and so by suppressing the initial spurious reflows, these
methods started to panic without a display list to query. This patch
also transforms these into queries similar to the other existing
queries.
2016-03-03 15:17:46 -07:00
bors-servo
55fc48e4c4 Auto merge of #9843 - pcwalton:optimize-flat-display-lists, r=mrobinson
Optimize flat display lists

Flat display lists were a 2x regression on the spheres demo. This patch series fixes that.

See the individual commits for more details.

r? @mrobinson

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9843)
<!-- Reviewable:end -->
2016-03-04 02:49:04 +05:30
Patrick Walton
117e92aefd layout: Minor whitespace cleanup. 2016-03-03 13:09:57 -08:00
Patrick Walton
d3d2dd05f2 layout: Switch display list building from bottom-up to top-down.
This eliminates a lot of allocations and O(n^2) behavior.
2016-03-03 13:09:56 -08:00
Patrick Walton
f4b95dd00b layout: Remove the validate_display_list_geometry debugging tool.
I don't think anyone was using it, and it's incompatible with taking
display lists out of flows.
2016-03-03 13:09:55 -08:00
Patrick Walton
72a52e23e0 layout: Don't call establishes_stacking_context() so much.
That function is expensive because it has to check a lot.
2016-03-03 13:09:54 -08:00
Patrick Walton
dd5c574d7f gfx: Switch offsets to an FNV hasher.
SipHash traffic was showing up high in the profile.

Unfortunately, this necessitated a manual implementation of the serde
traits.
2016-03-03 13:09:53 -08:00
Patrick Walton
940bff1f9c gfx: Stop cloning clipping regions so much.
Clipping regions can contain vectors and so can be expensive to copy.
2016-03-03 13:09:50 -08:00
Patrick Walton
983576ebaa gfx: Avoid copying stacking contexts around so much during stacking
context creation.
2016-03-03 13:09:49 -08:00
Patrick Walton
4233e0f163 gfx: Box stacking contexts to minimize memmove traffic.
`memmove` was showing up high in the profile when concatenating and
shorting display lists. This change drastically reduces the `memmove`
cost in exchange for some minor additional allocation cost.
2016-03-03 13:09:48 -08:00
Corey Farwell
75353e19a7 Indicate components should not be published to crates.io.
http://doc.crates.io/manifest.html#the-publish--field-optional
2016-03-03 15:04:44 -05:00
bors-servo
056a7cf1a2 Auto merge of #9715 - ecoal95:mousemove, r=mbrubeck
script: Fix MouseOver handling

Now we only query for the topmost node, and apply the hover state to all
of the parent elements.

This fixes things like #9705, where the hover state was applied only to
the children.

This also makes us more conformant with other browsers in the case of
taking in account margins and paddings.

For example, prior to this PR, when your mouse was over the inner
element, in the bottom part, `hover` styles didn't apply to the parent.

```html
<style>
div {
  padding: 10px;
  margin: 10px;
  height: 15px;
  background: blue;
}

div:hover {
  background: red;
}
</style>

<div>
  <div></div>
</div>
```

Fixes #9705

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9715)
<!-- Reviewable:end -->
2016-03-03 22:55:35 +05:30
bors-servo
46256b33ef Auto merge of #9825 - creativcoder:remove-contructor-xmldoc, r=KiChjang
removed XMLDocument constructor according to spec

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9825)
<!-- Reviewable:end -->
2016-03-03 17:41:03 +05:30
Rahul Sharma
f8cddf5a22 removed XMLDocument constructor according to spec 2016-03-03 17:01:33 +05:30
Glenn Watson
a768ffb4bc Update webrender. Fixes #9846. 2016-03-03 11:28:03 +10:00
Emilio Cobos Álvarez
3662491d8f Refactor mouseover code to be more performant
This increases mouseover/out performance drastically on my machine.
2016-03-02 20:14:15 +01:00
Emilio Cobos Álvarez
48dee6413d script/layout: Refactor mouse_over since it now basically uses hit_test 2016-03-02 20:14:15 +01:00
bors-servo
3ff5082798 Auto merge of #9841 - glennw:extra-overflow, r=pcwalton
Fix unexpected overflow with overflow: hidden set.

Fixes #9719.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9841)
<!-- Reviewable:end -->
2016-03-03 00:35:50 +05:30
Glenn Watson
ff831bb478 Fix unexpected overflow with overflow: hidden set.
Fixes #9719.
2016-03-03 05:02:37 +10:00
Emilio Cobos Álvarez
c3786437a3 script: Fix mouseover/mouseout dispatching. 2016-03-02 20:01:41 +01:00
Emilio Cobos Álvarez
b1f0581637 script: Fix MouseOver handling
Now we only query for the topmost node, and apply the hover state to all
of the parent elements.

This fixes things like #9705, where the hover state was applied only to
the children.

This also makes us more conformant with other browsers in the case of
taking in account margins and paddings.

For example, prior to this PR, when your mouse was over the inner
element, in the bottom part, `hover` styles didn't apply to the parent.

```html
<style>
div {
  padding: 10px;
  margin: 10px;
  height: 15px;
  background: blue;
}

div:hover {
  background: red;
}
</style>

<div>
  <div></div>
</div>
```

Fixes #9705
2016-03-02 20:01:41 +01:00
bors-servo
9ceda7de50 Auto merge of #9837 - nox:deterministic-raf, r=mbrubeck
Use a BTreeMap for Document::animation_frame_list (fixes #9834)

The callbacks must stay ordered.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9837)
<!-- Reviewable:end -->
2016-03-02 21:24:38 +05:30
Anthony Ramine
1d87f61350 Use a BTreeMap for Document::animation_frame_list (fixes #9834)
The callbacks must stay ordered.
2016-03-02 16:53:06 +01:00
Ms2ger
0a9b62d7c7 Remove a stray println in table layout.
It was introduced in 4dc9d8b1c5.
2016-03-02 10:57:06 +01:00
Ulf Nilsson
8c07a1a3af Use piston_image instead of stb_image for decoding JPEGs
Bump image to 0.7
2016-03-02 09:13:49 +01:00
bors-servo
62814f7cb4 Auto merge of #9756 - mrobinson:flat-display-lists-webrender, r=pcwalton
Flatten display list structure

Instead of producing a tree of stacking contexts, display list
generation now produces a flat list of display items and a tree of
stacking contexts. This will eventually allow display list construction
to produce and modify WebRender vertex buffers directly, removing the
overhead of display list conversion.  This change also moves
layerization of the display list to the paint thread, since it isn't
currently useful for WebRender.

To accomplish this, display list generation now takes three passes of
the flow tree:

        1. Calculation of absolute positions.
        2. Collection of a tree of stacking contexts.
        3. Creation of a list of display items.

After collection of display items, they are sorted based upon the index
of their parent stacking contexts and their position in CSS 2.1
Appendeix E stacking order.

This is a big change, but it actually simplifies display list generation.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9756)
<!-- Reviewable:end -->
2016-03-02 06:21:08 +05:30
bors-servo
70941e3806 Auto merge of #9827 - glennw:update-wr, r=KiChjang
Update webrender_traits, webrender, num.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9827)
<!-- Reviewable:end -->
2016-03-02 05:26:29 +05:30
bors-servo
f895f87197 Auto merge of #9823 - gmalecha:canvas-rendering-context-2d-update-idl, r=jdm
updating the CanvasRenderingContext2D to match the spec

- fixes #9443

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9823)
<!-- Reviewable:end -->
2016-03-02 04:32:26 +05:30
Martin Robinson
e7019f2721 Flatten display list structure
Instead of producing a tree of stacking contexts, display list
generation now produces a flat list of display items and a tree of
stacking contexts. This will eventually allow display list construction
to produce and modify WebRender vertex buffers directly, removing the
overhead of display list conversion.  This change also moves
layerization of the display list to the paint thread, since it isn't
currently useful for WebRender.

To accomplish this, display list generation now takes three passes of
the flow tree:

        1. Calculation of absolute positions.
        2. Collection of a tree of stacking contexts.
        3. Creation of a list of display items.

After collection of display items, they are sorted based upon the index
of their parent stacking contexts and their position in CSS 2.1
Appendeix E stacking order.

This is a big change, but it actually simplifies display list generation.
2016-03-01 14:50:07 -08:00
bors-servo
1d6aece589 Auto merge of #9826 - mbrubeck:table-row-iter, r=pcwalton
Table border-collapse fixes

Two related fixes for border-collapse:

* Fix border collapsing across table-row-group flows

  This fixes the border-end calculation for table rows whose borders are collapsed with rows in different rowgroups.  The border collapsing code now uses an iterator that yields all the rows as a flat sequence, regardless of how they are grouped in rowgroups.  It gets rid of `TableRowGroupFlow::preliminary_collapsed_borders` which was never correct.  (It was read but never written.)

  This may fix #8120 but I'm not 100% certain. (I haven't managed to reproduce the intermittent failure locally, and my reduced test case still fails but in a different way.)

* Fix confusing `push_or_mutate` API

  This fixes a bug when recalculating border collapsing for an existing table row. The bug was caused by using `push_or_mutate` which has no effect if there is already a value at the specified index.

  The fix switches incorrect `push_or_mutate` calls to use `push_or_set` instead. It also renames `push_or_mutate` to `get_mut_or_push` which I think is a less-confusing name for this method.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9826)
<!-- Reviewable:end -->
2016-03-02 03:38:12 +05:30
bors-servo
22ce878edc Auto merge of #9753 - nikkisquared:async_fetch, r=jdm
Make Fetch Protocol Asynchronous

I'm working on making it possible to run Fetch Asynchronously, as required for some steps, such as Main Fetch. It looks like somebody has already laid some groundwork for that, with a AsyncFetchListener trait and two async fetch functions defined, which I'm building on top of.

So far, as a sort of proof of concept, I've written a test to asynchronously retrieve a fetch response, which uses a simple function to check if the fetch response is complete or not. I'd like to be checked if I'm on the right path, to see if I need to rework anything so far, and what my next step can be.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9753)
<!-- Reviewable:end -->
2016-03-02 01:49:29 +05:30
Nikki
3f79667050 implementing working demonstration of calling Fetch asynchronously 2016-03-01 13:02:38 -07:00
bors-servo
b355c0dbcb Auto merge of #9817 - Ms2ger:yacc-log, r=nox
Stop generating a parser.out file in the source.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9817)
<!-- Reviewable:end -->
2016-03-02 00:55:02 +05:30
Glenn Watson
1c899a35a5 Update webrender_traits, webrender, num. 2016-03-02 03:38:31 +10:00
Matt Brubeck
6c684a5ac7 Fix border collapsing at the end of a table-row-group
This fixes the border-end calculation for table rows whose borders are
collapsed with rows in different rowgroups.  The border collapsing code now
uses an iterator that yields all the rows as a flat sequence, regardless of
how they are grouped in rowgroups.  It gets rid of
`TableRowGroupFlow::preliminary_collapsed_borders` which was never correct.
(It was read but never written.)

This may fix #8120 but I'm not 100% certain. (I haven't managed to reproduce
the intermittent failure locally, and my reduced test case still fails but in
a different way.)
2016-03-01 09:02:35 -08:00
Gregory Malecha
2c6636129d updating the CanvasRenderingContext2D to match the spec
- fixes #9443
2016-03-01 08:13:50 -08:00
Ms2ger
549f2669f0 Stop generating a parser.out file in the source. 2016-03-01 15:02:50 +01:00
bors-servo
40c52d55e2 Auto merge of #9792 - GuillaumeGomez:remove_comparator, r=nox
Remove util::vec::Comparator

r? @nox

Fixes #9696

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9792)
<!-- Reviewable:end -->
2016-03-01 19:10:45 +05:30
Guillaume Gomez
02095cf550 Remove util::vec::Comparator 2016-03-01 14:28:16 +01:00
bors-servo
00628704ca Auto merge of #9763 - Tangresh:i9725, r=nox
Implement value for DOMTokenList

Fixes #9725

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9763)
<!-- Reviewable:end -->
2016-03-01 08:34:21 +05:30
bors-servo
cd274a4a11 Auto merge of #9815 - antrik:update-ipc_channel-2, r=KiChjang
Update ipc-channel again for working deadlock fix

Pull in ce7c296a3717b054060889b780f8638eb66ce970 , fixing concurrent
large transfers on Linux.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9815)
<!-- Reviewable:end -->
2016-03-01 07:40:26 +05:30
bors-servo
4035f7ae2c Auto merge of #9813 - glennw:iframe-sizing, r=pcwalton
With WebRender, only send resize events when window size is valid.

Fixes WR 112.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9813)
<!-- Reviewable:end -->
2016-03-01 06:46:01 +05:30
Glenn Watson
d031319434 Update gleam to get UBO bindings. 2016-03-01 10:01:19 +10:00
Glenn Watson
78b284cefe With WebRender, only send resize events when window size is valid.
Fixes WR 116.
2016-03-01 09:29:16 +10:00
Matt Brubeck
4dc9d8b1c5 Fix confusing push_or_mutate API
This fixes a bug when recalculating border collapsing for an existing table
now. The bug was caused by using `push_or_mutate` which has no effect if there
is already a value at the specified index.

The fix switches incorrect `push_or_mutate` calls to use `push_or_set`
instead. It also renames `push_or_mutate` to `get_mut_or_push` which I think
is a less-confusing name for this method.
2016-02-29 15:18:19 -08:00
bors-servo
4bcdbe6d56 Auto merge of #8932 - rilut:add-elementfrompoint, r=nox
Implement Document#elementFromPoint

Related to #8666. I haven't implemented elementsFromPoint, because from my past discussion with jdm, [it's not good yet](dbfa25214b (commitcomment-14668959)) to implement elementsFromPoint because it may cause GC hazards.

By the way, I also have to include the test for this, right? I've found this [1]. So, is all I have to do is just to put this into `tests/wpt/web-platform-tests/cssom-view/elementFromPoint.html`?

[1] http://test.csswg.org/suites/cssom-view-1_dev/nightly-unstable/html/elementFromPosition.htm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8932)
<!-- Reviewable:end -->
2016-03-01 03:01:50 +05:30
Olaf Buddenhagen
9c7b531c37 Update ipc-channel again for working deadlock fix
Pull in ce7c296a3717b054060889b780f8638eb66ce970 , fixing concurrent
large transfers on Linux.
2016-02-29 22:06:34 +01:00
Rizky Luthfianto
76678bbdae Implement Document#elementFromPoint 2016-03-01 02:23:07 +07:00