Commit graph

2403 commits

Author SHA1 Message Date
Rohan Prinja
c1abb4fdb2 clean code as per code review 2015-10-26 03:52:05 +09:00
Ms2ger
54d3462fa5 Use the new define_methods and define_properties functions from js. 2015-10-25 19:50:10 +01:00
Axel Solis Trompler
5542f87400 Refactor document.createEvent(touchevent) 2015-10-25 16:36:16 +01:00
Corey Farwell
98a6fc07e2 Implement 'htmlFor' attribute for <label> elements 2015-10-25 08:06:44 -04:00
Corey Farwell
f97d1d148b Implement 'control' attribute for <label> elements 2015-10-25 08:06:31 -04:00
Tetsuharu OHZEKI
04967ed97e script: Element.webkitMatchesSelector()
spec:
9ac9c15486
2015-10-25 15:27:20 +09:00
Dongie Agnir
b5e991c89e Replace if-else with match. 2015-10-24 19:10:52 -10:00
bors-servo
bb88832c07 Auto merge of #8073 - eefriedman:root-lint, r=Manishearth
Make unrooted_must_root a bit more aggressive.

Basically, instead of trying to check for specific kinds of statements,
just check the types of all local variables.

Also included are some commented-out proposals for some slightly more
aggressive lints which might be useful (but trigger a little too
frequently at the moment).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8073)
<!-- Reviewable:end -->
2015-10-24 20:20:04 -05:00
Corey Farwell
48ea5959c7 Remove unnecessary allocation with getElementById 2015-10-24 17:50:42 -04:00
Dongie Agnir
ea21db6a0f Move cast into if block. 2015-10-23 13:59:02 -10:00
Dongie Agnir
663801ed79 ask for reset and pick on option insert. 2015-10-23 13:16:52 -10:00
Dongie Agnir
6e9e1465bf Implement pick_option. 2015-10-23 13:12:06 -10:00
bors-servo
354e75a447 Auto merge of #8171 - Ms2ger:reflector, r=jdm
Remove the default implementation of Reflectable::init_reflector.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8171)
<!-- Reviewable:end -->
2015-10-23 17:49:28 -05:00
Dongie Agnir
b1d6b0f797 Implement ask_for_reset for HTMLSelectElement.
Fixes #7774
2015-10-23 11:47:20 -10:00
Eli Friedman
a9ef40c716 Don't allow unrooted values in function arguments. 2015-10-23 14:44:19 -07:00
Eli Friedman
81ecf7824c Make unrooted_must_root a bit more aggressive.
Basically, instead of trying to check for specific kinds of statements,
just check the types of all local variables.

Also included are some commented-out proposals for some slightly more
aggressive lints which might be useful (but trigger a little too
frequently at the moment).
2015-10-23 14:43:44 -07:00
bors-servo
ff2c7bb47b Auto merge of #8137 - romankl:gh/8126, r=nox
Remove unnecessary rooting from `CSSStyleDeclaration`

This commit will replace calls to `self.owner.root()` with `self.owner` to avoid unnecessary rooting of JS elements objects.

Ref.- Issue: #8126

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8137)
<!-- Reviewable:end -->
2015-10-23 16:38:24 -05:00
bors-servo
e3bcf7bab7 Auto merge of #8091 - nox:cleanup-range, r=eefriedman
Remove Rc<T> usage from Range

I initially used this to correctly handle ranges when their respective containers
are mutated, to get weak references of Range objects. I now realise that the weak
references should be handled at a lower level, closer to the JS-managed object.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8091)
<!-- Reviewable:end -->
2015-10-23 16:00:00 -05:00
Roman Klauke
fe2401c566 Remove unnecessary rooting from CSSStyleDeclaration
This commit will replace calls to `self.owner.root()` with `self.owner`
to avoid unnecessary rooting of JS elements objects.

