Commit graph

5277 commits

Author SHA1 Message Date
Simon Sapin
adb97d4cbe Wrap most CSS rules in Locked<_> instead of RwLock<_> 2017-03-19 22:30:36 +01:00
Simon Sapin
f35b4e27b3 Replace RwLock<CssRules> with Locked<CssRules> 2017-03-19 22:30:35 +01:00
Simon Sapin
b213daaa88 Tidy 2017-03-19 22:30:34 +01:00
Simon Sapin
600152bd00 Replace more RwLock<MediaList> with shared_lock::Locked<MediaList> 2017-03-19 22:30:34 +01:00
Simon Sapin
fe4e70c5f8 Introduce a ToCssWithGuard trait 2017-03-19 22:30:33 +01:00
Simon Sapin
c5a7294e05 Replace RwLock<MediaList> with shared_lock::Locked<MediaList> 2017-03-19 22:30:31 +01:00
Bobby Holley
97dd3a1b08 Box more specified values to bring SpecifiedValue/PropertyDeclaration sizes down to 24/32 bytes.
MozReview-Commit-ID: xstAfjVQqi
2017-03-17 22:18:19 -07:00
Alan Jeffrey
6bcb5f68be Implement dissimilar-origin window.parent and window.top. 2017-03-17 10:53:20 -05:00
Anthony Ramine
0d904e387e Properly coalesce whitespace when given a reference child (fixes #15979) 2017-03-17 11:40:03 +01:00
bors-servo
47f0b4155c Auto merge of #15987 - nox:h5e, r=Ms2ger
Fix a couple of HTML parsing issues

<!-- 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/15987)
<!-- Reviewable:end -->
2017-03-16 17:36:00 -07:00
bors-servo
0a747e23c6 Auto merge of #15966 - mbrubeck:any, r=emilio
Bug 1340683 - stylo: Implement the :-moz-any pseudo-class

Adds support for the non-standard [:-moz-any](https://developer.mozilla.org/en-US/docs/Web/CSS/:any) selector.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1340683
- [x] These changes do not require tests because they are gecko-only

<!-- 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/15966)
<!-- Reviewable:end -->
2017-03-16 16:19:12 -07:00
bors-servo
e62d029ed6 Auto merge of #15906 - mchv:mchv-safe-browsing-context, r=asajeffrey
Access browsing context safely

Current browsing context accessor in `Document` unwraps the browsing context `Option` which prevents document to handle correctly the case when there is no browsing context.

This is the reason servo panics with `session-history.max-length=1` (https://github.com/servo/servo/issues/15877).

As it is my first contribution, I added a `safe` method to retrieve the browsing context rather than change the existing method, but I am happy to change if you think this is the right approach. I did not as well replace all existing method call to the `safe` method, to focus on fixing the issue.

If someone can give me a bit of guidance for the test, I will try to contribute one.

---
<!-- 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
- [ ] `./mach test-tidy` does not report any errors
- [X] These changes fix #15877.
- [ ] 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/15906)
<!-- Reviewable:end -->
2017-03-16 15:41:07 -07:00
Bobby Holley
8cf331a498 Rearrange PropertyDeclaration to avoid embedding DeclaredValue.
From https://bugzilla.mozilla.org/show_bug.cgi?id=1347719

This effectively combines the discriminants of the two enums and reduces the
size of PropertyDeclaration by one word.

MozReview-Commit-ID: 9rCRiSVZTQT
2017-03-16 14:40:55 -07:00
Matt Brubeck
2872c8bfab Bug 1340683 - stylo: Implement the :-moz-any pseudo-class 2017-03-16 11:44:47 -07:00
Anthony Ramine
6b43624a71 Properly handle annotation-xml integration points (fixes #15980) 2017-03-16 16:35:38 +01:00
Alan Jeffrey
f05577cb29 Disabled tinyfiledialogs when running headless. 2017-03-16 08:48:33 -05:00
Alan Jeffrey
f9c5d0c117 Implement dissimilar-origin postMessage. 2017-03-15 14:57:25 -05:00
bors-servo
ed98cb9c0a Auto merge of #15938 - servo:form-owner, r=nox,jdm
Implement the form owner concept

<!-- 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/15938)
<!-- Reviewable:end -->
2017-03-15 09:16:08 -07:00
Mukilan Thiyagarajan
38a61712e4 Implement the form owner concept 2017-03-15 16:39:55 +01:00
bors-servo
e600e0495c Auto merge of #15536 - asajeffrey:script-document-domain-setter, r=nox
Implement setter for document.domain

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

