Commit graph

5879 commits

Author SHA1 Message Date
Simon Sapin
bffec1c1a1 Make usage of unstable feature on_unimplemented optional. 2017-10-16 20:20:18 +02:00
Simon Sapin
5a5b7d7f39 Remove usage of unstable features const_ptr_null and const_ptr_null_mut 2017-10-16 20:20:01 +02:00
Simon Sapin
3bb76a5be5 Don’t rely on unstable 'const fn's in rust-mozjs, so we can remove them. 2017-10-16 20:20:00 +02:00
Simon Sapin
a819cfb0fa Replace uses of libcore with libstd in components/script 2017-10-16 20:19:59 +02:00
Simon Sapin
99b052d3a6 Move remaining uses of NonZero to our nonzero crate 2017-10-16 20:19:59 +02:00
Simon Sapin
e2fafd2dfc Replace NonZero<*mut JSObject> with a wrapper to enable local trait impls. 2017-10-16 20:19:56 +02:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
bors-servo
adb45eb727 Auto merge of #18888 - tigercosmos:xml, r=jdm
fix  #18776: use XML fragment serialization for innerHTML in XML documents

<!-- Please describe your changes on the following line: -->
I am not sure whether my solution is in the right way.
@jdm Can you give some advises?

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #18776 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18888)
<!-- Reviewable:end -->
2017-10-16 01:27:43 -05:00
tigercosmos
c77b61193f use XML fragment serialization for outerHTML in XML documents 2017-10-16 13:28:23 +08:00
tigercosmos
06759fd0fd use XML fragment serialization for innerHTML in XML documents 2017-10-16 00:38:21 +08:00
bors-servo
7e8def9c08 Auto merge of #18886 - servo:urls, r=SimonSapin
Change AttrValue::Url to AttrValue::ResolvedUrl

Things make more sense like this.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18886)
<!-- Reviewable:end -->
2017-10-15 04:53:29 -05:00
Anthony Ramine
c7b1d3054f Change AttrValue::Url to AttrValue::ResolvedUrl
There is actually only one attribute that can use that, the one for
<body background>.
2017-10-15 11:03:20 +02:00
Emilio Cobos Álvarez
11485edc9e
style: Hide LocalMatchingContext.
This type is a lot of complexity related to a very specific thing such as the
hover and active quirk.

Instead of that, move `nesting_level` to `MatchingContext`, and simplify all
this computing whether the quirk applies upfront, for each complex selector we
test.

This is less error-prone, and also allows simplifying more stuff in a bit.
2017-10-14 17:03:35 +02:00
bors-servo
240c05f13b Auto merge of #18838 - svanburen:remove_cssText, r=emilio
Remove cssText from CSSStyleValue

Removed from associated .rs and .webidl

<!-- Please describe your changes on the following line: -->
Not much more to add - let me know if it needs additional changes.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17379 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they remove a property that previously had no tests associated with it.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18838)
<!-- Reviewable:end -->
2017-10-14 06:58:29 -05:00
bors-servo
2be76c5fd7 Auto merge of #18867 - emilio:parse-hack, r=heycam
style: Dishonor display: -moz-box if -webkit-box was specified before

This is a compatibility hack that Gecko supports that is apparently important for android.

I want to remove it, but let's see...

See https://bugzilla.mozilla.org/show_bug.cgi?id=1407701 for reference.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18867)
<!-- Reviewable:end -->
2017-10-14 05:27:51 -05:00
Emilio Cobos Álvarez
25c303ee62
style: Be clearer about whether a declaration comes from parsing or not.
This introduces DeclarationSource, to see if a declaration has been parsed or
set from CSSOM in a declaration block.

The Servo_DeclarationBlock_SetFoo and similar callers are changed to
DeclarationSource::CssOm because their semantics are more CSSOM-y, but it
shouldn't matter since they should all be checked before hand with
Servo_DeclarationBlock_PropertyIsSet.
2017-10-14 11:30:59 +02:00
Simon Sapin
4c5d6fd834 Remove an unused import, fix a warning. 2017-10-13 21:57:26 +02:00
Emilio Cobos Álvarez
f64f8b8be2
style: Share code for Element::Closest. 2017-10-13 17:21:31 +02:00
Emilio Cobos Álvarez
9e6c49d479
style: Share code for Element::Matches. 2017-10-13 17:21:26 +02:00
Simon Sapin
796a8dc618 Remove usage of unstable feature try_from 2017-10-12 12:10:55 +02:00
Stefan VanBuren
f92dbdbdf3 Remove cssText from CSSStyleValue
Removed from associated .rs and .webidl
2017-10-11 16:21:29 -04:00
Simon Sapin
4ee8f56b9c Remove usage of unstable feature ascii_ctypes 2017-10-11 20:21:07 +02:00
Anthony Ramine
71b015173f Fix the form action IDL attributes
The returned string, if the attribute is present and non-empty,
should be a URL resolved against the element's document's base URL.
2017-10-11 13:56:10 +02:00
Anthony Ramine
605c679fee Fix URL attributes
URL attributes should always use AttrValue::Url, and the input should be
resolved against the document's base URL at setting time always.
2017-10-11 13:56:07 +02:00
Anthony Ramine
e3fb99dd59 Implement a bit more of the "object" path when loading media 2017-10-10 11:44:29 +02:00
Anthony Ramine
b7452f37d9 Properly abort any ongoing resource selection on loading a new media 2017-10-10 10:10:39 +02:00
Anthony Ramine
8754155a11 Update HTMLMediaElement.webidl according to spec 2017-10-10 09:50:51 +02:00
bors-servo
bbb2a3cde9 Auto merge of #18790 - upsuper:scope, r=emilio
Support :scope pseudo-class

