Commit graph

6147 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
39ab49823b
style: relax assertions in dom::element when setting selector flags.
Fixes #16409
2017-04-13 17:40:18 +08:00
bors-servo
bc9d7863b6 Auto merge of #16348 - ferjm:issue-14824-unminify-js, r=jdm
Unminify JS and dump it to a file before executing it

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

<!-- 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/16348)
<!-- Reviewable:end -->
2017-04-12 11:11:23 -05:00
Emilio Cobos Álvarez
ac7bc414d9
Bug 1325878: Pass the MediaList down to Servo, making <style media> work. r=xidorn
MozReview-Commit-ID: BUCSQJs2CNI
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 22:27:45 +08:00
Emilio Cobos Álvarez
2999222436
Bug 1325878: Don't use nsMediaList for loading imports. r=xidorn
MozReview-Commit-ID: HR23bqZcmcA
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 21:24:51 +08:00
bors-servo
69eda6a60c Auto merge of #16063 - methyl:image-usemap-panics, r=nox
Avoid panics for empty or multibyte image usemap

<!-- Please describe your changes on the following line: -->
Some check were added to make sure we can call `split_at` with no risk of panics (when value is empty or the first char is multibyte).

---
<!-- 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 #15883 (github issue number if applicable).
- [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/16063)
<!-- Reviewable:end -->
2017-04-12 07:34:27 -05:00
bors-servo
5f6c27bb94 Auto merge of #16373 - jryans:at-page-viewport-units, r=emilio
Stylo: Disable viewport units for @page

Reviewed by @emilio in [bug 1353191](https://bugzilla.mozilla.org/show_bug.cgi?id=1353191).

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- 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/16373)
<!-- Reviewable:end -->
2017-04-12 05:38:50 -05:00
Fernando Jiménez Moreno
11f227b4ff Inform about unminify errors and store unmodified version if js-beautify fails 2017-04-12 11:43:07 +02:00
J. Ryan Stinnett
1a31b87c22 Pass ParserContext down to lengths
To make it possible to check the rule type when parsing lengths, we need to pass
the `ParserContext` down through many layers to the place where length units are
parsed.

This change leaves it unused, so it's only to prepare for the next change.

MozReview-Commit-ID: 70YwtcCxnWw
2017-04-12 16:40:48 +08:00
J. Ryan Stinnett
4574cd8ea6 Pull rule_type into ParserContext
Absorb `rule_type` into the `ParserContext` so that it's easier to pass down to
deeper levels of the parser.

MozReview-Commit-ID: DjBNytLxGKX
2017-04-12 16:40:17 +08:00
bors-servo
45f20f0bd6 Auto merge of #15666 - clementmiao:keyboard_shortcuts, r=asajeffrey
added keyboard shortcuts for navigation inside text box

PR to implement keyboard shortcuts per issue #12278, r? jdm

Thanks for letting me help!
---
<!-- 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 #12278 (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/15666)
<!-- Reviewable:end -->
2017-04-12 03:01:16 -05:00
Fernando Jiménez Moreno
3ad473755c Unminify JS and dump it to a file before executing it 2017-04-12 09:17:52 +02:00
bors-servo
c8cd70f333 Auto merge of #16229 - tomhoule:fix-lengths, r=emilio
style: Do not immediately convert absolute specified lengths

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

This PR aims to solve issue #15729. I tried to follow the recommendations there as much as possible.

This is my first attempt at contributing to Servo, so this will probably need a lot of input, although I'm eager to make it as polished as possible.

- The base inaccuracy issue seems solved, as can be easily verified with the `console.log` based example in the issue.
- Very basic unit tests were added.

I have doubts mainly about the right way to represent these new enum variants for the various length units:

1. With new enum variants in `NoCalcLength` *and* newtypes (current solution)
2. With a `NoCalcLength::Absolute` variant that contains a new `AbsoluteLength` enum, but without newtypes
3. Same as solution 2 but with newtypes

- I mostly cared about unit tests until now but will investigate other types of tests
- Tests to check the clamping
- Write a proper commit message

Thanks for your time and feedback :)

---
<!-- 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 #15729.

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/16229)
<!-- Reviewable:end -->
2017-04-12 01:16:32 -05:00
Tom Houlé
7ecee05e4a Style: Do not immediately convert absolute specified lengths
The NoCalcLength::Absolute variant has been rewritten to accommodate
other units than Au with the new AbsoluteLength enum. This avoids loss
of precision for some operations.

