Commit graph

3170 commits

Author SHA1 Message Date
bors-servo
7ff7932a8c Auto merge of #9824 - danlrobertson:element1, r=asajeffrey
Add the scrollWidth and scrollHeight extensions to the element interface

Add the `scrollWidth` and `scrollHeight` extensions to the element interface. My goal was to create a method that encompassed getting `scrollWidth`, `scrollHeight`, `scrollTop`, and `scrollLeft`.

I also noted that `clientHeight` and `clientWidth` to not handle the root element and the body element correctly.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9824)
<!-- Reviewable:end -->
2016-03-12 00:19:24 +05:30
Daniel Robertson
16d2778ece Add scrollWidth/Height to element interface
Add the scrollWidth and scrollHeight extensions to the element
interface.
2016-03-11 18:22:16 +00:00
bors-servo
f2f6787189 Auto merge of #9930 - rebstar6:htmlclick, r=jdm
Remove activatable element filter within HTMLElement#click()

Address https://github.com/servo/servo/issues/6542

Ensure that click() calls are not limited to activatable elements. Also makes the isTrusted attribute false when synthetic click activation are called from a click() method (as per spec).

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9930)
<!-- Reviewable:end -->
2016-03-11 10:06:24 +05:30
bors-servo
eac68c523b Auto merge of #9905 - saurvs:master, r=ecoal95
Implement input.setSelectionRange

Fixes https://github.com/servo/servo/issues/9862.

Passes all tests for `input` in `tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html`.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9905)
<!-- Reviewable:end -->
2016-03-11 06:13:51 +05:30
Rebecca
d6678a184b Call synthetic_click_activation for all clicks
Moved synthetic_click_actiavtion out of Activatable trait so it can be
called by all elements (not just activatable). Calls appropriately
from click. Also updates the isdisabled check in click to check for all
types of elements
2016-03-10 14:43:33 -05:00
Saurav Sachidanand
a3d77790a6 Implement input.setSelectionRange 2016-03-10 19:54:21 +05:30
Keith Yeung
3f2cbf0025 Add task_source directory
Use DOMManipulationTaskSource whenever possible
2016-03-10 01:05:53 -05:00
bors-servo
fa93d3f467 Auto merge of #9796 - KiChjang:range-stringifier, r=jdm
Implement Stringifier for Range

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9796)
<!-- Reviewable:end -->
2016-03-10 07:35:06 +05:30
Keith Yeung
b32e859c3a Implement Stringifier for Range 2016-03-09 15:27:37 -05:00
bors-servo
b6e469cbde Auto merge of #9903 - servo:ref-filter-map, r=nox
Replace usage of deprecated std::cell::Ref::filter_map

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9903)
<!-- Reviewable:end -->
2016-03-08 08:52:45 +05:30
Simon Sapin
62034b956e Replace usage of deprecated std::cell::Ref::filter_map 2016-03-07 18:53:38 +01:00
Arpad Borsos
c880c97b1b rename deprecated utf16_units to encode_utf16 2016-03-07 16:14:04 +01:00
bors-servo
64fb09ca2d Auto merge of #9800 - Wafflespeanut:node_attrs, r=nox
fixed the last failing test in dom/nodes/attributes.html

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9800)
<!-- Reviewable:end -->
2016-03-05 21:32:46 +05:30
Ravi Shankar
aaf2888d0b Updated SupportedPropertyNames in NamedNodeMap to match spec 2016-03-05 17:21:01 +05:30
bors-servo
c37a086660 Auto merge of #9786 - peterjoel:fix_codegen_is_array_like, r=jdm
Fixed compile error in generated code, when webidl constructors have same number of args

One of the ways that generated code differentiates constructors is by comparing if the args are array-like. The generated code was calling a function `IsArrayLike` that no longer exists. I re-implemented it with a more rust-like naming scheme.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9786)
<!-- Reviewable:end -->
2016-03-04 15:14:20 +05:30
Jack Moffitt
2507bfb2cf Suppress reflows before RefreshTick or FirstLoad
This fixes a bug where partially loaded content is displayed to the user
before it should be, usually before stylesheets have loaded. This commit
supresses reflows until either FirstLoad or RefreshTick, whichever comes
first.