This PR implements the setter for `document.domain`.

It builds on #15438 and #15478, only the last commit is part of this PR.

It includes tests for similar-origin security checks.

---
<!-- 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 #934.
- [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/15536)
<!-- Reviewable:end -->
2017-03-15 08:35:41 -07:00
Alan Jeffrey
5348b63e38 Implement setter for document.domain 2017-03-15 10:34:23 -05:00
bors-servo
5bfa87a8e2 Auto merge of #15821 - montrivo:ImDataConstructors, r=Ms2ger
Implement ImageData constructors #15671 -- 1

<!-- Please describe your changes on the following line: -->
Implement ImageData constructors
* new constructors in the imagedata.rs file
* modification of the ImageData::new method
* new method ImageData::from_vec
* new wpt test file imagedata.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
- [X] These changes affect #15671  (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/15821)
<!-- Reviewable:end -->
2017-03-15 02:23:48 -07:00
montrivo
46a25d621c Implement ImageData constructors #15671 2017-03-14 23:16:17 +01:00
Alan Jeffrey
1f61a549a3 Added some same-origin-domain checks. 2017-03-14 14:36:03 -05:00
Mariot Chauvin
f8c7235f73 Access browsing context without panic
Current browsing context accessor in Document unwrap the browsing context option which prevents document to handle correctly the case when there is no browsing context.
2017-03-14 14:18:56 +00:00
Emilio Cobos Álvarez
b4de69e3eb
style: Avoid cloning all over the error reporter. 2017-03-14 00:49:18 +01:00
lucantrop
d6568e608b removed instances of -> () in existing code 2017-03-13 17:38:33 +01:00
bors-servo
94c344a014 Auto merge of #15882 - ak1t0:clean-up-htmlimageelement, r=Ms2ger
Clean up HTMLImageElement::areas

<!-- 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 #15835 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because github issue says no tests needed.

<!-- 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/15882)
<!-- Reviewable:end -->
2017-03-13 07:47:56 -07:00
bors-servo
d70c1e53ae Auto merge of #15874 - sendilkumarn:user-script, r=nox
apply user scripts correctly

<!-- 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 #15082

<!-- 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/15874)
<!-- Reviewable:end -->
2017-03-13 07:01:52 -07:00
SendilKumar N
5b25cb3345 apply user scripts correctly
replace to utf8_lossy
2017-03-13 21:57:50 +08:00
ak1t0
ad1e4475af Clean up HTMLImageElement::areas 2017-03-13 21:52:04 +09:00
Hugh Gallagher
97e7c6be29 Change while loop in HTMLImageElement::handle_event to for loop
Remove trailing whitespace
2017-03-10 13:48:35 +00:00
bors-servo
dc3b32c853 Auto merge of #15861 - projektir:make-text-decoration-testable, r=Wafflespeanut
Make text decoration testable and do not serialize initial text-decoration-style

Servo now uses the same name for the text-decoration-line longhand property as Gecko. This was done to enable testing of the text-decoration shorthand.

The text-decoration shorthand has been fixed to not serialize initial text-decoration-style.

---

- [x ] `./mach build -d` does not report any errors
- [x ] `./mach test-tidy` does not report any errors
- [x ] These changes fix #15790

---

- [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/15861)
<!-- Reviewable:end -->
2017-03-08 21:39:30 -08:00
projektir
b4c50de31e Don't serialize initial text-decoration-style #15790 2017-03-09 00:33:17 -05:00
bors-servo
f90fc2fa88 Auto merge of #15771 - jdm:img-panic, r=nox
Improve behaviour of image elements that perform multiple requests

