Commit graph

2325 commits

Author SHA1 Message Date
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
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
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
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
Anthony Ramine
68014af78e Clean up the cast calls 2015-10-21 11:40:34 +02:00
Anthony Ramine
13ea3ac413 Introduce trait Castable
This trait is used to hold onto the downcast and upcast functions of all
castable IDL interfaces. A castable IDL interface is one which either derives
from or is derived by other interfaces.

The deriving relation is represented by implementations of marker trait
DerivedFrom<T: Castable> generated in InheritTypes.

/^[ ]*use dom::bindings::codegen::InheritTypes::.*(Base|Cast|Derived)/ {
    /::[a-zA-Z]+(Base|Cast|Derived);/d
    s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g
    s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g
    s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g
    s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g
    /\{([a-zA-Z]+(Base|Cast|Derived))?\};$/d
    s/\{([a-zA-Z_]+)\};$/\1;/
}

s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.upcast::<\1>()/g
s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.upcast::<\1>()/g
s/\(([a-zA-Z]+)Cast::from_ref\)/\(Castable::upcast::<\1>\)/g

s/([a-zA-Z]+)Cast::from_root/Root::upcast::<\1>/g

s/([a-zA-Z]+)Cast::from_layout_js\(\&([a-zA-Z_.]+)\)/\2.upcast::<\1>()/g

s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.downcast::<\1>()/g
s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.downcast::<\1>()/g
s/\(([a-zA-Z]+)Cast::to_ref\)/\(Castable::downcast::<\1>\)/g

s/([a-zA-Z]+)Cast::to_root/Root::downcast::<\1>/g

s/([a-zA-Z]+)Cast::to_layout_js\(&?([a-zA-Z_.]+(\(\))?)\)/\2.downcast::<\1>()/g

s/\.is_document\(\)/.is::<Document>()/g
s/\.is_htmlanchorelement\(\)/.is::<HTMLAnchorElement>()/g
s/\.is_htmlappletelement\(\)/.is::<HTMLAppletElement>()/g
s/\.is_htmlareaelement\(\)/.is::<HTMLAreaElement>()/g
s/\.is_htmlbodyelement\(\)/.is::<HTMLBodyElement>()/g
s/\.is_htmlembedelement\(\)/.is::<HTMLEmbedElement>()/g
s/\.is_htmlfieldsetelement\(\)/.is::<HTMLFieldSetElement>()/g
s/\.is_htmlformelement\(\)/.is::<HTMLFormElement>()/g
s/\.is_htmlframesetelement\(\)/.is::<HTMLFrameSetElement>()/g
s/\.is_htmlhtmlelement\(\)/.is::<HTMLHtmlElement>()/g
s/\.is_htmlimageelement\(\)/.is::<HTMLImageElement>()/g
s/\.is_htmllegendelement\(\)/.is::<HTMLLegendElement>()/g
s/\.is_htmloptgroupelement\(\)/.is::<HTMLOptGroupElement>()/g
s/\.is_htmloptionelement\(\)/.is::<HTMLOptionElement>()/g
s/\.is_htmlscriptelement\(\)/.is::<HTMLScriptElement>()/g
s/\.is_htmltabledatacellelement\(\)/.is::<HTMLTableDataCellElement>()/g
s/\.is_htmltableheadercellelement\(\)/.is::<HTMLTableHeaderCellElement>()/g
s/\.is_htmltablerowelement\(\)/.is::<HTMLTableRowElement>()/g
s/\.is_htmltablesectionelement\(\)/.is::<HTMLTableSectionElement>()/g
s/\.is_htmltitleelement\(\)/.is::<HTMLTitleElement>()/g
2015-10-21 11:37:16 +02:00
Anthony Ramine
c77d3b965f Introduce IDLInterface::derives()
This method is given a DOMClass value and returns whether it derives from Self.

Interfaces with no descendants directly check whether the given DOMClass is the
same as their own.
2015-10-21 10:59:36 +02:00
Brandon Fairchild
60beb78bf3 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.
2015-10-21 00:25:44 -04:00
Brandon Fairchild
a0e2dfc913 Remove Button prefix from names of variants of ButtonType enum
Fixes #8106.
2015-10-20 22:36:37 -04:00
Adam Szopa
88991013ab Remove explicit lifetimes which can be elided. 2015-10-21 01:27:48 +02:00
Nathan Froyd
50b14e6670 add un-premultiply table for GetImageData
Fixes #6969.
2015-10-20 04:51:29 -04:00
bors-servo
25d3c2b655 Auto merge of #8095 - TileHalo:foo, r=Ms2ger
Removed unsafe from 'query_selector_iter'