The conversion from floating point absolute lengths to integer
application unit values adopts the same clamping limits as Gecko.
2017-04-12 11:51:57 +08:00
bors-servo
638e1dc40b Auto merge of #16325 - KiChjang:fix-formdata-wpt, r=cbrewster
Fix formdata-blob.htm

The other failure is a legitimate WPT bug, will fix upstream.

<!-- 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/16325)
<!-- Reviewable:end -->
2017-04-10 09:27:01 -05:00
Keith Yeung
912ac622e7 Follow the spec in giving blobs a 'blob' name attribute 2017-04-09 23:30:40 -07:00
bors-servo
80f6160580 Auto merge of #16315 - jryans:at-page-stylo, r=xidorn
Stylo: @page support

Reviewed by upsuper in https://bugzilla.mozilla.org/show_bug.cgi?id=1345206.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- 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/16315)
<!-- Reviewable:end -->
2017-04-09 21:47:59 -05:00
Keith Yeung
b5722e50bb Provide MIME type data for File in formdata::get_file 2017-04-09 17:34:16 -07:00
bors-servo
d77d752990 Auto merge of #16316 - Manishearth:stylo-threadsafe, r=emilio
stylo: Make font base size computation threadsafe

r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1351200

<!-- 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/16316)
<!-- Reviewable:end -->
2017-04-09 06:15:51 -05:00
Manish Goregaokar
e402c72d0e stylo: Store font metrics provider in thread local style context 2017-04-09 19:15:35 +08:00
Emilio Cobos Álvarez
53cad6227e
script: Map HTMLCanvasElement width and height attributes. 2017-04-09 18:15:53 +08:00
Emilio Cobos Álvarez
df29d02026
script: Remove now-unused function.
MozReview-Commit-ID: Cnw5dlczJxv
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-09 18:15:52 +08:00
Emilio Cobos Álvarez
0ea58d1ffa
style: Stop special-casing a few attributes for style sharing, and use a visitor to track dependencies.
Also, simplify all the pre-snapshot attribute hacks in the script and style
code.

MozReview-Commit-ID: 6c9ipeb7Tnr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-09 18:15:50 +08:00
J. Ryan Stinnett
f0e849cbd8 Servo parsing / serialization for @page
Adds basic parsing and serialization for @page rules in Servo.  It is handled
in the same manner as a regular style rule.

MozReview-Commit-ID: JRr3DDGcUIl
2017-04-09 17:49:14 +08:00
Emilio Cobos Álvarez
1b51324b66
Update string-cache. 2017-04-07 13:38:40 +02:00
bors-servo
8f2ceb41dd Auto merge of #16288 - nox:net, r=jdm
Kill ResourceGroup

<!-- 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/16288)
<!-- Reviewable:end -->
2017-04-07 05:53:31 -05:00
Anthony Ramine
9394469ede Kill Request::omit_origin_header 2017-04-07 12:52:50 +02:00
bors-servo
12a4cc875d Auto merge of #16297 - upsuper:stylo-servo-url, r=SimonSapin
Remove servo_url dependency for geckolib

It seems mod attr is not used for geckolib at all, and that is the only place where servo_url is still referenced for geckolib, so we can just remove it.

<!-- 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/16297)
<!-- Reviewable:end -->
2017-04-07 04:34:47 -05:00
Clement Miao
ea3c840983 new keyboard shortcuts inside text input 2017-04-07 01:05:13 -07:00
Xidorn Quan
817172ebc4 Remove servo feature from servo_url 2017-04-07 17:51:49 +10:00
Xidorn Quan
e07cf0a8da Remove servo feature from servo_config 2017-04-07 17:44:22 +10:00
Xidorn Quan
da901bd2dc Update cssparser in Cargo.toml. 2017-04-07 16:07:37 +10:00
bors-servo
c12b17d276 Auto merge of #15904 - sendilkumarn:image-area, r=jdm
making image element areas good at finding 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 #15884

<!-- 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/15904)
<!-- Reviewable:end -->
2017-04-05 08:49:22 -05:00
bors-servo
8e2a1477ae Auto merge of #16268 - jdm:tmp, r=jdm
Basic MutationObserver interface stubs

