Commit graph

4995 commits

Author SHA1 Message Date
Alan Jeffrey
611f3b38a1 Remove reflow status from browsing context. 2017-01-12 15:06:31 -06:00
Ms2ger
e57b478710 Remove unused needsRooting field from JSToNativeConversionInfo. 2017-01-12 16:57:44 +01:00
bors-servo
eb72c0ec7b Auto merge of #14963 - jdm:script_current_line, r=asajeffrey
Report meaningful line numbers for inline script errors

Rebased from #14661.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12744 and partially #9604
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14963)
<!-- Reviewable:end -->
2017-01-11 18:11:52 -08:00
karenher
db2082bc6e Store parser's current line when script elements are created.
Use the newly stored line as the starting line number when
evaluating JS. This ensures that inline scripts will report
errors with meaningful line numbers.
2017-01-11 21:11:00 -05:00
bors-servo
68a8e1bf2b Auto merge of #14291 - fiji-flo:text-input-select, r=pcwalton
Position insertion point in input field with mouse

<!-- Please describe your changes on the following line: -->
Implements cursor positioning in input elements (text/password) via mouse. The related issue is #10083 but is only covered partly.
This PR does **not** cover:
* positioning in textarea elements via mouse
* text selection in input/textarea elements via mouse

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #10083 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because I can't think of a way to test mouse interaction in the current test pipeline.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14291)
<!-- Reviewable:end -->
2017-01-11 14:19:10 -08:00
bors-servo
783829eccc Auto merge of #14924 - ioctaptceb:webgl-blendFunc-tests, r=jdm
Webgl blend func tests

<!-- Please describe your changes on the following line: -->
Add a function that validates the conditions for [Constant Color Blend](https://www.khronos.org/registry/webgl/specs/latest/1.0/#CONSTANT_COLOR_BLEND) in the WebGL specs. ./mach run -r tests/wpt/web-platform-tests/webgl/conformance-1.0.3/conformance/misc/webgl-specific.html

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14924)
<!-- Reviewable:end -->
2017-01-11 13:23:08 -08:00
bors-servo
f6940f686c Auto merge of #13972 - shravan-achar:master, r=Manishearth,emilio,jdm
ImageMaps: Implemented support for parsing coord attribute to a shape…

<!-- Please describe your changes on the following line: -->

Image Maps: (Part 1) Implemented support for parsing coord attribute to a shape object.
                       Implemented a hit_test method to see if a point is within the area. Tests for constructors                      and hit_test included

---

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

… object in HTMLAreaElement

<!-- Reviewable:start -->

---

This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13972)

<!-- Reviewable:end -->
2017-01-11 12:25:46 -08:00
ioctaptceb
f3d65505e9 Add a check to BlendFunc for invalid constant
combinations
2017-01-11 20:59:03 +01:00
bors-servo
cfc74e2060 Auto merge of #14911 - charlesvdv:alternate-stylesheet, r=cbrewster
Handle properly alternate stylesheet

<!-- Please describe your changes on the following line: -->
Alternate stylesheet are now fetched and then desactivated instead of ignoring them.

