Commit graph

4270 commits

Author SHA1 Message Date
David Zbarsky
dcac654057 Use the type system to enforce that product nodes are simplified away 2015-08-26 14:15:07 -07:00
David Zbarsky
164af05ba9 Expand out nested products 2015-08-26 14:15:05 -07:00
David Zbarsky
f8bd7c46ae Fix some calc parsing panics 2015-08-26 14:15:03 -07:00
David Zbarsky
67db4fbc2e Remove stray changes 2015-08-26 14:15:01 -07:00
David Zbarsky
63d0429bed Simplify the calc AST simplification code 2015-08-26 14:14:59 -07:00
David Zbarsky
663e0f606c Simplify like terms in all sum expressions, not just toplevel calc 2015-08-26 14:14:58 -07:00
David Zbarsky
6573e8088c Properly serialize % values in calc expressions 2015-08-26 14:14:56 -07:00
David Zbarsky
cfa1e467f1 Clean up AST simplification code 2015-08-26 14:14:54 -07:00
David Zbarsky
64dc95436d Clean up serialization code a little 2015-08-26 14:14:52 -07:00
David Zbarsky
af4d2e910e Clean up serialization and other hacks 2015-08-26 14:14:50 -07:00
David Zbarsky
5df4b82a6b Implement font relative and viewport relative units for calc 2015-08-26 14:14:49 -07:00
David Zbarsky
2bb6b4582a Implement proper calc parsing 2015-08-26 14:14:47 -07:00
David Zbarsky
cb4d878169 Implement Calc for LengthOrPercentageOrAuto 2015-08-26 14:14:45 -07:00
David Zbarsky
9556141e57 Implement Calc for LengthOrPercentage 2015-08-26 14:14:43 -07:00
bors-servo
fa5ad1c6b4 Auto merge of #7392 - mrobinson:layered-separate, r=pcwalton
Split out layered child stacking contexts in display lists

This patch is in preparation for more dynamic layerization of the
pieces of display lists. It also prevents having to sort the children
by z-index multiple times.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7392)
<!-- Reviewable:end -->
2015-08-26 11:38:34 -06:00
Martin Robinson
1c09b1d8aa Split out layered child stacking contexts in display lists
This patch is in preparation for more dynamic layerization of the
pieces of display lists. It also prevents having to sort the children
by z-index multiple times.
2015-08-26 10:20:28 -07:00
bors-servo
0e78815242 Auto merge of #7386 - Ms2ger:emitter, r=jdm
Remove Emitter::markers.

The vector is filled in and immediately emptied again. It is clearer to
keep the vector in the caller instead.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7386)
<!-- Reviewable:end -->
2015-08-26 08:52:16 -06:00
Ms2ger
18b9532b25 Remove Emitter::markers.
The vector is filled in and immediately emptied again. It is clearer to
keep the vector in the caller instead.
2015-08-26 16:19:01 +02:00
bors-servo
186c1d14d5 Auto merge of #6880 - dzbarsky:rAF, r=jdm
Don't try to unwrap the result of requestAnimationFrame callback



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6880)
<!-- Reviewable:end -->
2015-08-26 08:13:11 -06:00
bors-servo
9e52dd8cee Auto merge of #7378 - Ms2ger:url, r=SimonSapin
Update url.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7378)
<!-- Reviewable:end -->
2015-08-26 07:18:34 -06:00
bors-servo
78d72f6a9b Auto merge of #7352 - saratang:issue_7347, r=Ms2ger
BinaryOrPlaintextClassifier::classify_impl does not need to return Option

Fixes for Issue #7347, though I wasn't sure how to test my code afterwards.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7352)
<!-- Reviewable:end -->
2015-08-26 05:53:38 -06:00
bors-servo
06ba2167ba Auto merge of #7360 - wilmoz:ErgonomicSignature, r=Ms2ger
Make handle_potential_webgl_error more ergonomic

https://github.com/servo/servo/issues/7358

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7360)
<!-- Reviewable:end -->
2015-08-26 05:21:42 -06:00
Ms2ger
d75ba49034 Update url. 2015-08-26 13:17:45 +02:00
bors-servo
a1cd27e6a3 Auto merge of #7369 - pcwalton:relative-layer-overflow, r=glennw
layout: Fix calculation of overflow for stacking contexts that contain `position: relative` fragments.

Fixes placement of the header on espn.go.com.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7369)
<!-- Reviewable:end -->
2015-08-25 17:16:34 -06: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
Avi Weinstock
09a20bb0a5 Update rust-clipboard to a version that works on Windows and Mac. 2015-08-25 15:29:29 -04:00
wilmoz
363183d12a Make handle_potential_webgl_error more ergonomic 2015-08-25 13:04:55 -05:00
wilmoz
63851f2650 Forbid multiline imports 2015-08-25 12:27:42 -05: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
ecoal95
af3310f149 Update gleam to 0.1.9 2015-08-25 17:16:46 +02:00
Sara Tang
8c39e968cd Fixed mismatched type error 2015-08-24 23:11:31 -04:00
Sara Tang
f80ae3402a Fixes for issue #7347 2015-08-24 21:32:16 -04:00
bors-servo
e97d8bd25c Auto merge of #7340 - pcwalton:quotes-none-crash, r=mbrubeck
layout: Don't crash if `quotes: none` is specified and generated content uses quotes.

