Commit graph

130 commits

Author SHA1 Message Date
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07: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
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Anthony Ramine
15acd1525e Make Promise::reject_native sound 2017-09-21 16:19:29 +02:00
Anthony Ramine
5addc2dfa3 Make Promise::resolve_native actually sound
We shouldn't have to pass a raw JSContext pointer, and to enter the
promise's context's compartment by hand.
2017-09-21 16:00:48 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
bors-servo
cdd4de9c06 Auto merge of #17250 - cbrewster:unwrap_constructor, r=jdm
Unwrap function before calling IsConstructor

`IsConstructor` returns true for all wrappers that are callable. Wrapped
arrow functions are callable and thus `IsConstructor` will return true
if given one; however, if we unwrap the arrow function, `IsConstructor`
will return false. The latter is the correct behavior here.

---
<!-- 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/17250)
<!-- Reviewable:end -->
2017-08-16 17:09:37 -05:00
Connor Brewster
9f51c7df21 Track custom element state 2017-08-09 14:36:22 -06:00
Connor Brewster
e700006fb2 Handle exceptions during upgrades 2017-08-09 14:36:20 -06:00
Connor Brewster
6d9d4add61 Enqueue upgrades 2017-08-09 14:36:18 -06:00
Connor Brewster
41371208a5 Check namespace during ce def lookup 2017-08-09 14:36:16 -06:00
Connor Brewster
37cbc85727 Use HTMLElement interface for possible CEs 2017-08-09 14:36:13 -06:00
Connor Brewster
e83a0045f9 Add upgrade reaction 2017-08-09 11:06:44 -06:00
Connor Brewster
ec528e944a Implement element upgrade algorithm 2017-08-09 11:06:42 -06:00
Connor Brewster
8c5005fc44 Add construction stack 2017-08-09 11:06:22 -06:00
Connor Brewster
d8510baa29 Unwrap function before calling IsConstructor
IsConstructor returns true for all wrappers that are callable. Wrapped
arrow functions are callable and thus IsConstructor will return true
if given one; however, if we unwrap the arrow function, IsConstructor
will return false. The latter is the correct behavior here.
2017-08-08 08:46:35 -06:00
Connor Brewster
77efab8a9e Return null when an attr's namespace is not set 2017-07-18 13:36:48 -06:00
Connor Brewster
438191e0b2 Implement CEReactions codegen 2017-07-18 08:18:22 -06:00
Connor Brewster
9b587a4f2d Invoke backup element queue via a microtask 2017-07-17 22:23:47 -06:00
Connor Brewster
4665991503 Support custom element callback reactions 2017-07-17 22:23:45 -06:00
Connor Brewster
596ed557d2 Get observed attributes when a CE is defined
Implements steps 10.5 - 10.6 of CustomElementRegistry.define
2017-07-13 09:38:16 -06:00
Connor Brewster
901a2028f1 Store lifecycle callbacks when CEs are defined
This implements steps 10.3 - 10.4 of the CustomElementRegistry.define
steps.
2017-07-13 09:27:05 -06:00
Connor Brewster
37e8b89377 Allow element prefix to be set
Implements step 6.1.10 of
https://dom.spec.whatwg.org/#concept-create-element
2017-06-23 21:10:01 -06:00
Connor Brewster
6697f5469d Hook CE registry into element creation 2017-06-23 21:09:53 -06:00
Connor Brewster
e4ff934e82 Remove applet from list extendable interfaces 2017-06-15 21:33:32 -06:00
Connor Brewster
2333b39569 Implement HTMLConstructor 2017-06-15 21:32:22 -06:00
Connor Brewster
e21e64a33c Add custom element registry 2017-06-05 09:18:54 -06:00