Commit graph

671 commits

Author SHA1 Message Date
Simon Sapin
08066800cd Rename selector_matching.rs to stylist.rs 2016-11-20 15:29:09 +01:00
Lin Clark
9f49da9f55 Add tests for background shorthand parsing. 2016-11-18 14:03:53 -05:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
bors-servo
afc60bee28 Auto merge of #14190 - Manishearth:cssom, r=SimonSapin
Immutable CSSOM

This PR is intended to add basic support for all CSSOM interfaces, with the ability to index `document.styleSheets` and css rule lists, and serializing individual css rules. Handling individual interface methods for CSSRule subclasses can probably be done with easy/medium bugs.

Mutation safety isn't dealt with here; if the css rule list is mutated the CSSOM will be in an inconsistent state. I intend to deal with this via zero sized tokens, see https://groups.google.com/forum/#!topic/mozilla.dev.servo/AnxJoVmtMXQ .  I'll handle that when I start making the CSSOM mutable. (Getting the immutable bit landed first opens this up for easy bugs)

This doesn't really change style aside from adding an extra arc in the CSS rule list as discussed in the linked thread. So far this same design can be used by stylo as well when the time comes.

f? @SimonSapin @emilio

cc @upsuper

part of #11420
Todo:

 - [x] Stubs for rest of the CSSRule subclasses
 - [x] <s>ToCSS impls for CSSRules.</s> May make into easy bugs and stub out in this PR https://github.com/servo/servo/issues/14195
 - [x] Cache CSSStyleSheet on the relevant node

<!-- 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/14190)
<!-- Reviewable:end -->
2016-11-16 15:05:59 -06:00
bors-servo
00f229d615 Auto merge of #14188 - AgostonSzepessy:text-emphasis-position, r=SimonSapin
Added parsing/serialization for text-emphasis-position

Implemented parsing/serialization for text-emphasis-position

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #13850
- [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/14188)
<!-- Reviewable:end -->
2016-11-16 07:59:55 -06:00
Agoston Szepessy
c4a9f72fc5 Added parsing/serialization for text-emphasis-position 2016-11-15 23:34:47 -05:00
Manish Goregaokar
2fe390e237 Allow mutation of CssRules 2016-11-15 08:49:58 -08:00
Manish Goregaokar
177d6fa4ee Support basic immutable CSSOM 2016-11-15 06:56:18 -08:00
bors-servo
e9fa69bb2d Auto merge of #14189 - canaltinova:border-image-shorthand, r=Manishearth
Implement border-image shorthand

<!-- Please describe your changes on the following line: -->
Implementation of border-image shorthand.
r? Manishearth

---
<!-- 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/14189)
<!-- Reviewable:end -->
2016-11-14 11:17:54 -06:00
Ms2ger
56dd6417e6 Remove the network.http.redirection-limit preference.
The Fetch standard defines this value as twenty; there is no good reason to
allow changing that at runtime.
2016-11-14 14:44:08 +01:00
bors-servo
b63c85c31b Auto merge of #14199 - 11Takanori:CSSRule_to_CssRule, r=nox
Update CSSRule naming from 'CSSRule' to 'CssRule'

<!-- Please describe your changes on the following line: -->
Update CSSRule naming from 'CSSRule' to 'CssRule'

---
<!-- 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 https://github.com/servo/servo/issues/14196 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because I just rename CSSRule to CssRule.

<!-- 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/14199)
<!-- Reviewable:end -->
2016-11-14 03:36:37 -06:00
bors-servo
3959817424 Auto merge of #14104 - iamrohit7:scroll-snap-type, r=Manishearth,waffles
Adds scroll-snap-type shorthand property

<!-- Please describe your changes on the following line: -->
Follow up to #14017

---
r=Manishearth
<!-- 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 `scroll_snap_type::should_serialize_to_single_value_if_sub_types_are_equal`, `scroll_snap_type::should_serialize_to_empty_string_if_sub_types_not_equal`

<!-- 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/14104)
<!-- Reviewable:end -->
2016-11-14 01:51:07 -06:00
Manish Goregaokar
c387eff065 Fix single_value_to_css 2016-11-13 23:50:50 -08:00
Takanori Ishibashi
72c83c9394 CSSRule -> CssRule 2016-11-14 16:41:25 +09:00
Rohit Burra
bdedcb9eb4 Adds scroll-snap-type shorthand property, tests 2016-11-14 12:08:49 +05:30
Nazım Can Altınova
e408b0e75c Add parsing tests for border-image shorthand 2016-11-13 19:25:05 +03:00
bors-servo
a2689f2a0e Auto merge of #14163 - servo:fetch-unit-http, r=metajack
Rewrite some http unit tests with fetch.

<!-- 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/14163)
<!-- Reviewable:end -->
2016-11-12 00:01:10 -06:00
Artem Biryukov
9564673b5a Fix related to #14101
Add Parse trait implementation for some structures
2016-11-12 05:26:15 +03:00
bors-servo
e3f07dfa16 Auto merge of #14156 - frewsxcv:cors-capitalization, r=KiChjang
Update CORS naming from 'CORS' to 'Cors'.

As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.

<!-- 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/14156)
<!-- Reviewable:end -->
2016-11-10 14:43:36 -06:00
bors-servo
d8a0a00032 Auto merge of #14127 - servo:response-new-url, r=nox
Make Response::url private.