Rebase and squash of https://github.com/servo/servo/pull/16190.

<!-- 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/16268)
<!-- Reviewable:end -->
2017-04-05 01:56:16 -05:00
Sumit
107ac9ab56 Implement basic interface for MutationObserver and MutationRecord. 2017-04-05 01:52:38 -04:00
mckaymatt
63f9ad022f Add way to get c_void ptr or c_char from caller 2017-04-04 16:46:52 -04:00
SendilKumar N
31dafcc5f3 making image element areas good at finding areas
linting errors

replaced with map

fixes comments

moving to document

added test cases

linting and updating manifest

changing test cases

linting fixes

manifest update

linting fixes

splitting the test cases into two
2017-04-04 23:11:44 +08:00
Simon Sapin
c8b5b4a9bb Revert to per-process shared lock for author-origin stylesheets
Fixes https://github.com/servo/servo/issues/16097
Reopens https://github.com/servo/servo/issues/16027
2017-04-03 18:08:20 +02:00
bors-servo
c31ee6e300 Auto merge of #16214 - nox:net, r=emilio
Improve the net crate

<!-- 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/16214)
<!-- Reviewable:end -->
2017-04-03 07:47:38 -05:00
Xidorn Quan
2628ebe612 Use final url for updating stylesheet from @import rule. 2017-04-03 21:57:17 +10:00
Xidorn Quan
37585309e9 Use a UrlExtraData type alias to unify url handling logic. 2017-04-03 21:57:16 +10:00
Xidorn Quan
a097a293b5 Pass CSS loader to Servo for insertRule. 2017-04-03 21:18:09 +10:00
Anthony Ramine
cb2eb81208 Remove all internal mutability from Request 2017-04-03 12:39:07 +02:00
bors-servo
fac0d17fd6 Auto merge of #16224 - servo:valid-fontface, r=upsuper
Make the parser accept @font-face rules without font-family or src.

Fix #16165.

Also, it turns out that the CSSFontFaceRule IDL specified in the css-fonts spec is not web-compatible. Instead browsers implement a .style attribute like in CSSStyleRule: https://github.com/w3c/csswg-drafts/issues/825

This in turn requires preserving data about which descriptors were set or not (distinguishing unset from set to a value that happens to be the initial value), so this commit also makes every field `Option<_>`.

<!-- 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/16224)
<!-- Reviewable:end -->
2017-04-03 03:53:09 -05:00
Simon Sapin
61812d4d9d Make the parser accept @font-face rules without font-family or src.
Fix #16165.

Also, it turns out that the CSSFontFaceRule IDL specified in the
css-fonts spec is not web-compatible.
Instead browsers implement a .style attribute like in CSSStyleRule:
https://github.com/w3c/csswg-drafts/issues/825

This in turn requires preserving data about which descriptors
were set or not (distinguishing unset from set to a value that happens
to be the initial value),
so this commit also makes every field `Option<_>`.
2017-04-01 14:05:32 +02:00
bors-servo
449758ef5d Auto merge of #16096 - stshine:die-modify-style-die, r=emilio
Use Servo-specific pseudo elements for anonymous box and text

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

Use some fake pseudo elements to style servo-specific boxes in servo. Also, Since for nested inline elements non-inheritable properties are properly stored in the inline context of an inline fragment, so get
rid of them on the style using empty pseudo to do cascading.

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

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

<!-- 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/16096)
<!-- Reviewable:end -->
2017-04-01 06:02:08 -05:00
Pu Xingyu
951c050690 Use empty pseudo to cascade only inheritable properties for text
Since for nested inline elements non-inheritable properties are
properly stored in the inline context of an inline fragment, so get
rid of them on the style.
2017-04-01 14:05:11 +08:00
bors-servo
2ebddca592 Auto merge of #16210 - jdm:updatejs, r=Wafflespeanut
Update rust-mozjs to master.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16152
- [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/16210)
<!-- Reviewable:end -->
2017-04-01 00:05:56 -05:00
Josh Matthews
8cba0dff8b Update rust-mozjs to master. 2017-03-31 14:40:38 -04:00
bors-servo
82b0d5ad54 Auto merge of #15868 - servo:hyper, r=jdm
Update Hyper and OpenSSL

<!-- 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/15868)
<!-- Reviewable:end -->
2017-03-31 11:46:09 -05:00
ddh
e527c9a991 Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00