I don't know if tests are required to check if the stylesheet is correctly loaded and disabled ?
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14881 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14911)
<!-- Reviewable:end -->
2017-01-11 10:34:04 -08:00
Anthony Ramine
30f0553ac7 Introduce PendingScript
This moves scripts' loading results in Document, instead of maintaining them
behind a DOMRefCell in each HTMLScriptElement.
2017-01-11 17:37:19 +01:00
Anthony Ramine
965370c0bf Rename ScriptOrigin to ClassicScript 2017-01-11 14:52:43 +01:00
Anthony Ramine
438182a7de Introduce Document::has_pending_parsing_blocking_script 2017-01-11 14:52:40 +01:00
bachar
980dde7e15 HTML image map support 2017-01-11 01:29:45 -08:00
Florian Merz
b40db5b55d Position insertion point in input field with mouse 2017-01-11 09:04:03 +01:00
Anthony Ramine
749ac42854 Do not pass an Option to Document::set_pending_parsing_blocking_script 2017-01-10 21:57:02 +01:00
bors-servo
c784bc6944 Auto merge of #14943 - nox:external-script-kind, r=jdm
Introduce ExternalScriptKind to simplify HTMLScriptElement::prepare

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14943)
<!-- Reviewable:end -->
2017-01-10 09:38:07 -08:00
Anthony Ramine
f2bdd159c7 Introduce ExternalScriptKind to simplify HTMLScriptElement::prepare 2017-01-10 18:16:07 +01:00
Ms2ger
36c14c9819 Fix some warnings. 2017-01-10 16:46:25 +01:00
Anthony Ramine
a64ed5dfbd Fix steps numbering of HTMLScriptExecute::prepare 2017-01-10 16:41:39 +01:00
charlesvdv
19e31d5c50 Handle properly alternate stylesheet 2017-01-10 15:38:38 +01:00
bors-servo
f54dd0112b Auto merge of #14928 - nox:insert, r=SimonSapin
Unify text insertion when parsing HTML and XML

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14928)
<!-- Reviewable:end -->
2017-01-10 03:51:47 -08:00
Anthony Ramine
d853e7fee9 Unify text insertion when parsing HTML and XML 2017-01-10 11:16:42 +01:00
bors-servo
b0a6808956 Auto merge of #14925 - servo:callback, r=jdm
Some cleanup around JS callbacks.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14925)
<!-- Reviewable:end -->
2017-01-09 21:09:57 -08:00
bors-servo
f1c82be0e6 Auto merge of #14868 - bd339:iss14068, r=jdm
Fix loss of response type information in Fetch API

<!-- Please describe your changes on the following line: -->
Avoids mapping response types that are distinct according to [the spec](https://fetch.spec.whatwg.org/#concept-response-type) to fewer response types. Also updates test expectations to match that we now pass tests that check the response type.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14068

<!-- Either: -->
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14868)
<!-- Reviewable:end -->
2017-01-09 18:36:38 -08:00
bors-servo
50bba770d6 Auto merge of #14789 - Manishearth:supports, r=SimonSapin
Support @supports

fixes #14786

cc @heycam @upsuper
r? @SimonSapin

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14789)
<!-- Reviewable:end -->
2017-01-09 10:54:38 -08:00
bors-servo
9482467add Auto merge of #14927 - servo:ImageData-data, r=jdm
Use the typed array APIs in ImageData.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14927)
<!-- Reviewable:end -->
2017-01-09 09:29:46 -08:00
bd339
0f1eb13e33 Don't lose information in Fetch API
Also update test expectations.
2017-01-09 14:52:14 +01:00
Ms2ger
63f0d3ecf5 Privatize some items in EventTarget. 2017-01-09 14:17:42 +01:00
Ms2ger
b8554abaa4 Expose CallbackObject more.
This will make it easier to use new fields added to it.
2017-01-09 14:17:41 +01:00
Ms2ger
2839bca065 Use the typed array APIs in ImageData. 2017-01-09 14:00:54 +01:00
Imanol Fernandez
c5705bff50 WebVR API Implementation, r=larsbergstrom 2017-01-09 12:44:39 +01:00
Ms2ger
11c21d3b1d Introduce CallbackObject::new(). 2017-01-09 09:47:34 +01:00
Ms2ger
aa93260f1e Change the order of code in callback.rs to make more sense. 2017-01-09 09:47:33 +01:00
bors-servo
8fff2f29d0 Auto merge of #14895 - dowoncha:request-websocket, r=jdm
Added Websocket to RequestMode enum

Added Websocket to RequestMode enum
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14785  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because matching the enum should have default control flow.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14895)
<!-- Reviewable:end -->
2017-01-08 08:57:52 -08:00
Dowon Cha
8bf924dc79 Added Websocket to RequestMode enum
set unreachable in dom/request.rs for websocket

fixed imports
2017-01-08 09:17:53 -05:00
bors-servo
87cce8180a Auto merge of #14648 - cynicaldevil:xmlhttpreq-send, r=KiChjang
Implemented XMLHttpRequest.send(Document)

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #9490 .

<!-- Either: -->
r? @KiChjang