<!-- 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/14127)
<!-- Reviewable:end -->
2016-11-10 09:19:52 -06:00
Ms2ger
15b55c3231 Make Response::url private. 2016-11-10 13:18:43 +01:00
Emilio Cobos Álvarez
5f2e7af864
style: Centralize specified url value handling, and refcount urls. 2016-11-10 13:15:21 +01:00
Ms2ger
65602de403 Add a successful test for a redirect loop. 2016-11-10 13:13:31 +01:00
Ms2ger
581c6dfe1b Rewrite test_load_errors_when_there_a_redirect_loop. 2016-11-10 12:57:19 +01:00
Ms2ger
bced313c47 Rewrite test_load_sets_default_accept_encoding_to_gzip_and_deflate. 2016-11-10 11:34:48 +01:00
Ms2ger
195774436b Rewrite test_load_uses_explicit_accept_encoding_from_load_data_headers. 2016-11-10 11:32:31 +01:00
Ms2ger
e12a6d7f4e Rewrite test_load_sets_default_accept_to_html_xhtml_xml_and_then_anything_else. 2016-11-10 11:26:54 +01:00
Ms2ger
6319d7cb99 Rewrite test_load_uses_explicit_accept_from_headers_in_load_data. 2016-11-10 11:22:23 +01:00
Ms2ger
5a02586341 Rewrite test_load_sets_content_length_to_length_of_request_body. 2016-11-10 11:18:22 +01:00
Ms2ger
c229a0116e Rewrite test_when_cookie_received_marked_secure_is_ignored_for_http. 2016-11-10 11:06:23 +01:00
Ms2ger
982c59662c Rewrite test_cookie_set_with_httponly_should_not_be_available_using_getcookiesforurl. 2016-11-10 11:06:22 +01:00
Ms2ger
52258e2282 Rewrite test_load_sends_cookie_if_nonhttp. 2016-11-10 11:01:08 +01:00
Ms2ger
f1f090ca81 Rewrite test_load_sets_requests_cookies_header_for_url_by_getting_cookies_from_the_resource_manager. 2016-11-10 11:01:07 +01:00
Ms2ger
5bf90c563c Rewrite test_load_sets_cookies_in_the_resource_manager_when_it_get_set_cookie_header_in_response. 2016-11-10 11:01:05 +01:00
bors-servo
89c46369a2 Auto merge of #14151 - servo:assert_cookie_for_domain, r=jdm
Clarify assert_cookie_for_domain.

<!-- 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/14151)
<!-- Reviewable:end -->
2016-11-10 02:29:44 -06:00
Xidorn Quan
5dfcb07f6a Allow empty media query list
And make empty list the default value of MediaList.

This commit also removes Option wrapper of Stylesheet.media because
a stylesheet should always have an associated media query list.
2016-11-10 17:42:16 +11:00
Corey Farwell
bf8752ac9e Update CORS naming from 'CORS' to 'Cors'.
As per:

https://aturon.github.io/style/naming/README.html#general-conventions-[rfc-#430]

Acronyms should be considered one word and not all caps.
2016-11-09 18:30:30 -05:00
Ms2ger
2744227e13 Rewrite test_load_doesnt_add_host_to_sts_list_when_url_is_http_even_if_sts_headers_are_present. 2016-11-09 17:51:17 +01:00
Ms2ger
f03a6001de Rewrite test_load_doesnt_send_request_body_on_any_redirect.
Note that it is necessary to use POST here; using GET will cause an error in
hyper, which enforces the rule that GET requests don't have a body.
2016-11-09 17:51:15 +01:00
Ms2ger
ba86d8576d Rewrite test_load_should_decode_the_response_as_gzip_when_response_headers_have_content_encoding_gzip. 2016-11-09 17:51:13 +01:00
Ms2ger
4fe105b8e1 Rewrite test_load_should_decode_the_response_as_deflate_when_response_headers_have_content_encoding_deflate. 2016-11-09 17:51:12 +01:00
Ms2ger
90dd7c922a Rewrite test_load_when_redirecting_from_a_post_should_rewrite_next_request_as_get. 2016-11-09 17:51:11 +01:00
Ms2ger
d31188f5a9 Clarify assert_cookie_for_domain. 2016-11-09 15:36:53 +01:00
bors-servo
9d1c1f434d Auto merge of #14138 - servo:fetch-context, r=KiChjang
Pass a borrowed fetch context to fetch().

<!-- 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/14138)
<!-- Reviewable:end -->
2016-11-08 23:40:38 -06:00
Ms2ger
234b47e33e Pass a borrowed fetch context to fetch().
This will allow inspecting its state after fetching in unit tests.
2016-11-08 18:01:23 +01:00
Ms2ger
00e23a4c57 Rewrite test_redirected_request_to_devtools. 2016-11-08 16:15:22 +01:00
Ms2ger
9b1e153b31 Rewrite test_request_and_response_message_from_devtool_without_pipeline_id. 2016-11-08 11:44:39 +01:00
Ms2ger
42f6e9a8e6 Rewrite test_request_and_response_data_with_network_messages. 2016-11-08 11:37:42 +01:00
Ms2ger
06567e1d5b Rewrite test_load_when_request_is_not_get_or_head_and_there_is_no_body_content_length_should_be_set_to_0. 2016-11-08 09:52:22 +01:00
bors-servo
56b4065ee8 Auto merge of #14121 - upsuper:medialist, r=Wafflespeanut
Rename media_queries::MediaQueryList to MediaList

<!-- Please describe your changes on the following line: -->
`MediaList` is the name of the interface for "collection of media queries" used in [CSSOM spec](https://drafts.csswg.org/cssom/#the-medialist-interface), `MediaQueryList` happens to mean something different in [CSSOM View spec](https://drafts.csswg.org/cssom-view/#the-mediaquerylist-interface), which also leads to naming conflict in dom code. So I think it's better renaming it to `MediaList`.

---
<!-- 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: -->
- [ ] 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/14121)
<!-- Reviewable:end -->
2016-11-08 01:46:40 -06:00