Ref.- Issue: #8126
2015-10-23 20:27:15 +02:00
Rohan Prinja
fe59b62db7 make changes according to code review (#8097) 2015-10-24 01:42:22 +09:00
Ms2ger
970b8aa8bc Remove the unused default implementation of Reflectable::init_reflector. 2015-10-23 17:21:04 +02:00
Ms2ger
9be52dc41a Implement GlobalRef::reflector as an inherent method.
Reflectable is meant for actual DOM objects, not for references to them.
2015-10-23 17:20:17 +02:00
Ms2ger
8361d54a6e Cleanup some code in htmlcanvaselement.rs. 2015-10-23 16:55:12 +02:00
Axel Solis Trompler
2cb6972d14 Implement document.createEvent(TouchEvent) 2015-10-23 15:30:26 +02:00
bors-servo
4d737b51bb Auto merge of #8155 - Ms2ger:join, r=jdm
Remove Window::layout_join_port.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8155)
<!-- Reviewable:end -->
2015-10-23 04:50:38 -06:00
Anthony Ramine
a1b15d36c9 Remove Rc<T> usage from Range
I initially used this to correctly handle ranges when their respective containers
are mutated, to get weak references of Range objects. I now realise that the weak
references should be handled at a lower-level, closer to the JS-managed object.
2015-10-23 11:12:02 +02:00
Matt Brubeck
316802e206 Implement Document.createTouch 2015-10-22 10:49:30 -07:00
Matt Brubeck
fe7460f34d Dispatch touch events and perform default touch actions.
This is currently limited to simple single-touch actions. It does not include
momentum scrolling or pinch zooming.
2015-10-22 10:37:03 -07:00
Matt Brubeck
4ed15a8853 Add bindings for TouchEvent DOM interfaces 2015-10-22 10:35:11 -07:00
Ms2ger
1608450e4e Remove Window::layout_join_port.
It is only used in Window::force_reflow.
2015-10-22 16:12:59 +02:00
Ms2ger
2456ddf4ba Remove Window::handle_reflow_complete_msg and ScriptTask::handle_reflow_complete_msg.
Code on the script thread can only observe self.layout_join_port being Some()
between the time it is set in force_reflow, and the join_layout call later in
that function, and no significant code is called in that code.

Since these functions do nothing useful if layout_join_port is None, there is
no point in keeping them.
2015-10-22 16:12:58 +02:00
Ms2ger
7cd3870977 Inline Window::join_layout into its only caller.
I do not know if the FIXME comment is correct; I just copied it.
2015-10-22 16:12:57 +02:00
Ms2ger
9d739cf684 Remove layout_is_idle.
Code on the script thread can only observe self.layout_join_port being Some()
between the time it is set in force_reflow, and the join_layout call later in
that function, and no significant code is called in that code.

This implies that layout_is_idle will always return true, so there is no
reason for the function to exist.
2015-10-22 16:12:56 +02:00
Ms2ger
af448374f9 Remove pointless join_layout calls.
Code on the script thread can only observe self.layout_join_port being Some()
between the time it is set in force_reflow, and the join_layout call later in
that function, and no significant code is called in that code.

As join_layout does nothing when called if self.layout_join_port is None,
these two calls are useless.
2015-10-22 16:12:55 +02:00
bors-servo
9a34decec2 Auto merge of #8086 - froydnj:premultiply-tables, r=jdm
add (un)premultiply tables for canvas {Get,Put}ImageData operations

Pretty straightforward use of lookup tables to replace a bunch of expensive float operations.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8086)
<!-- Reviewable:end -->
2015-10-21 17:48:49 -06:00
bors-servo
af6a64e176 Auto merge of #7761 - fiji-flo:input_caret, r=pcwalton
display input caret for textarea. fixes #7758

This adds the input caret for textareas. Although, it does not handle multiline textareas correctly. The caret gets displayed for each line.

