Commit graph

2070 commits

Author SHA1 Message Date
Anthony Ramine
49219baab8 Annotate many DOM attribute and methods with [Constant] and [Pure] 2015-09-19 16:03:13 +02: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
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
David Zbarsky
3bec4d37dd Implement Range#surroundContents 2015-09-08 22:01:49 -07: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
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
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
Connor Imes
d746835344 Combine script profiling with profile crates. Fixes #7514. 2015-09-04 16:09:44 -05:00
bors-servo
9d42179900 Auto merge of #7545 - jgraham:get_pref_option, r=jdm
Update prefs API to return an Option<bool>.

This allows for situations where there is no reasonable default
to apply for the pref value e.g. when we are just listing values

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7545)
<!-- Reviewable:end -->
2015-09-04 11:02:12 -06:00
James Graham
a208379f46 Update prefs API to return an Option<bool>.
This allows for situations where there is no reasonable default
to apply for the pref value e.g. when we are just listing values
2015-09-04 15:55:29 +01:00
bors-servo
c2c2646d37 Auto merge of #7536 - Manishearth:clippyfix, r=Ms2ger
More clippy fixes

Elided almost all the lifetimes and removed needless returns. Mostly done by sed + manual fixes.

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7536)
<!-- Reviewable:end -->
2015-09-04 07:59:04 -06:00
Manish Goregaokar
8e2c37a542 Fix match_refs and let_returns in layout, address review changes 2015-09-04 18:30:46 +05:30
Tetsuharu OHZEKI
63627405d9 script: change requestAnimationFrame returns the unsigned long type. 2015-09-04 15:40:30 +09:00
Manish Goregaokar
e94df1ed5c Remove needless returns 2015-09-04 09:13:48 +05:30
Manish Goregaokar
2e02ea38fc Elide most 'b lifetimes 2015-09-04 09:02:12 +05:30
Manish Goregaokar
54c036cd66 Elide most 'a lifetimes 2015-09-04 08:55:51 +05:30
bors-servo
05deb3dcc8 Auto merge of #7518 - servo:custom-properties, r=pcwalton
Initial support for CSS Custom Properties

https://drafts.csswg.org/css-variables/

Missing: 

* `var()` in shorthand property declarations.
* Correct handling of EOF in custom property declarations.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7518)
<!-- Reviewable:end -->
2015-09-03 16:09:02 -06:00
Simon Sapin
5fb6acb753 Rename DeclaredValue::SpecifiedValue to DeclaredValue::Value 2015-09-03 23:02:15 +02:00
Thiago Pontes
a2a9c0489d Make use of FromStr and Default traits in lib canvas
fixup! Make use of FromStr and Default traits in lib canvas
2015-09-03 14:42:53 -03:00
Eli Friedman
57a3e1465c Remove unnecessary uses of DOMRefCell. 2015-09-02 15:21:57 -07:00
bors-servo
da02dba979 Auto merge of #7511 - psdh:attrtokato, r=Ms2ger
make AttrVal tokens() and atom() return or panic

Fixes #7479

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7511)
<!-- Reviewable:end -->
2015-09-02 15:03:10 -06:00
bors-servo
ded6159d48 Auto merge of #7516 - frewsxcv:dirty-script-dir, r=metajack
Allow 'script' component to enter a 'built' state

After this pull request merged:

https://github.com/servo/servo/pull/7209

the 'script' component would never enter a 'built' state. In other
words, if one calls `mach build`, lets it complete, then calls `mach
build` again, the 'script' component would rebuild even though we
supposedly just built it. This was due to the `ParserResults.pkl`
getting placed in the `components/script` directory instead of the
output directory, causing cargo to think that there were unbuilt files.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7516)
<!-- Reviewable:end -->
2015-09-02 14:29:21 -06:00
Corey Farwell
8792aa7fc0 Allow 'script' component to enter a 'built' state
After this pull request merged:

https://github.com/servo/servo/pull/7209