This addresses cases where image elements end up making multiple requests, as well as makes the element respond to additional relevant mutations that trigger updating the image data.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15709 (github issue number if applicable).
- [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/15771)
<!-- Reviewable:end -->
2017-03-08 04:28:58 -08:00
Simon Sapin
f70a49974a Make PropertyDeclarationBlock fields private 2017-03-07 23:37:32 +01:00
Simon Sapin
da4e5146e9 Make PropertyDeclarationBlock::important_count private. 2017-03-07 23:37:31 +01:00
Simon Sapin
9d663ea7af Make PropertyDeclaration::parse return an enum rather than push to a Vec. 2017-03-07 23:37:29 +01:00
bors-servo
b11847d86c Auto merge of #15837 - upsuper:bug1344135, r=emilio
Return true in set_property only when declaration block is changed

This is [bug 1344135](https://bugzilla.mozilla.org/show_bug.cgi?id=1344135).

<!-- 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/15837)
<!-- Reviewable:end -->
2017-03-07 13:51:33 -08:00
bors-servo
f85c8ef744 Auto merge of #15855 - ferjm:IframeLoadEventSteps, r=Ms2ger
s/IframeLoadEventSteps/IFrameLoadEventSteps/g

All the other IFrame* names have the capital "I" and capital "F", so I'm changing this to keep uniformity.

- [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).
- [ ] These changes do not require tests because it's just a name change and the code is already tested.

<!-- 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/15855)
<!-- Reviewable:end -->
2017-03-07 09:38:44 -08:00
Fernando Jiménez Moreno
9a5268d757 s/IframeLoadEventSteps/IFrameLoadEventSteps/g 2017-03-07 18:33:02 +01:00
Anthony Ramine
57291e5609 Remove obsolete step from Text::SplitText
https://github.com/whatwg/dom/pull/419
2017-03-07 13:31:22 +01:00
bors-servo
b66839367c Auto merge of #15833 - sendilkumarn:mut-js-heap, r=nox
removing mutHeapJs references

<!-- 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 #15316

<!-- 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/15833)
<!-- Reviewable:end -->
2017-03-07 01:40:39 -08:00
SendilKumar N
2996d3a413 removing mutHeapJs references
changes as per comments
2017-03-07 17:37:44 +08:00
Josh Matthews
f79850754d Avoid marking image element as complete before its image data is available. 2017-03-07 14:02:46 +05:30
Josh Matthews
dc5335a21e Move checks for document completion to the end of the event loop.
This better reflects the text of the specification - rather than
queuing a task to dispatch the load evnet as soon as the document
loader is unblocked, we want to "spin the event loop until there
is nothing that delays the load event in the Document." Spinning
the event loop is a concept that requires running tasks
completely, hence we check the condition before returning to the
start of the event loop.
2017-03-07 14:02:42 +05:30
SendilKumar N
b6e6e84bcf ext. filtering for lang matching 2017-03-07 10:20:16 +08:00
Xidorn Quan
4f07826837 Return true in set_property only when declaration block is changed 2017-03-06 22:21:59 +11:00
Patrick Walton
4e7ac19380 script: Use a timer when rAF is used for non-animation purposes
After this patch, when the page calls `requestAnimationFrame()` too many
times in the row without actually mutating the DOM, further calls to
`rAF` will actually perform the moral equivalent of `setTimeout(16)`.
This saves a lot of CPU time compared to actually waiting for the
vertical blanking interval, because waiting for that requires us to draw
the page.

Reduces CPU usage drastically on nytimes.com, which has a perpetual
`requestAnimationFrame()` loop that checks whether ads are in view.
2017-03-03 23:25:29 +01:00
bors-servo
1b1fadb8b8 Auto merge of #15767 - charlesvdv:blob-close, r=nox
Remove support for Blob::{close, isClosed}

<!-- 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 #15660

<!-- 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/15767)
<!-- Reviewable:end -->
2017-03-03 02:16:51 -08:00