Avoids a crash on The Verge.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7340)
<!-- Reviewable:end -->
2015-08-24 18:01:39 -06: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
Connor Imes
bb96710cbf Fix heartbeats build with new -sys version. Fixes #7328 2015-08-24 15:38:45 -05:00
João Oliveira
77e8d3071c Move RegisterBindings::RegisterProxyHandlers call into script::init
closes #7336
2015-08-24 18:41:39 +01:00
bors-servo
524b02dbf7 Auto merge of #7331 - paulrouget:issue-7316, r=SimonSapin
prevent division by 0

Fix #7316

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7331)
<!-- Reviewable:end -->
2015-08-24 05:08:41 -06:00
bors-servo
fa06a96f8a Auto merge of #7334 - servo:active, r=SimonSapin
Parse :active pseudo-class selector.

This is #7258 with a spec link added in doc-comment.

The pseudo-class is never matched, but this can still help with stylesheets like `a:hover, a:active { color: something }` where failing to parse one pseudo-class makes the entire selector list invalid.

I filed #7333 about actually making it match.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7334)
<!-- Reviewable:end -->
2015-08-24 04:23:13 -06:00
Simon Sapin
daedee844f Add spec link for the IN_ACTIVE_STATE flag. 2015-08-24 11:45:41 +02:00
Paul Rouget
4987e320d4 prevent division by 0
Fix 7316
2015-08-24 08:53:37 +02:00
João Oliveira
1829c72061 remove PrivateCSSStyleDeclarationHelpers trait from Element,
call get_inline_style_declaration and
get_important_inline_style_declaration inline
closes #7319
2015-08-23 14:15:21 +01:00
bors-servo
6e06cae44a Auto merge of #7288 - mdibaiee:computedstyle-element, r=Ms2ger
Fix #7268 - getComputedStyle should take `Element`, not `HTMLElement`

This is my first patch, I hope I'm doing it right.

About the test, do you think this is enough and reliable?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7288)
<!-- Reviewable:end -->
2015-08-22 20:43:45 -06:00
bors-servo
d89e4f7991 Auto merge of #7179 - connorimes:add-heartbeats, r=larsbergstrom
Integrate with simple Heartbeats

This PR adds Heartbeats capability to servo.  Heartbeats are used for detailed performance and power/energy profiling.  We will add the power/energy readings in the future.

New dependencies are introduced which need in-depth reviews.  I'm the only one who has had eyes on any of this, and I have limited resources for testing cross-platform compatibility.
* https://github.com/libheartbeats/heartbeats-simple - provides native C libraries from a shared code base:
 * hbs[-static] - performance monitoring
 * hbs-acc[-static] - performance with accuracy monitoring
 * hbs-pow[-static] - performance with power/energy monitoring (the one we're using)
 * hbs-acc-pow[-static] - performance with accuracy and power/energy monitoring 
* https://github.com/connorimes/heartbeats-simple-sys provides rust wrappers for the native C libraries above - one crate for each + a common crate.  These link with the *-static versions of the heartbeats libraries.
* https://github.com/connorimes/heartbeats-simple-rust provides rust abstractions over the -sys crates above - one crate for each.

The new `heartbeats` module in the `profile` crate looks for environment variables telling it to use heartbeats for each ProfilerCategory and where to put log files.  (Of course, if somebody knows how to iterate over the enum instead of hardcoding each one, that would be fantastic.)  If the environment variables aren't set for particular categories, heartbeats aren't created or used.

An interface change is made in the `profile_traits` crate to pass both the start and end time in a `ProfilerMsg` instead of just the elapsed time.  Later we will add energy readings as well.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7179)
<!-- Reviewable:end -->
2015-08-22 17:23:50 -06: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
bors-servo
60140ad294 Auto merge of #7315 - frewsxcv:python-is, r=SimonSapin
Don't use `is` operatory to compare Python strings

`is` checks identity. `==` checks value. I can't think of a reason why
we would want the former in these scenarios.

More info:

* http://stackoverflow.com/a/1504742
* https://docs.python.org/2/reference/expressions.html#is

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7315)
<!-- Reviewable:end -->
2015-08-22 09:26:34 -06:00
Corey Farwell
5bf262770f Don't use is operatory to compare Python strings
`is` checks identity. `==` checks value. I can't think of a reason why
we would want the former in these scenarios.

More info:

* http://stackoverflow.com/a/1504742
* https://docs.python.org/2/reference/expressions.html#is
2015-08-22 10:22:47 -04:00
Mahdi Dibaiee
b7d25159d3 Fix #7268 - getComputedStyle should take Element, not HTMLElement 2015-08-22 15:16:15 +04:30
Paul Rouget
0209bf1199 Update glutin window port after glutin update 2015-08-22 12:12:26 +02:00