`XMLHttpRequest/send-entity-body-document.htm` is not working atm, I get this output:
```
$ ./mach test-wpt tests/wpt/web-platform-tests/XMLHttpRequest/send-entity-body-document.htm
Running 1 tests in web-platform-tests

Ran 1 tests finished in 0.0 seconds.
  • 1 ran as expected. 1 tests skipped.
```
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14648)
<!-- Reviewable:end -->
2017-01-08 00:21:14 -08:00
Manish Goregaokar
62bea28031 Add CSS.supports() 2017-01-07 23:17:55 -08:00
Manish Goregaokar
b4a83b6cec CSSOM bits for @supports: CSSConditionRule and CSSSupportsRule, with conditionText attribute 2017-01-07 23:17:52 -08:00
bors-servo
f958dafcae Auto merge of #14865 - mrnayak:sri-fetch, r=jdm
Implement Subresource Integrity

Implemented response validation part of https://w3c.github.io/webappsec-subresource-integrity/.
Implemented step eighteen of the main fetch. If a request has integrity metadata, then following steps are performed
1) Wait for response body
2) If the response does not have a termination reason and response does not match request’s integrity metadata, set response and internalResponse to a network error.

Dependency updated: html5ever-atoms from 0.1.2 to 0.1.3. This will not completely fix #14523, It will implement changes related to response validation. Request validation algorithm implementation needs CSP.

I did not update any WPT-Test. In my local system, I found some assertion issue dependent on the order of execution of test-case. It would be helpful if someone could do "try" build on these changes to get wpt results.

r? @jdm
<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14865)
<!-- Reviewable:end -->
2017-01-07 23:14:37 -08:00
bors-servo
cdf14730ff Auto merge of #14712 - KiChjang:css-keyframe-rule-style, r=Manishearth
Implement CSSKeyframeRule.style

Fixes #14636.

r? @Manishearth

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14712)
<!-- Reviewable:end -->
2017-01-07 22:18:11 -08:00
Keith Yeung
18567ce7a8 Implement CSSKeyframeRule.style 2017-01-07 22:18:04 -08:00
mrnayak
a3026499f4 Implement Subresource Integrity
Implemented response validation part of
https://w3c.github.io/webappsec-subresource-integrity/.
Implemented step eighteen of the main fetch. If a request has integrity
metadata, then following steps are performed
*Wait for response body
*If the response does not have a termination reason and response does not
match request’s integrity metadata, set response to a
network error.# Please enter the commit message for your changes. Lines starting
2017-01-08 08:52:18 +05:30
Nikhil Shagrithaya
401836e8f0 Implemented XMLHttpRequest.send(Document) 2017-01-08 03:04:51 +05:30
bors-servo
f94ce71017 Auto merge of #14891 - prampey:bluetooth-cleanup, r=jdm,emilio
Cleaned up ripples due to MutJS to JS type change

<!-- Please describe your changes on the following line: -->
Changed all Mutable JS values to JS values in the following files and fixed any differences that might have been caused due to type change.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14649  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because minimal type changes made.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14891)
<!-- Reviewable:end -->
2017-01-07 12:01:21 -08:00
bors-servo
f313e8baff Auto merge of #14867 - nox:a-base-de-popopopop, r=metajack
Properly insert text in document when parsing

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14867)
<!-- Reviewable:end -->
2017-01-07 10:57:36 -08:00
Anthony Ramine
0cb09468a0 Properly insert text in document when parsing
If the last child of a node is a Text child and we are inserting text in that node,
we need to append it to that Text child. Doing that means that
HTMLStyleElement::children_changed gets called less frequently, but that's not a
problem during parsing thanks to the pop hook.
2017-01-07 19:21:02 +01:00
Anthony Ramine
8caa564540 Update xml5ever to 0.3.0 2017-01-07 18:10:30 +01:00
bors-servo
9087749030 Auto merge of #14883 - servo:null-bindings, r=SimonSapin
Avoid generating literal nulls in DOM bindings.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14883)
<!-- Reviewable:end -->
2017-01-07 06:33:30 -08:00
Prudhvi Rampey
29340b7adf Cleaned up ripples due to MutJS to JS type change 2017-01-07 01:16:02 +05:30
Ms2ger
baf4e17232 Avoid generating literal nulls in DOM bindings. 2017-01-06 14:24:13 +01:00