Unfortunately, hit_test and mouse_over did not do reflows if they were
necessary, and so by suppressing the initial spurious reflows, these
methods started to panic without a display list to query. This patch
also transforms these into queries similar to the other existing
queries.
2016-03-03 15:17:46 -07:00
Peter
3e78b54d46 Fixed compile error in generated code, when webidl constructors have same number of args
Edited test webidl to show issue, and fix
2016-03-03 20:21:48 +00:00
bors-servo
056a7cf1a2 Auto merge of #9715 - ecoal95:mousemove, r=mbrubeck
script: Fix MouseOver handling

Now we only query for the topmost node, and apply the hover state to all
of the parent elements.

This fixes things like #9705, where the hover state was applied only to
the children.

This also makes us more conformant with other browsers in the case of
taking in account margins and paddings.

For example, prior to this PR, when your mouse was over the inner
element, in the bottom part, `hover` styles didn't apply to the parent.

```html
<style>
div {
  padding: 10px;
  margin: 10px;
  height: 15px;
  background: blue;
}

div:hover {
  background: red;
}
</style>

<div>
  <div></div>
</div>
```

Fixes #9705

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9715)
<!-- Reviewable:end -->
2016-03-03 22:55:35 +05:30
bors-servo
46256b33ef Auto merge of #9825 - creativcoder:remove-contructor-xmldoc, r=KiChjang
removed XMLDocument constructor according to spec

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9825)
<!-- Reviewable:end -->
2016-03-03 17:41:03 +05:30
Rahul Sharma
f8cddf5a22 removed XMLDocument constructor according to spec 2016-03-03 17:01:33 +05:30
Emilio Cobos Álvarez
3662491d8f Refactor mouseover code to be more performant
This increases mouseover/out performance drastically on my machine.
2016-03-02 20:14:15 +01:00
Emilio Cobos Álvarez
48dee6413d script/layout: Refactor mouse_over since it now basically uses hit_test 2016-03-02 20:14:15 +01:00
Emilio Cobos Álvarez
c3786437a3 script: Fix mouseover/mouseout dispatching. 2016-03-02 20:01:41 +01:00
Emilio Cobos Álvarez
b1f0581637 script: Fix MouseOver handling
Now we only query for the topmost node, and apply the hover state to all
of the parent elements.

This fixes things like #9705, where the hover state was applied only to
the children.

This also makes us more conformant with other browsers in the case of
taking in account margins and paddings.

For example, prior to this PR, when your mouse was over the inner
element, in the bottom part, `hover` styles didn't apply to the parent.

```html
<style>
div {
  padding: 10px;
  margin: 10px;
  height: 15px;
  background: blue;
}

div:hover {
  background: red;
}
</style>

<div>
  <div></div>
</div>
```

Fixes #9705
2016-03-02 20:01:41 +01:00
bors-servo
9ceda7de50 Auto merge of #9837 - nox:deterministic-raf, r=mbrubeck
Use a BTreeMap for Document::animation_frame_list (fixes #9834)

The callbacks must stay ordered.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9837)
<!-- Reviewable:end -->
2016-03-02 21:24:38 +05:30
Anthony Ramine
1d87f61350 Use a BTreeMap for Document::animation_frame_list (fixes #9834)
The callbacks must stay ordered.
2016-03-02 16:53:06 +01:00
bors-servo
f895f87197 Auto merge of #9823 - gmalecha:canvas-rendering-context-2d-update-idl, r=jdm
updating the CanvasRenderingContext2D to match the spec

- fixes #9443

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9823)
<!-- Reviewable:end -->
2016-03-02 04:32:26 +05:30
Gregory Malecha
2c6636129d updating the CanvasRenderingContext2D to match the spec
- fixes #9443
2016-03-01 08:13:50 -08:00
Ms2ger
549f2669f0 Stop generating a parser.out file in the source. 2016-03-01 15:02:50 +01:00
bors-servo
00628704ca Auto merge of #9763 - Tangresh:i9725, r=nox
Implement value for DOMTokenList

Fixes #9725

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9763)
<!-- Reviewable:end -->
2016-03-01 08:34:21 +05:30
bors-servo
4bcdbe6d56 Auto merge of #8932 - rilut:add-elementfrompoint, r=nox
Implement Document#elementFromPoint

Related to #8666. I haven't implemented elementsFromPoint, because from my past discussion with jdm, [it's not good yet](dbfa25214b (commitcomment-14668959)) to implement elementsFromPoint because it may cause GC hazards.

By the way, I also have to include the test for this, right? I've found this [1]. So, is all I have to do is just to put this into `tests/wpt/web-platform-tests/cssom-view/elementFromPoint.html`?

