Commit graph

2283 commits

Author SHA1 Message Date
David Zbarsky
6573e8088c Properly serialize % values in calc expressions 2015-08-26 14:14:56 -07: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
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
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
João Oliveira
77e8d3071c Move RegisterBindings::RegisterProxyHandlers call into script::init
closes #7336
2015-08-24 18:41:39 +01: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
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
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
Kyle Zentner
45b7ee9bdb Parse flex-direction CSS property. 2015-08-21 15:59:16 -07:00
Corey Farwell
2ab43bea5d Utilize Python context managers for opening/closing files
In some of these cases, files were not being closed
2015-08-21 11:15:17 -04:00
Corey Farwell
03f257697d Cleanup Element iteration in dom/htmlcollection.rs 2015-08-20 16:43:45 -04:00
David Zbarsky
b77698a649 Don't try to unwrap the result of requestAnimationFrame callback 2015-08-20 13:27:11 -04:00
Corey Farwell
e2c700e6ad Work around uses of #[allow(unrooted_must_root)]
Using this directive could cause rooting errors to be silently ignored,
so we should avoid it as much as possible
2015-08-20 13:18:05 -04:00
bors-servo
d2a8c278ea Auto merge of #7254 - frewsxcv:own-property-keys, r=Ms2ger
Initial implementation of ownPropertyKeys proxy handler

Generates `SupportedPropertyNames` on DOM structs that should implement
it. Most of them are unimplemented now (which can be implemented in
later PRs), with the exception of `HTMLCollection`. Also added a couple
relevant WPT tests.

Closes #6390

Closes #2215 

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7254)
<!-- Reviewable:end -->
2015-08-20 10:00:44 -06:00
Corey Farwell
b11be4d253 Initial implementation of ownPropertyKeys proxy handler
Generates `SupportedPropertyNames` on DOM structs that should implement
it. Most of them are unimplemented now (which can be implemented in
later PRs), with the exception of `HTMLCollection`. Also added a couple
relevant WPT tests.

Closes #6390

Closes #2215
2015-08-20 11:58:42 -04:00
bors-servo
0466766b2c Auto merge of #7238 - Wafflespeanut:workerglobal, r=Ms2ger
Improved field names for devtools-related channels...

(for #6924) - I took this because the confusion was actually caused by me while working on #6829

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7238)
<!-- Reviewable:end -->
2015-08-20 08:17:30 -06:00
Ravi Shankar
46195f29df Improved field names for devtools-related channels; r=Ms2ger 2015-08-20 19:38:23 +05:30
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
bors-servo
d3c7e31722 Auto merge of #7271 - Ms2ger:xhret, r=nox
Remove the unused XMLHttpRequestEventTarget::eventtarget method.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7271)
<!-- Reviewable:end -->
2015-08-20 06:01:39 -06:00
bors-servo
15b09fc0af Auto merge of #7272 - wilmoz:EventType, r=Ms2ger
Make EventTypeId reflect DOM inheritance hierarchy

https://github.com/servo/servo/issues/7205#issuecomment-132285499

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7272)
<!-- Reviewable:end -->
2015-08-19 02:47:22 -06:00
bors-servo
70b9922eb0 Auto merge of #7260 - notriddle:issue_7169, r=Ms2ger
Navigate to a new page even when there's a fragment.

Closes #7169

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7260)
<!-- Reviewable:end -->
2015-08-19 01:40:28 -06:00
Michael Howell
af31e8ed0f Navigate to a new page even when there's a fragment.
Closes #7169
2015-08-18 17:35:09 -07:00
wilmoz
d3c60af5c6 Make EventTypeId reflect DOM inheritance hierarchy 2015-08-18 14:04:28 -05:00
Ms2ger
09dc9c44f3 Remove the unused XMLHttpRequestEventTarget::eventtarget method. 2015-08-18 21:01:10 +02:00
bors-servo
ef98e57429 Auto merge of #7230 - nox:required-dictionary-member, r=Ms2ger
Support required dictionary members (fixes #7216)



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7230)
<!-- Reviewable:end -->
2015-08-18 12:58:09 -06:00
bors-servo
50e1c967e4 Auto merge of #7224 - Manishearth:clippy, r=Ms2ger
Integrate clippy into Servo; cleanup some of script