This fixes [bug 1406817](https://bugzilla.mozilla.org/show_bug.cgi?id=1406817).

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18790)
<!-- Reviewable:end -->
2017-10-09 23:04:15 -05:00
bors-servo
e3624e62a4 Auto merge of #18747 - jdm:serializing-childrenonly, r=jdm
Serializing childrenonly

Rebased from #17896.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14975 (github issue number if applicable).
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18747)
<!-- Reviewable:end -->
2017-10-09 11:12:53 -05:00
Xidorn Quan
0564a1e47b Support :scope pseudo-class in Element::{matches,closest} in Servo 2017-10-09 22:13:00 +11:00
bors-servo
712d32e899 Auto merge of #18758 - stuartnelson3:stn/dynamic-body-bgcolor, r=emilio
Add support for dynamic bgcolor change

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18758)
<!-- Reviewable:end -->
2017-10-08 07:47:50 -05:00
Jyotsna Prakash
6c0f87a1d6 ChildrenOnly -> ChildrenOnly(Option<QualName>)
use this updated type from html5ever
2017-10-07 08:05:11 -04:00
bors-servo
0444d76c6b Auto merge of #18742 - servo:media-metadata, r=jdm
Some low-key media improvements

This just makes our code fail more gracefully.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18742)
<!-- Reviewable:end -->
2017-10-05 15:41:22 -05:00
Stuart Nelson
3b4deb4388 Add support for dynamic bgcolor change 2017-10-05 20:51:02 +02:00
bors-servo
1f9182507f Auto merge of #18716 - jdm:parseSrcset, r=jdm
Parse srcset attribute values

Squashed version of #18313.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix (partially) #11416
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18716)
<!-- Reviewable:end -->
2017-10-04 07:32:53 -05:00
Anthony Ramine
eb0c1a53ad Implement MediaError::Message
The spec says that it's ok to put an empty string in it if we don't have more
informations.
2017-10-04 11:41:41 +02:00
Anthony Ramine
b8c55e7da6 Set have_metadata for audio elements too
We don't store video-specific metadata anymore, and we don't ignore audio-specific
metadata anymore. We now just acknowledge that we received some metadata.
2017-10-04 11:28:47 +02:00
Cameron McCormack
4d9dd4b757 style: Use a SharedFontList object to store font-family values for Gecko. 2017-10-04 13:38:07 +08:00
Neha
1f1ca3ac8d Parse srcset attribute 2017-10-03 13:18:01 +02:00
bors-servo
77afc3f33a Auto merge of #18714 - jdm:sizes, r=jdm
Parse sizes attribute values

Squashed version of #17808.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix (partially) #11416
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18714)
<!-- Reviewable:end -->
2017-10-03 04:16:00 -05:00
Rakhi Sharma
c31b0e4bd2 Parse sizes attribute values. 2017-10-02 20:31:06 +02:00
Martin Robinson
0380431157 Combine ReflowGoal and ReflowQueryType
This simplifies the logic in the layout_thread and makes it clearer
which types of reflows generate display lists and cause display updates.
2017-09-30 16:06:48 +02:00
Guillaume Gomez
3d0b7fbc41 Implement EventListenerOptions for EventTarget
For now, only "capture" is supported.
2017-09-30 02:12:35 +02:00
bors-servo
ffa03380ca Auto merge of #18580 - MortimerGoro:webgl_active_texture, r=jdm
Associate WebGL textures with texture units

<!-- Please describe your changes on the following line: -->

Currently `bound_texture_2d` and `bound_texture_cube_map` fields are used to restore texture states and to get the current bindings in GetParams(...). But as soon as active texture is changed all the values can become dirty, leading to broken textures in some demos or invalid getParam(...) call results.

This PR implements the texture binding association with the texture units.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18580)
<!-- Reviewable:end -->
2017-09-28 14:12:06 -05:00
Imanol Fernandez
b9710a59b5 Associate bound WebGLTextures with texture units. 2017-09-28 18:52:29 +02:00
Anthony Ramine
dee38475b8 Make DomRoot<T> a type alias of a more general Root<T> type
This Root<T> relies on the concept of a stable trace object, which doesn't
move for the whole lifetime of the T value. For safety reasons, T must be 'static.

The only implementor of StableTraceObject for now is Dom<T>.
2017-09-28 15:42:43 +02:00
Anthony Ramine
b441f8a0f7 Kill RootCollectionPtr 2017-09-27 14:24:37 +02:00
Anthony Ramine
378babfd4c Move STACK_ROOTS to dom::bindings::root 2017-09-27 14:16:05 +02:00
Anthony Ramine
8d566fbc3c Move script_runtime::StackRootTLS to root::ThreadLocalStackRoots 2017-09-27 13:58:59 +02:00
Anthony Ramine
a6d01c92d9 Reorder things in dom::bindings::root
The type DomRoot<T> is now the first one defined in it.
2017-09-27 13:44:07 +02:00