the 'script' component would never enter a 'built' state. In other
words, if one calls `mach build`, lets it complete, then calls `mach
build` again, the 'script' component would rebuild even though we
supposedly just built it. This was due to the `ParserResults.pkl`
getting placed in the `components/script` directory instead of the
output directory, causing cargo to think that there were unbuilt files.
2015-09-02 16:14:04 -04:00
bors-servo
3424e234c8 Auto merge of #7499 - nerith:style, r=metajack
Improve style nit check for space after a comma

Fixes #7345.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7499)
<!-- Reviewable:end -->
2015-09-02 12:05:58 -06:00
Prabhjyot Singh Sodhi
105ea0d690 renaming tokens(), atom() and uint() and rewriting to return or panic 2015-09-02 22:20:33 +05:30
bors-servo
e1ede2074d Auto merge of #7429 - GyrosOfWar:serialize_list_space_fix, r=jdm
Fixed serialize_list to no longer append an additional space at the e…

…nd of the string.

Fixes #7404

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7429)
<!-- Reviewable:end -->
2015-09-02 09:15:16 -06:00
bors-servo
eaf90c0b1c Auto merge of #7452 - nox:cleanup-attributes, r=nox
Introduce VirtualMethods::attribute_mutated()



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7452)
<!-- Reviewable:end -->
2015-09-02 08:14:33 -06:00
Martin Tomasi
ccddc3c13e Fixed serialize_list to no longer append an additional space at the end of the string 2015-09-02 15:46:04 +02:00
Anthony Ramine
58e1bd0e57 Introduce VirtualMethods::attribute_mutated()
This replaces before_remove_attr(), after_remove_attr() and after_set_attr().
The virtual method takes the mutated attribute and an AttributeMutation value
to disambiguate between "attribute is changed", "attribute is added" and
"attribute is removed".

In the case of "attribute is changed", the mutation value contains a reference
to the old value of the mutated attribute, which is used to unregister outdated
named elements when the "id" attribute is changed on an element.

This greatly simplifies the handling of attributes, which in many cases don't
have any specific behaviour whether they are removed or changed or added. It
also fixes a few bugs where things were put in before_remove_attr() instead of
after_remove_attr() (e.g. when removing an href attribute from a base element).

A few helper functions in Element were also renamed and made private.
2015-09-02 15:45:38 +02:00
bors-servo
a547ae6826 Auto merge of #7496 - servo:calc_, r=SimonSapin
Implement CSS3 Calc

This is #7185 with one commit added to make it build merged with master, which got support for the `ch` unit in the meantime.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7496)
<!-- Reviewable:end -->
2015-09-02 02:33:18 -06:00
Simon Sapin
40b4348824 Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01) 2015-09-02 09:22:17 +02:00
bors-servo
a844c0b0e8 Auto merge of #7500 - farodin91:viewport, r=jdm
Implement viewport functions for window #1718

@jdm r?
closes #6875

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7500)
<!-- Reviewable:end -->
2015-09-01 21:31:25 -06:00
wilmoz
1830ada4bc Documentation of inheritance in type ids 2015-09-01 21:34:35 -05:00
farodin91
f0987380dd Implement viewport functions for window #1718 2015-09-02 00:40:52 +02:00
Brandon Fairchild
d61a6e2161 Fix reported test-tidy errors
This fixes lines that were reported to have missing
space after a comma.
2015-09-01 16:30:42 -04:00
bors-servo
493da96cae Auto merge of #7209 - frewsxcv:codegen-build-cleanup, r=metajack
Cleanup/refactor build scripts for DOM codegen

Prior to this commit, the script codegen makefile relied on an
intermediary pythonpath.py file that handled python dependencies and
incorporated a couple hacks to get the codegen building working. This
commit removes that intermediary file and attempts to make the script
codegen build process cleaner.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7209)
<!-- Reviewable:end -->
2015-09-01 13:53:49 -06:00
Simon Sapin
80d471d5cf Merge branch 'master' into calc 2015-09-01 18:39:16 +02:00
Anthony Ramine
5672142042 Remove Element::get_attributes() 2015-09-01 18:25:25 +02:00