The integration is off by default for now. You can try it out with `./mach build --features "script/plugins/clippy"`.

We're using a branch of clippy with some of the lints changed to Allow, either because they don't apply to us, or because they're noisy and dwarf other warnings (but still should be fixed)

After going through the rest of Servo's warnings I'll figure out which lints we should be keeping.

There's a cargo bug with optional deps that makes it hard for this to work with Cargo.lock -- so this PR contains no changes to lockfiles (and running the build with clippy on may dirty the lockfile, though it gets fixed later)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7224)
<!-- Reviewable:end -->
2015-08-18 08:15:51 -06:00
Manish Goregaokar
19241c95f7 Cleanup NodeIterator, Range, ServoHTMLParser, TextEncoder, URLHelper, URL, VirtualMethods 2015-08-18 19:37:42 +05:30
Manish Goregaokar
a53b86f107 Cleanup WebGLRenderingContext, Websocker, WorkerGlobalScope 2015-08-18 18:38:36 +05:30
Manish Goregaokar
5c4f91c0f1 Cleanup Window, XHR 2015-08-18 18:38:32 +05:30
Manish Goregaokar
ac1b7a3896 Cleanup textinput, timers 2015-08-18 18:37:12 +05:30
Manish Goregaokar
53e155e8ac Cleanup treewalker 2015-08-18 18:37:10 +05:30
Manish Goregaokar
b21df4844c Cleanup node.rs 2015-08-18 18:37:02 +05:30
Manish Goregaokar
94cd004c28 Cleanup script_task 2015-08-18 18:35:47 +05:30
bors-servo
ff6a70fad3 Auto merge of #7241 - Wafflespeanut:event_handler, r=Ms2ger
Matching over event listeners and handlers; r=Ms2ger

... for #7065

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7241)
<!-- Reviewable:end -->
2015-08-18 06:49:26 -06:00
Ravi Shankar
f3db59972a Matching over event listeners and handlers; r=Ms2ger
fixup! Matching over event listeners and handlers; r=Ms2ger
2015-08-18 18:11:57 +05:30
Ms2ger
a9671550ff Update js. 2015-08-18 12:21:03 +02:00
bors-servo
0d6d6a0500 Auto merge of #7257 - jxs:master, r=Ms2ger
Replace uses of `for foo in bar.iter()`,

and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7257)
<!-- Reviewable:end -->
2015-08-18 02:46:46 -06:00
bors-servo
f340900c38 Auto merge of #7246 - glennw:platform-ua, r=larsbergstrom
Add a simple method to emulate a platform UA (e.g. pretend a desktop build is an android UA).



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7246)
<!-- Reviewable:end -->
2015-08-17 22:44:38 -06:00
Glenn Watson
6d9fccbae7 Add a simple method to emulate a platform UA (e.g. pretend a desktop build is an android UA). 2015-08-18 14:42:28 +10:00
Patrick Walton
6567c269cf script: Update rust-selectors to get :active support.
I couldn't find the place in the spec where the precise behavior of
`:active` is described, so I don't set it. However, all the machinery to
keep track of its status is in place.

Improves YouTube.
2015-08-17 17:52:21 -07:00
João Oliveira
067a22a868 Replace uses of for foo in bar.iter(),
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
2015-08-18 01:46:11 +01:00
Nicholas Nethercote
97e3b24aa6 Fix panics in the script_task memory reporter.
These are caused by page_root being empty.
2015-08-17 04:37:43 -07:00
bors-servo
71ae18bae4 Auto merge of #7219 - vectorijk:issue#7042, r=Ms2ger
remove unused static collection type in htmlcollection.rs

ref #7042 
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7219)
<!-- Reviewable:end -->
2015-08-17 02:03:23 -06:00
wartman4404
8d665008f8 Remove the DOMRefCell wrapper around Window::compositor. 2015-08-16 17:28:21 -05:00