[1] http://test.csswg.org/suites/cssom-view-1_dev/nightly-unstable/html/elementFromPosition.htm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8932)
<!-- Reviewable:end -->
2016-03-01 03:01:50 +05:30
Rizky Luthfianto
76678bbdae Implement Document#elementFromPoint 2016-03-01 02:23:07 +07:00
Dominik Menzi
b29b2d6d73 Implement value for DOMTokenList 2016-02-29 16:07:03 +01:00
bors-servo
7d4276b393 Auto merge of #9787 - nox:event-invoke, r=Ms2ger
Refactor dispatch_event according to the spec (fixes #9178)

Two new functions invoke and invoke_inner are introduced and some invariants documented.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9787)
<!-- Reviewable:end -->
2016-02-29 20:13:11 +05:30
Anthony Ramine
587963c6e3 Refactor dispatch_event according to the spec (fixes #9178)
Two new functions invoke and inner_invoke are introduced and some
invariants documented.
2016-02-29 10:42:09 +01:00
Anthony Ramine
4d2587d6c3 Rename various bindings in event dispatching 2016-02-29 10:42:06 +01:00
Anthony Ramine
fc2cf31d5a Return a Vec from EventTarget::get_listeners_for 2016-02-29 10:42:02 +01:00
Anthony Ramine
590316a468 Merge EventTarget::{get_listeners, get_listeners_for} 2016-02-29 10:41:57 +01:00
bors-servo
dfdeabf57d Auto merge of #9799 - nox:range-extractcontents, r=KiChjang
Fix step 14.2 of Range::ExtractContents

We need the last inclusive ancestor of start node that is not an inclusive ancestor
of end node, not the first that is an inclusive ancestor of it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9799)
<!-- Reviewable:end -->
2016-02-29 05:11:28 +05:30
Anthony Ramine
c0d79062b5 Fix step 14.2 of Range::ExtractContents
We need the last inclusive ancestor of start node that is not an inclusive ancestor
of end node, not the first that is an inclusive ancestor of it.
2016-02-29 00:19:18 +01:00
bors-servo
b3964a8958 Auto merge of #9797 - nox:range-insertnode, r=KiChjang
Fix step 1 of Range::InsertNode

The method needs to throw when trying to insert start node into range.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9797)
<!-- Reviewable:end -->
2016-02-29 04:18:06 +05:30
Anthony Ramine
c713734b48 Fix step 1 of Range::InsertNode
The method needs to throw when trying to insert start node into range.
2016-02-28 22:54:08 +01:00
Emilio Cobos Álvarez
3e36739e38 script: Fix remaining bugs from Range.deleteContents 2016-02-28 19:27:42 +01:00
bors-servo
be6940db59 Auto merge of #9793 - nox:range-deletecontents, r=ecoal95
Fix step 6 of Range::DeleteContents

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9793)
<!-- Reviewable:end -->
2016-02-28 20:21:51 +05:30
Anthony Ramine
0ac931a43e Fix step 6 of Range::DeleteContents 2016-02-28 04:57:10 +01:00
bors-servo
5b8041147d Auto merge of #9784 - servo:jdm-patch-1, r=Ms2ger
Fix some errors in the DOM documentation.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9784)
<!-- Reviewable:end -->
2016-02-28 01:42:47 +05:30
bors-servo
d5ce8f308f Auto merge of #9734 - nox:finish-event-dispatch, r=Ms2ger
Fix the "get the parent" loop when dispatching event (fixes #6733)

The DOM specification says:

> A document's get the parent algorithm, given an event, returns null
> if event's type attribute value is "load" or document does not have
> a browsing context, and the document's associated Window object
> otherwise.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9734)
<!-- Reviewable:end -->
2016-02-27 23:03:25 +05:30
Anthony Ramine
e70b520c1f Fix the "get the parent" loop when dispatching event (fixes #6733)
The DOM specification says:

A document's get the parent algorithm, given an event, returns null
if event's type attribute value is "load" or document does not have
a browsing context, and the document's associated Window object
otherwise.
2016-02-27 17:41:22 +01:00
bors-servo
4a7d234510 Auto merge of #9768 - jdm:add_disallowed_prefixes, r=jdm
disallow restricted XMLHttpRequest header prefixes

Rebased from #9376.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9768)
<!-- Reviewable:end -->
2016-02-27 22:09:46 +05:30
Josh Matthews
bec25a1759 Fix some errors in the DOM documentation. 2016-02-27 11:22:26 -05:00