I'll look into that but that will take more time. Some feedback on this small patch would be appreciated though.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7761)
<!-- Reviewable:end -->
2015-10-21 15:23:52 -06:00
Florian Merz
80e8a674e2 display input caret for textarea. fixes #7758 2015-10-21 22:38:23 +02:00
Matt Brubeck
e9f9eaa61c Fix type in MutHeap docs 2015-10-21 12:27:04 -07:00
bors-servo
50ec235384 Auto merge of #8042 - bholley:dirty_siblings, r=pcwalton
Remove HAS_DIRTY_SIBLINGS.

This isn't doing anything right now, and we're not even setting it properly
in dirty_impl the |dirty_subtree(self)| was causing us to hit the skip case
for step 3.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8042)
<!-- Reviewable:end -->
2015-10-21 12:18:02 -06:00
Rohan Prinja
d9f8f68615 add equal() methods for comparisons with other types 2015-10-22 03:05:13 +09:00
Bobby Holley
228eff7272 Remove HAS_DIRTY_SIBLINGS.
This isn't doing anything right now, and we're not even setting it properly
in dirty_impl the |dirty_subtree(self)| was causing us to hit the skip case
for step 3.
2015-10-21 09:56:07 -07:00
bors-servo
3342cd9531 Auto merge of #8132 - akiss77:codegen-u8, r=Ms2ger
Fix char types in script binding codegen

Use `libc::c_char` instead of `i8` for character data since that's more
portable. (Some architectures, e.g. AArch64, have unsigned characters,
i.e. `u8`.)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8132)
<!-- Reviewable:end -->
2015-10-21 10:44:14 -06:00
Rohan Prinja
5e8dc366de in PartialEq impls, use Self instead of explicitly naming the struct type 2015-10-22 01:05:48 +09:00
bors-servo
2de5407cda Auto merge of #7450 - benschulz:constellation-timer, r=jdm
Ordering guarantees for timers

This is an rough solution to the issue described in #3396. XHRs still do their own thing and an overall clean up is in order. Before I do that, though, I'd really like someone to sign off on the overall idea.

There's one major difference to what jdm layed out #3396: The timers remain with the window/worker and only the earliest expiring one is coordinated with the dedicated timer thread.
That means both the timer thread and the window/worker have to keep track of which timer expires next, which feels a bit wonky. However, the upshot is that there's no need for communication with the timer thread when a pipeline is frozen, thawed or dropped.

Most relvant parts are
 - the [`TimerScheduler`](6f5f661958 (diff-74137a6f50ab38e7a1e4d16920a66ce7R73)), which is the new per-constellation timer task and
 - the [`ActiveTimers`](6f5f661958 (diff-86707d952414a2860b78bcf6c1db8e2eR34)) which is what's left on the window/worker side.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7450)
<!-- Reviewable:end -->
2015-10-21 09:07:30 -06:00
benshu
553a0dbefd Timers are scheduled by a dedicated per-constellation thread. 2015-10-21 16:40:49 +02:00
bors-servo
252e73ff9b Auto merge of #8115 - nerith:canvas, r=jdm
Don't require the CanvasFillOrStrokeStyle enum to be public

CanvasFillOrStrokeStyle is only used in a single file,
so it does not need to be a public enum.

Fixes #8105.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8115)
<!-- Reviewable:end -->
2015-10-21 08:32:36 -06:00
Akos Kiss
8405ac70c9 Fix char types in script binding codegen
Use `libc::c_char` instead of `i8` for character data since that's more
portable. (Some architectures, e.g. AArch64, have unsigned characters,
i.e. `u8`.)
2015-10-21 14:31:07 +00:00
bors-servo
674589c370 Auto merge of #8041 - nox:castable, r=jdm
Introduce trait Castable

Removes all those messy FooCast structures in InheritTypes.rs.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8041)
<!-- Reviewable:end -->
2015-10-21 07:57:32 -06:00
Anthony Ramine
d0e022b64e Document the new inheritance machinery (fixes #8125) 2015-10-21 13:12:45 +02:00
Ms2ger
4e8033b739 Remove unused JS::assign. 2015-10-21 12:17:50 +02:00