Commit graph

3124 commits

Author SHA1 Message Date
Anthony Ramine
0ac931a43e Fix step 6 of Range::DeleteContents 2016-02-28 04:57:10 +01:00
bors-servo
d5ce8f308f Auto merge of #9734 - nox:finish-event-dispatch, r=Ms2ger
Fix the "get the parent" loop when dispatching event (fixes #6733)

The DOM specification says:

> A document's get the parent algorithm, given an event, returns null
> if event's type attribute value is "load" or document does not have
> a browsing context, and the document's associated Window object
> otherwise.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9734)
<!-- Reviewable:end -->
2016-02-27 23:03:25 +05:30
Anthony Ramine
e70b520c1f Fix the "get the parent" loop when dispatching event (fixes #6733)
The DOM specification says:

A document's get the parent algorithm, given an event, returns null
if event's type attribute value is "load" or document does not have
a browsing context, and the document's associated Window object
otherwise.
2016-02-27 17:41:22 +01:00
bors-servo
4a7d234510 Auto merge of #9768 - jdm:add_disallowed_prefixes, r=jdm
disallow restricted XMLHttpRequest header prefixes

Rebased from #9376.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9768)
<!-- Reviewable:end -->
2016-02-27 22:09:46 +05:30
bors-servo
6c65e154f4 Auto merge of #9774 - nox:remove-attribute-node, r=nox
Implement removeAttributeNode

Supersedes #8727

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9774)
<!-- Reviewable:end -->
2016-02-27 15:23:06 +05:30
bors-servo
8bdffa25f9 Auto merge of #9755 - jdm:handlerreturn, r=jdm
use return value of invoking event handlers to cancel the event

Rebased from #8707. Fixes #8490. We can modify the code and test as necessary whenever we make a decision about https://github.com/whatwg/html/issues/423 in the future.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9755)
<!-- Reviewable:end -->
2016-02-27 07:10:50 +05:30
bors-servo
0d7a2eee2d Auto merge of #9514 - g-k:html-input-value, r=KiChjang
HTML input value

Ready for review.

Fixes #9455.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9514)
<!-- Reviewable:end -->
2016-02-27 04:36:46 +05:30
Nick Fitzgerald
d28c9a1588 Implement removeAttributeNode
This commit implement removeAttributeNode, as described here:
https://dom.spec.whatwg.org/#dom-element-removeattributenode

See also #8724 and #8068.
2016-02-26 21:18:24 +01:00
Anthony Ramine
b8ae5897f1 Implement Element.getAttributeNames 2016-02-26 19:15:11 +01:00
Chandler Abraham
7c3a8d3f5b swap w3c spec link for whatwg, removed user-agent from disallowed headers 2016-02-26 11:04:34 -05:00
Chandler Abraham
c375ad5e95 disallow restricted XMLHttpRequest header prefixes 2016-02-26 11:04:33 -05:00
João Oliveira
b60d668908 use return value of invoking event handlers to cancel the event 2016-02-26 10:17:57 -05:00
bors-servo
26b40afe23 Auto merge of #9757 - jdm:websocket-errors-rebase, r=jdm
Trigger WebSocket error event

Trigger a WebSocket error after receiving an invalid message from the server. Rebased from #8868. Fixes #7861.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9757)
<!-- Reviewable:end -->
2016-02-26 14:14:06 +05:30
Sam Gibson
4f736e6f7c Trigger WebSocket error event
Trigger a WebSocket error after receiving an invalid message from the server
2016-02-26 09:43:12 +01:00
Greg Guthe
e6c31e305d Get input value IDL attribute matching spec
Refs: https://github.com/servo/servo/issues/9455
2016-02-25 18:59:34 -05:00
Eli Friedman
7b671d13a0 Use presentation hints correctly for the dimensions of <img>.
Mostly straightforward; includes some extra fixes to make `<canvas>`
work the same way as `<img>` for reflow.
2016-02-25 14:04:06 -05:00
Anthony Ramine
2ed1a4ab3b Do not generate RegisterBindings::Register anymore 2016-02-25 15:56:54 +01:00
Anthony Ramine
1559f5a39f Lazily define interface objects on globals (fixes #6419) 2016-02-25 15:56:47 +01:00
Anthony Ramine
ca979e115b Cache legacy callback interface objects in proto_or_icache_array
We need them to be cached to not instantiate them multiple times with
lazy initialisation.
2016-02-25 15:15:44 +01:00
Anthony Ramine
2c4d5da866 Lazily-define standard ECMAScript classes 2016-02-25 15:15:44 +01:00
bors-servo
42f1712846 Auto merge of #9740 - paulrouget:mozbrowserconnected, r=jdm
Support Browser API event mozbrowserconnected

Fixes https://github.com/servo/servo/issues/9382

This new event is not yet documented. If this lands, I will add documentation to MDN.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9740)
<!-- Reviewable:end -->
2016-02-25 15:56:24 +05:30
bors-servo
b3b6f09206 Auto merge of #9742 - nox:atom-from-string, r=ecoal95
Make use of From<String> for Atom

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9742)
<!-- Reviewable:end -->
2016-02-25 08:39:44 +05:30
bors-servo
09e987b559 Auto merge of #9661 - jdm:devtools-inspector-get-layout, r=pcwalton
Completed implementation of devtools' `getLayout`.

Rebase of #7267. Fixes #3598.

