Commit graph

1227 commits

Author SHA1 Message Date
Corey Farwell
3a1d140ab5 Enforce linking to spec for method implementations via macros 2015-08-31 21:02:23 -04:00
Anthony Ramine
105d990845 Replace many uses of to_ascii_lowercase() by make_ascii_lowercase() 2015-08-30 15:30:00 +02:00
bors-servo
72125f070d Auto merge of #7391 - jdm:prefs, r=Ms2ger
Replace catch-all experimental flag with fine-grained boolean prefere…

…nces initialized from a JSON document.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7391)
<!-- Reviewable:end -->
2015-08-28 10:08:32 -06:00
Corey Farwell
5ccb0d43ef Merge adjacent identical impl sections
Prior to #7416 and #7401, many of these `impl` sections were not
identical
2015-08-28 10:30:42 -04:00
Josh Matthews
a3ee9b5dd9 Replace catch-all experimental flag with fine-grained boolean preferences initialized from a JSON document. 2015-08-28 10:30:04 -04:00
Anthony Ramine
709d347872 Make the traits for the IDL interfaces take &self 2015-08-27 22:27:43 +02:00
bors-servo
8c301c291a Auto merge of #7389 - frewsxcv:implement-nihilistic-methods, r=nox
Implement 'do nothing' methods on Window and Document



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7389)
<!-- Reviewable:end -->
2015-08-27 12:30:28 -06:00
Corey Farwell
bf50145fbd Implement 'do nothing' methods on Window and Document 2015-08-27 13:13:10 -04:00
Anthony Ramine
2a028f66a2 Remove AttributeHandlers
On components/script/*.rs:

    # Remove imports.
    /^ *use dom::element::\{.*AttributeHandlers/ {
        s/\{AttributeHandlers, /\{/
        s/, AttributeHandlers//g
        s/\{([a-zA-Z]+)\}/\1/
        /\{\}/d
        s/::self;$/;/
    }
    /^ *use dom::element::\{?AttributeHandlers\}?;$/d

    # Remove AttributeHandlers.
    /^pub trait AttributeHandlers \{$/,/^\}$/D

    # Patch AttributeHandlers methods.
    /^impl<'a> AttributeHandlers for &'a Element \{/,/^\}$/ {
        s/^impl<'a> AttributeHandlers for &'a Element \{/impl Element {/
        /^ *fn /s/\(self([,)])/\(\&self\1/
	/^ *fn.*\(&self/s/fn/pub fn/
    }

The few error cases were then fixed by hand.
2015-08-27 16:59:04 +02:00
Anthony Ramine
c831c2c0a5 Remove helper traits
Now that JSRef<T> is gone, there is no need to have helper traits.

On components/script/*.rs:

    # Remove imports.
    /^ *use dom::[a-z]+::\{.*Helpers/ {
        s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/
        s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g
        s/\{([a-zA-Z]+)\}/\1/
        /\{\}/d
        s/::self;$/;/
    }
    /^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d

On components/script/dom/*.rs:

    # Ignore layout things.
    /^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; }

    # Delete helpers traits.
    /^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D

    # Patch private helpers.
    /^impl.*Private.*Helpers/,/^\}$/ {
        s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

    # Patch public helpers.
    /^impl.*Helpers/,/^\}$/ {
        s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/
        /^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

The few error cases were then fixed by hand.
2015-08-27 16:59:02 +02:00
João Oliveira
fd87c8cb3e make dom_struct derive HeapSizeOf,
closes #7357
2015-08-27 01:17:48 +01: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
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08: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
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
vectorijk
14ac1ef75a remove ScriptListener
ref #7175
2015-08-16 01:34:55 -07:00
João Oliveira
0038580abf Replace uses of for foo in bar.iter() and for foo in bar.iter_mut()
closes #7197
2015-08-15 02:27:39 +01:00
João Oliveira
9c11781880 replace .len() == 0 with is_empty()
closes #7198
2015-08-14 04:00:33 +01:00
bors-servo
a03616f379 Auto merge of #7097 - boghison:memtypes, r=jdm
Measure heap memory usage for more types. Fixes #6951

Also adds HeapSizeOf implementations/derive for some types. I've used "Cannot calculate Heap size" as a reason everywhere, because my imagination is rather limited. If you'd like me to change this message for specific types, please write something like this: "Trusted - Cannot calculate Heap size for Trusted" so that it would be easier for me to replace them through a script :)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7097)
<!-- Reviewable:end -->
2015-08-13 13:16:14 -06:00
Bogdan Cuza
45145108da Measure heap memory usage for more types. Fixes #6951 2015-08-13 21:44:41 +03:00
bors-servo
f3b7c5cb4b Auto merge of #7132 - jdm:docenum, r=ms2ger
Document the use and meaning of the devtools control messages. Fixes …

…#6922.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7132)
<!-- Reviewable:end -->
2015-08-13 12:41:48 -06:00
Josh Matthews
e59de75608 Simplify devtools frame marker notification. Record each frame tick based on a single message sent from the script task that ticked. 2015-08-12 00:59:58 -04:00
bors-servo
0c5158587d Auto merge of #6757 - mskrzypkows:document_hasFocus, r=jdm
Implementing document.hasFocus method, needs tests. #6475

I'm not sure if I have to implement some test for a new document method. As I remember there were tests for document methods, is it changed now? Where should I add tests?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6757)
<!-- Reviewable:end -->
2015-08-11 15:35:21 -06:00
Maciej Skrzypkowski
07c0cd8a18 Implementing document.hasFocus method. #6475 2015-08-10 21:23:09 +02:00
bors-servo
530d4547c9 Auto merge of #7046 - Ms2ger:base-url, r=dzbarsky
Implement a base_url getter and use it for style attributes.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7046)
<!-- Reviewable:end -->
2015-08-08 06:53:32 -06:00
Ms2ger
6951119f5e Cache the first base element with an href attribute on the Document. 2015-08-08 14:10:35 +02:00
bors-servo
a0af7a1581 Auto merge of #7075 - Ms2ger:load_url, r=dzbarsky
Improve code around Window::load_url.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7075)
<!-- Reviewable:end -->
2015-08-08 06:09:13 -06:00
Ms2ger
7f2b21c06e Implement base_url and fallback_base_url methods. 2015-08-08 11:26:33 +02:00
Harrison G
e40b141409 Fix requestAnimationFrame timestamps in queue
This resolves #7044 which involved callbacks
in a queue not receiving the same timestamp despite
the specification saying they should. An extra test
was added to verify the correct behavior.
2015-08-07 19:02:52 -04:00
James Graham
36da7e2270 Add DOMLoad message to constellation that is sent after the DOM Load event is dispatched. 2015-08-07 16:55:13 +01:00
Ms2ger
da88e9ad9f Inline Document::load_anchor_href into its only caller. 2015-08-07 15:24:13 +02:00
Ms2ger
40b5c4586e Push the url parsing out of Window::load_url.
This will allow the two callers to decide on the base url independently.
2015-08-07 15:19:16 +02:00
Ms2ger
d2077dd245 Update Animation Timing links and terminology to the HTML specification. 2015-08-05 09:21:08 +02:00
Josh Matthews
8620fe5995 Start reporting memory usage for Window and all nodes in all DOM trees for frame treese in script tasks. 2015-08-03 23:05:00 -04:00
Patrick Walton
2aa5174246 script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
Patrick Walton
44d13f7fd4 net: Use a thread for each AsyncResponseTarget to avoid having to send
trait objects across process boundaries.
2015-07-31 11:27:49 -07:00
Patrick Walton
9c9d7dc93b net: Make most of the resource task messages serializable. 2015-07-31 11:27:49 -07:00
bors-servo
4837dd9a1c Auto merge of #6850 - servo:rustup_2015-07-30, r=SimonSapin
Upgrade to rustc 1.3.0-dev (87055a68c 2015-07-30)

This builds and passes unit tests.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6850)
<!-- Reviewable:end -->
2015-07-30 14:46:13 -06:00
Bogdan Cuza
233a769c67 Add spec links 2015-07-28 13:28:41 +02:00
Simon Sapin
a3c0366bd6 Fix deprecation warnings 2015-07-24 22:16:35 +02:00
Anthony Ramine
389a9ff643 Introduce RootedVec<JS<T>>::r() 2015-07-23 20:56:27 +02:00
bors-servo
ff86e0094c Auto merge of #6691 - glennw:mouse-which, r=jdm
Implement mouseevent.which (needed for enyojs sampler).



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6691)
<!-- Reviewable:end -->
2015-07-22 21:53:00 -06:00
Glenn Watson
d2600e66fb Address review comments 2015-07-23 09:13:09 +10:00
Bogdan Cuza
e10a524c81 Fix #6676 2015-07-22 16:45:42 +03:00
Glenn Watson
2a2c7e18c0 Set detail field to be 1 by default for mouse events.
The spec says this should be "A count of consecutive  clicks that happened in a short amount of time, incremented by one."

This change matches the typical behaviour in FF.
2015-07-22 08:17:57 +10:00
Ms2ger
6d7bc2cffe Rename browser_context identifiers to browsing_context. 2015-07-20 15:56:32 +02:00
bors-servo
64751b8eef Auto merge of #6596 - pcwalton:layout-control-ipc, r=jdm
compositing: Make `ScriptListener` and `LayoutControlChan` messages go over IPC.

r? @jdm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6596)
<!-- Reviewable:end -->
2015-07-14 08:46:07 -06:00
Patrick Walton
e841065351 compositing: Move messages that go over the ScriptListener to go over
an IPC channel instead.

Because this used a boxed trait object to invoke messages across a
process boundary, and boxed trait objects are not supported across IPC,
we spawn a helper thread inside the compositor to perform the marshaling
for us.
2015-07-14 12:12:19 -07:00
David Zbarsky
bc1eb97671 Remove some more unnecessary let bindings 2015-07-14 14:48:16 -04:00