Commit graph

41 commits

Author SHA1 Message Date
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Ms2ger
73b9925cc1 Remove a pointless clone() call. 2015-09-16 16:29:03 +02:00
Ms2ger
f4cf90f127 Remove an obsolete TODO comment. 2015-09-16 16:29:02 +02:00
Ms2ger
e85b1e4e89 Use an early return in dispatch_to_listeners. 2015-09-16 16:29:02 +02:00
Ms2ger
b7a0440f91 Emit markers for all events, not just UI events. 2015-09-16 16:29:01 +02:00
Ms2ger
a85196398d Return immediately from dispatch_to_listeners if propagation is stopped. 2015-09-16 16:28:58 +02:00
Ms2ger
af6bc108f3 Use early returns in dispatch_to_listeners. 2015-09-16 16:28:57 +02:00
Ms2ger
995cb21b48 Use if-let in dispatch_to_listeners, and simplify break conditions. 2015-09-16 16:28:56 +02:00
Ms2ger
a5925020ce Avoid calling any listeners for events whose stop propagation flag is set prior to dispatching. 2015-09-16 16:28:31 +02:00
Ms2ger
b342dff07d Add more assertions to dispatch_event. 2015-09-16 14:48:36 +02:00
Ms2ger
76eea43c83 Factor out a dispatch_to_listeners function from dispatch_event. 2015-09-16 13:36:18 +02:00
Ms2ger
15717173ee Reorder the code in dispatch_event a bit. 2015-09-16 13:36:17 +02:00
Ms2ger
9ddeec09c3 Remove outdated FIXME comment. 2015-09-16 13:36:17 +02:00
Manish Goregaokar
8e2c37a542 Fix match_refs and let_returns in layout, address review changes 2015-09-04 18:30:46 +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
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
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
bors-servo
ff6a70fad3 Auto merge of #7241 - Wafflespeanut:event_handler, r=Ms2ger
Matching over event listeners and handlers; r=Ms2ger

... for #7065

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7241)
<!-- Reviewable:end -->
2015-08-18 06:49:26 -06:00
Ravi Shankar
f3db59972a Matching over event listeners and handlers; r=Ms2ger
fixup! Matching over event listeners and handlers; r=Ms2ger
2015-08-18 18:11:57 +05:30
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
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
Anthony Ramine
389a9ff643 Introduce RootedVec<JS<T>>::r() 2015-07-23 20:56:27 +02:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Anthony Ramine
7197052c0d Uniformise root() methods
They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable
and ResultRootable.
2015-04-28 09:22:45 +02:00
Manish Goregaokar
dcb0a0eab6 Fix some no_move errors 2015-04-28 04:20:45 +05:30
bors-servo
1389be3782 Auto merge of #5847 - Ms2ger:slice, r=SimonSapin
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5847)
<!-- Reviewable:end -->
2015-04-26 05:30:28 -05:00
Ms2ger
a862479ca8 Remove as_slice() calls from script. 2015-04-26 10:52:55 +02:00
Peter
d0f451c2e1 Removed unessary poping in dispatch_event, fixes #5843 2015-04-25 20:22:04 -04:00
Corey Farwell
5eaa922045 Update WHATWG links to use HTTPS
Extracted this out of #5649

This commit was created with the following commands:

```
find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```

```
find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g'
```
2015-04-13 21:34:27 -07:00
Anthony Ramine
bf7c791e3a Hold a Temporary in AncestorIterator 2015-04-07 15:46:31 +02:00
Mukilan Thiyagarajan
e8a1e9eabb Implement RootedVec<T> 2015-03-29 11:58:25 +02:00
Josh Matthews
159235b3d0 Add handling for unreported exceptions when invoking callback objects. 2015-01-14 12:54:46 -05:00
Ms2ger
1dad710063 Replace Root::deref() calls by Root::r() calls where possible.
This changes those calls that were already sound.
2015-01-01 20:36:43 +01:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
thiagopnts
79487252ca Add auxiliary method to EventTargetHelpers for events without target
fixup! Add auxiliary method to EventTargetHelpers for events without target
2014-12-16 10:01:38 -02:00
Tim Taubert
cd9de05088 Privatize Event 2014-10-13 13:25:44 +02:00
Manish Goregaokar
7e1e76f8b0 Remove Traceable from event.rs 2014-10-05 22:13:14 +05:30
Josh Matthews
54fcab61d6 Implement MutNullableJS for mutable, nullable member pointers to DOM objects. 2014-10-01 17:06:23 +02:00
Cameron Zwarich
4fa8725111 First steps of &JSRef -> JSRef conversion
Replace &JSRef with JSRef in the bulk of the generated code. This will
remove a level of indirection throughout all DOM code.

This patch doesn't change methods implemented on JSRef<T> to take `self`
rather than `&self`, and it leaves a few other uses of &JSRef, but those
changes can be made incrementally.
2014-09-19 13:39:17 -07:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/script/dom/eventdispatcher.rs (Browse further)