This avoids all of the sketchy issues of trying to read the style data for margins from the script thread. I replaced it with a layout query that fetches the margin style properties for a given element.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9661)
<!-- Reviewable:end -->
2016-02-25 00:22:43 +05:30
benshu
0785d91ae4 Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
Paul Rouget
3ecc907767 Support Browser API event mozbrowserconnected 2016-02-24 18:45:07 +01:00
Anthony Ramine
0adfb08089 Implement From<DOMString> for Atom 2016-02-24 17:52:17 +01:00
Anthony Ramine
f7fb035188 Optimise local name cloning in Document::CreateAttribute 2016-02-24 17:52:15 +01:00
Anthony Ramine
25ae4ed093 Use atom!("error") in EventTarget::get_compiled_event_handler 2016-02-24 17:52:14 +01:00
Anthony Ramine
cc030df36e Make use of From<String> for Atom 2016-02-24 17:52:13 +01:00
bors-servo
3212d3a91e Auto merge of #9731 - paulrouget:mozbrowserRootPipelineOnly, r=jdm
allow mozbrowser only for top level windows

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9731)
<!-- Reviewable:end -->
2016-02-24 22:18:19 +05:30
bors-servo
438b3a444b Auto merge of #9722 - mbrubeck:slow-selector, r=nox
Dirty elements whose selectors are affected by sibling changes

This fixes incremental layout of nodes that match pseudo-class selectors such as :first-child, :nth-child, :last-child, :first-of-type, etc.  Fixes #8191 and other intermittent layout bugs.

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134

Depends on servo/rust-selectors#71. r? @SimonSapin

There are a couple of TODO items in this commit, but I'd appreciate feedback on the general approach before I finish it up.  (Also, if someone who knows more than I do could give some advice about atomic orderings...)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9722)
<!-- Reviewable:end -->
2016-02-24 18:55:39 +05:30
Saurav Sachidanand
52059740e3 Inline functions HTMLCollection::get_length and get_item 2016-02-24 17:41:07 +05:30
Matt Brubeck
973918967f Dirty elements whose selectors are affected by sibling changes
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes #8191
* Fixes #9063
* Fixes #9303
* Fixes #9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
2016-02-23 17:31:38 -08:00
bors-servo
d85ee09bc7 Auto merge of #9729 - Ms2ger:bc-option, r=jdm
Stop returning an Option from Window::browsing_context.

A Window always has a WindowProxy; the only reason it's wrapped in a nullable
field is the order in which those objects are created.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9729)
<!-- Reviewable:end -->
2016-02-24 01:21:01 +05:30
Paul Rouget
322e71627c allow mozbrowser only for top level windows 2016-02-23 20:31:56 +01:00
bors-servo
7192495e1a Auto merge of #9067 - nox:unenumerable-named-properties, r=jdm
Make NamedNodeMap's named properties unenumerable

https://dom.spec.whatwg.org/#dom-htmlcollection-item

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9067)
<!-- Reviewable:end -->
2016-02-23 22:58:30 +05:30
Anthony Ramine
86f3f37950 Always implement getOwnEnumerablePropertyKeys
According to JSProxy.h, without this the default implementation calls
ownPropertyKeys and filters out the unenumerable properties. We know when such
things exist so we don't need to do that.
2016-02-23 17:23:56 +01:00
Anthony Ramine
7696a6bd20 Fix HTMLCollection::NamedItem 2016-02-23 17:23:54 +01:00
Anthony Ramine
7f36247d03 Support [LegacyUnenumerableNamedProperties] 2016-02-23 17:23:51 +01:00
Anthony Ramine
cbf514d63f Fix a typo in CGDOMJSProxyHandler_getOwnPropertyDescriptor
Named properties are read-only if there is no named setter.
2016-02-23 17:23:03 +01:00
Anthony Ramine
b783d96749 Make fill_property_descriptor take a flags argument 2016-02-23 17:14:27 +01:00
Anthony Ramine
c95855c7ea Implement [LegacyUnenumerableNamedProperties] in the WebIDL parser
http://github.com/heycam/webidl/issues/82
2016-02-23 17:06:13 +01:00
bors-servo
433232a7ff Auto merge of #9598 - TimNN:xhr-header-step-3, r=Ms2ger
Implement XHR::SetRequestHeader Step 3

Closes #9548.

Alternative implementation of #9595.

cc @timvandermeij

I'm not sure if a utility method on `ByteString` is the best place for this functionality, maybe a free function in XHR module would be more suitable.

Also where would be the correct place to add a test for this functionality (if required)?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9598)
<!-- Reviewable:end -->
2016-02-23 21:08:43 +05:30
Ms2ger
0e35931152 Stop returning an Option from Window::browsing_context.
A Window always has a WindowProxy; the only reason it's wrapped in a nullable
field is the order in which those objects are created.
2016-02-23 16:08:28 +01:00
Anthony Ramine
0af373cef6 Just pass global to CreateInterfaceObjects
The receiver parameter is useless here.
2016-02-23 15:42:45 +01:00
Anthony Ramine
96e28086e3 Clean up CGDOMJSClass 2016-02-23 15:42:44 +01:00
Anthony Ramine
144e215548 Don't use the hasOwn hook anymore in browsingcontext
There is no [[HasOwnProperty]] hook in the ES spec, we should just define
the has proxy trap.

https://bugzilla.mozilla.org/show_bug.cgi?id=980565
2016-02-23 15:42:43 +01:00
Anthony Ramine
a734b8fa21 Reorder js imports in browsingcontext 2016-02-23 15:42:42 +01:00
Tim Neumann
fac4c31b42 implement XHR::SetRequestHeader Step 3 2016-02-23 15:22:37 +01:00
Tim Neumann
746f7dd29e move method from ByteString to module where it was used 2016-02-23 15:21:35 +01:00