Fixing #8078.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8095)
<!-- Reviewable:end -->
2015-10-20 01:13:49 -06:00
Leo Lahti
89e8a26539 Removed unsafe from 'query_selector_iter' 2015-10-20 09:11:06 +03:00
Anthony Ramine
57c423a931 Update URL-related interfaces and their tests up to spec
The URL spec recently changed and the variour "mixins" interfaces are gone,
this commit updates our code and WPT accordingly.

The new expected failures related to HTMLAnchorElement and HTMLAreaElement's
attributes are due to their moving to the HTMLHyperLinkElementUtils interface,
which is not anymore in a separate <script class=untested> element.
2015-10-19 21:05:07 +02:00
bors-servo
6111cf9ffc Auto merge of #7943 - pierrechevalier83:fix_issue_7941, r=Ms2ger
Clarify some code in do_create_interface_objects

rval.get() is believed to be always null upon entering this function.
This assumption is verified by the added assertion.
It makes more sense to move the block of code that was moved inside
the if statement which is the only place where it can be initialized.

Fixes #7941.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7943)
<!-- Reviewable:end -->
2015-10-19 09:37:03 -06:00
bors-servo
2e308e9ecc Auto merge of #8068 - martiansideofthemoon:my-code-fix, r=Manishearth
Implementing getAttributeNode() and similar methods

Attempting to solve #8066 Does it look good so far @Manishearth ?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8068)
<!-- Reviewable:end -->
2015-10-19 07:58:41 -06:00
bors-servo
1a376aa75d Auto merge of #8060 - nox:deref-js, r=Ms2ger
Implement Deref<Target=T> for JS<T> where T: Reflectable

We can only borrow `JS<T>` from rooted things, so it's safe to deref it.
The only types that provide mutable `JS<T>` things are `MutHeap<JS<T>>` and
`MutNullableHeap<JS<T>>`, which don't actually expose that they contain
`JS<T>` values.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8060)
<!-- Reviewable:end -->
2015-10-19 06:32:05 -06:00
KALPESH KRISHNA
3971b8ce27 Implementing getAttributeNode() and similar methods. 2015-10-19 16:14:43 +05:30
bors-servo
ff2151b8bb Auto merge of #7935 - bholley:eventstate_element, r=nox
Move event state from Node to Element

Just getting my feet wet with Rust here. Please feel free to nit the hell out of it stylistically and idiomatically. :-)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7935)
<!-- Reviewable:end -->
2015-10-19 02:47:21 -06:00
Anthony Ramine
6dc42dd1d6 Do not root XMLHttpRequest::upload 2015-10-19 09:37:09 +02:00
Anthony Ramine
d28de59e4a Return a reference in ServoHTMLParser::window() 2015-10-19 09:37:08 +02:00
Anthony Ramine
da06341578 Do not root ServoHTMLParser::document 2015-10-19 09:37:07 +02:00
Anthony Ramine
7c47a6b78e Do not root Sink::document 2015-10-19 09:37:06 +02:00
Anthony Ramine
b0d1ccdf5f Do not root Performance::timing 2015-10-19 09:37:05 +02:00
Anthony Ramine
17cd4202e7 Do not root ChildrenList::node 2015-10-19 09:37:04 +02:00
Anthony Ramine
b149e0c979 Do not root NodeIterator::root_node 2015-10-19 09:37:03 +02:00
Anthony Ramine
6849510526 Do not root NamedNodeMap::owner 2015-10-19 09:37:02 +02:00
Anthony Ramine
5889a75b10 Do not root Location::window 2015-10-19 09:37:01 +02:00
Anthony Ramine
dee3aecea1 Do not root HTMLScriptElement::parser_document 2015-10-19 09:37:00 +02:00
Anthony Ramine
e8f358d178 Do not root InputActivationState::checked_radio 2015-10-19 09:36:58 +02:00
Anthony Ramine
71dcabfad8 Do not root DOMTokenList::element 2015-10-19 09:36:57 +02:00