Граф коммитов

60 Коммитов

Автор SHA1 Сообщение Дата
Nicolas Silva a58ba90d31 Bug 1567241 - Update to euclid 0.20. r=kvark, emilio.
Differential Revision: https://phabricator.services.mozilla.com/D38530

--HG--
extra : source : d65512e23a13164f540430ff0c85a1f2a147d8a0
2019-07-18 22:54:16 +02:00
Emilio Cobos Álvarez 1f4fecfcd2 Bug 1511811 - Use https for the MPL license URL.
Cherry-picks https://github.com/servo/servo/pull/22198
2018-12-03 08:43:48 -05:00
shindli 6c6e4a960d Backed out 13 changesets (bug 1511811) for Btup bustages
Backed out changeset d71cde918f43 (bug 1511811)
Backed out changeset 0ae2634de8e1 (bug 1511811)
Backed out changeset 53d1f5ca4099 (bug 1511811)
Backed out changeset 5a08148928ef (bug 1511811)
Backed out changeset da7816ec50ef (bug 1511811)
Backed out changeset 5fe23889cccc (bug 1511811)
Backed out changeset 800bc60c75a7 (bug 1511811)
Backed out changeset 2392d8199cd0 (bug 1511811)
Backed out changeset 7bc486fbd195 (bug 1511811)
Backed out changeset d2c997426108 (bug 1511811)
Backed out changeset ddd573878432 (bug 1511811)
Backed out changeset 29c8ec1559a4 (bug 1511811)
Backed out changeset f5851346109d (bug 1511811)

--HG--
rename : third_party/rust/darling_core/src/macros_private.rs => third_party/rust/darling_core/src/macros.rs
2018-12-03 15:39:11 +02:00
Emilio Cobos Álvarez 6359ab5223 Bug 1511811 - Use https for the MPL license URL.
Cherry-picks https://github.com/servo/servo/pull/22198
2018-12-03 08:15:21 -05:00
Emilio Cobos Álvarez 562ca1ee4d No bug - Fix or remove some unit tests that are not building.
Unit tests removed have WPT equivalents.

MozReview-Commit-ID: H3EyQVMicSG
2018-06-23 20:46:14 +02:00
Anthony Ramine 49a11036dc servo: Merge #19838 - Make ToCss' SequenceWriter not monomorphise like a maniac anymore (from servo:rm-sequence-writer-as-it-was); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: 6b2e5283c9e810ac316c203849b6ea25544a62c7

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : be769cfabdde7902aa33f0b06ebb47c1823353e7
2018-01-23 12:03:41 -06:00
Simon Sapin a869d43078 servo: Merge #19510 - Update some dependencies, remove heapsize from the build (from servo:heapsize); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 07bd84ecc8dc9ba56df873453696993118e18583

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 92be8729bbeadf778435c95878ddef5c3195879c
2017-12-08 07:49:54 -06:00
Tom Tromey 3ce1a2f082 servo: Merge #18276 - Use cssparser's new_with_line_number_offset (from tromey:cssparser-line-number-offset); r=SimonSapin
cssparser provides a way to set the initial line number on a
ParserInput.  This patch changes servo to use this facility, rather than
reimplement the same functionality itself.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #_N/A_ (github issue number if applicable).

- [ ] There are tests for these changes OR
- [x] These changes do not require tests because pre-existing tests cover this change.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4804e211e859c730c0d2a116296560c5cbe867ee

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 4860b2c0588b9ffc401588326046b77ee61517c8
2017-08-28 22:57:13 -05:00
Brad Werth 59bb5e96e7 servo: Merge #18024 - Rework MediaType to be an atom-based struct instead of an enum (from bradwerth:mediatypeAtom); r=emilio
MozReview-Commit-ID: 1Tfrs9PBkhA

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1371395
https://reviewboard.mozilla.org/r/163194/

---
<!-- 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 _____

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

Source-Repo: https://github.com/servo/servo
Source-Revision: faf5b1f797c243c5036973a191d3abae36de4138

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 16506c8cce172296f698807039dc36bbd759227e
2017-08-09 18:24:48 -05:00
Simon Sapin 4331d2478e servo: Merge #18025 - Update to cssparser 0.19, count line numbers during tokenization (from servo:line-counting); r=jdm
https://github.com/servo/rust-cssparser/pull/177

Also simplify the `ParseErrorReporter` trait a bit.

Source-Repo: https://github.com/servo/servo
Source-Revision: 845131c425ebd50eea2fe5bf6005b6c304664242

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : d24cb7526225e8393bbc0a90206cba0199f95798
2017-08-09 16:16:33 -05:00
Alan Jeffrey 05183c9656 servo: Merge #17499 - Fixed scaling artefacts in paint worklets caused by zoom and hidpi (from asajeffrey:script-paint-worklets-zoom); r=glennw
<!-- Please describe your changes on the following line: -->

This PR renders paint worklet canvases at the device pixel resolution, rather than the CSS pixel resolution.

It's a dependent PR, building on #17239, #17326 and #17364.

---
<!-- 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 #17454
- [X] These changes do not require tests because we don't run reftests with zoom enabled

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 9fcbeb3ca2ea0d11d4787c649e82918f7672694d

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 3ee9ba9b149697292aef4b26de022b90ab6f781e
2017-07-20 17:09:06 -07:00
Michael Partheil 3ff096ba27 servo: Merge #17775 - Replace all uses of the style::stylearc alias with servo_arc (from michael-p:rename-stylearc-to-servo-arc); r=emilio
The `stylearc` alias is left there temporarilly and will be removed completely in a later commit/PR where also `components/style/gecko/generated/structs_{debug|release}.rs` are re-generated (they still use the old alias).

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 31228c18499d1c7f68b6b64b559354c768e81215

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 4d7b64e8a000a80d9daf9b1a511682416f456ff5
2017-07-19 06:03:17 -07:00
Emilio Cobos Álvarez 4a61df03b0 servo: Merge #17590 - stylo: Fix StyleSheetInner/Stylesheet mapping (from emilio:gecko-inner); r=heycam
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1372041 and all the dependent/related issues.

Source-Repo: https://github.com/servo/servo
Source-Revision: 545a53ccadd3ca37330e1ee8ad0ca926af5c9c5a

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : ecdb2146ce21336de525d3873f7a6956a08ff6dc
2017-07-02 07:00:39 -07:00
Nicolas Silva 01a59cb89e servo: Merge #17184 - Bump euclid to 0.14.x (from nical:euclid-bump); r=SimonSapin
- [x] `./mach build -d` does not report any errors (kinda, need webrender published and Cargo.toml fixed up)
- [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
- [x] These changes do not require tests because it is a refactoring in which the difference is mostly a compile-time/strong-typing thing with no change to the logic.

Source-Repo: https://github.com/servo/servo
Source-Revision: 18653f69581693a5bae1ce4e350e78bc16159b08

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : ed1f193620a8c5ebbb70eea337bd519dfc5c18a1
2017-06-14 07:25:05 -07:00
Josh Matthews 1f87774d78 servo: Merge #16752 - Report more informative CSS errors (from jdm:css-parse-error); r=SimonSapin
This requires https://github.com/servo/rust-cssparser/pull/143 for the final commit. There's no better way to split that work up, unfortunately, and it's extremely easy to bitrot. I would appreciate if we could expedite reviewing this work.

This is the work necessary to enable https://bugzilla.mozilla.org/show_bug.cgi?id=1352669. It makes sense to merge it separately because it's so much effort to keep it up to date with the ongoing Stylo work.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

Source-Repo: https://github.com/servo/servo
Source-Revision: 061cb5f48e5c93a5decf39e530aea4a566e97341

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 683cf352b472110df4b28c191e8850763334134d
2017-06-09 14:31:48 -07:00
Anthony Ramine 688412e03b servo: Merge #17095 - Refactor a few CSS properties (from servo:derive-all-the-things); r=emilio
Source-Repo: https://github.com/servo/servo
Source-Revision: cd22fc6b902496d105f8003beaee5c8eb79e9669

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 5609a0b5bb04fc8b3bd8f2adbab6fd3f31b84165
2017-05-31 11:08:56 -05:00
Emilio Cobos Álvarez 6e97f119ed servo: Merge #17078 - stylo: Avoid restyling the whole document when adding stylesheets (from emilio:stylesheet-invalidation-scopes); r=heycam
This is for bug 1357583.

Source-Repo: https://github.com/servo/servo
Source-Revision: 939716a7bc2ba2fbd8dcfe8b64d2f61edfa99c95

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : b25a23978bde1dc6abdaaa9621eca4903152efd2
2017-05-29 14:19:16 -05:00
Fernando Jiménez Moreno 92572b43ec servo: Merge #16768 - Stylo: Bug 1355408 - add support for @-moz-document (from ferjm:bug1355408.mozdocument); r=xidorn
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

Link to the gecko bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1355408.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8bc20ee9ac90b56a21bee8c9d507bc4624ef5dc9

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 307c61b490fce69f1b559d25159009e75cc25be1
2017-05-09 05:54:07 -05:00
Bobby Holley f716af270a servo: Merge #16702 - Use a custom arc in the style system (from bholley:custom_arc); r=emilio
See https://bugzilla.mozilla.org/show_bug.cgi?id=1360889

Source-Repo: https://github.com/servo/servo
Source-Revision: 7b1006936a27232fb77fef5893cc141e66bb12b7

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 85baf2471e165666e2540cbcf4fbb55587e60f39
2017-05-02 20:01:10 -05:00
Anthony Ramine 3cebcd4d00 servo: Merge #16609 - Implement unitless length quirk (from nox:quirks); r=Manishearth,emilio
The Gecko side doesn't propagate its quirks mode yet.

Source-Repo: https://github.com/servo/servo
Source-Revision: d8bcc0db1aad26e007b7e2bdeda3cea4953c0db0

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 9dc47c4a8059e1788be23db57794b77e2b0c010d
2017-04-27 22:32:24 -05:00
coalman 3fa74a14ad servo: Merge #16495 - Make tidy check that opening and closing braces that begin a line do … (from coalman:tidy-brace-alignment); r=emilio
…so with proper alignment.

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

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 195100f3cac99b979e25157eb437e63bd3262e6f

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 1f340388b3b70f620cbfba6d216955d3ef23b7cb
2017-04-19 03:06:31 -05:00
mckaymatt 149e726153 servo: Merge #16394 - Support line number offsets for inline stylesheets (from mckaymatt:line_num_offset__issue_15693); r=SimonSapin
<!-- Please describe your changes on the following line: -->
This allows accurate line numbers when reporting stylesheet errors.

@jdm This is going to require some effort to merge my changes with other recent changes to `ParserContext`. Because of that I would appreciate a quick sanity check before I put the time into performing the merge.
For example, should I store the `offset` as a u64, or should it be an Option?

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

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

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 94397ff0b4fed138241760770ff2d230985bed8a

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 3ebb0c3b05f4529ae61351b2c9120f013d1d3339
2017-04-13 20:12:08 -05:00
Emilio Cobos Álvarez 6ef6f7cb8e servo: Merge #16378 - stylo: A bunch of media query fixes (from emilio:media-fixes); r=upsuper
Source-Repo: https://github.com/servo/servo
Source-Revision: bb66bf81d5b699f40c8b59ea5eb7390dc23579bb

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 41562f8f656e98ab95e0c7f7df73a9c93296fa55
2017-04-12 10:00:26 -05:00
Xidorn Quan 73064eb8b6 servo: Merge #16241 - Stop passing url as string into Servo side (from upsuper:bug1352763-bug1352025); r=Manishearth,emilio
This is the Servo side changes of [bug 1352763](https://bugzilla.mozilla.org/show_bug.cgi?id=1352763) and [bug 1352025](https://bugzilla.mozilla.org/show_bug.cgi?id=1352025) which have been reviewed on Bugzilla.

Source-Repo: https://github.com/servo/servo
Source-Revision: 679b41893782663f7a2294cdf94dcedcf1337f98

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 135f4003dbf47eab0842f02be2aa9f766e066721
2017-04-03 07:05:42 -05:00
Simon Sapin 33a9e6d050 servo: Merge #16014 - Per-process lock for CSSOM objects (from servo:style-ref); r=emilio
<!-- Please describe your changes on the following line: -->

Before this PR, every object reflected in CSSOM is in `Arc<RwLock<_>>` to enable safe (synchronized) mutable aliasing. Acquiring all these locks has significant cost during selector matching:

* https://bugzilla.mozilla.org/show_bug.cgi?id=1311469
* https://bugzilla.mozilla.org/show_bug.cgi?id=1335941
* https://bugzilla.mozilla.org/show_bug.cgi?id=1339703

This PR introduce a mechanism to protect many objects with the same `RwLock` that only needs to be acquired once.

In Stylo, there is one such lock per process (in a `lazy_static`), used for everything.

I non-Stylo Servo, I originally intended to have one such lock per document (for author-origin stylesheets, and one per process for user-agent and user sytlesheets since they’re shared across documents, and never mutated anyway). However I failed to have the same document-specific (or pipeline-specific) `Arc` reachable from both `Document` nodes and `LayoutThread`. Recursively following callers lead me to include this `Arc` in `UnprivilegedPipelineContent`, but that needs to be serializable. So there is a second process-wide lock.

This was previously #15998, closed accidentally.

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

Source-Repo: https://github.com/servo/servo
Source-Revision: bb54f0a429de0e8b8861f8071b6cf82f73622664

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 851230e57ac8775707df5f0f103be5feac81fc41
2017-03-19 14:31:19 -07:00
Emilio Cobos Álvarez 1fc41b21ff servo: Merge #15941 - style: Fix media query parsing when invalid queries are present (from emilio:media); r=heycam
Fixes [bug 1347273](https://bugzil.la/1347273).

Source-Repo: https://github.com/servo/servo
Source-Revision: 304cafe57d45921e460ff408ae18138f4eca10df

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 8afc7ff724ff4f89d1f6d17ca27f74d09fafc1fd
2017-03-15 09:56:40 -07:00
Emilio Cobos Álvarez b11ee5a0ec servo: Merge #15931 - style: Kill SharedStyleContext::default_computed_values (from emilio:die-defaultvalues-die); r=mbrubeck
This is on top of https://github.com/servo/servo/pull/15928.

Now that cascade() gets a Device ref, we can use the default computed values
from there to avoid propagating that state all over the place.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8c8edb8731dc01d254839d0922590fba72f278c6

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 4da0b4a162f5987954a443b93f411e461ef0187d
2017-03-13 16:50:26 -07:00
avinash de24a7dde7 servo: Merge #15751 - first stab. added ServoUrl as a parameter to report_error(...) of Par… (from avinash-vijayaraghavan:testing-csserror); r=cbrewster
@jdm @SimonSapin
<!-- Please describe your changes on the following line: -->

1. Added ServoUrl as a parameter to report_error(...) of ParseErrorReporter trait.
2. I am not sure how to handle the case of impl ParseErrorReporter for CSSErrorReporter and MemoryHoleReporter, so have not made any changes  (other than adding ServoUrl arg) to report_error implementations for these.
3. In StdoutErrorReporter i have added the ServoUrl arg to the info! function,
4. I would like to know if i am on the correct path and clarify what else needs to be done.

---
<!-- 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
- [ ] These changes fix #15708 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because wanted to clarify before writing tests

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 0dbee36915abd926e61ca8571e11abf1f97ec830

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f16f3faea6a37ab983ca26ec8637c698a581b9e5
2017-03-06 07:11:51 -08:00
Ravi Shankar 4df106b306 servo: Merge #15115 - Introduce the `NoCalcLength` (from Wafflespeanut:lop); r=emilio
<!-- Please describe your changes on the following line: -->

I began this for making the `CalcLengthOrPercentage` represent `LengthOrPercentage` (instead of the enum we already have), but only later did I realize that it will make `LengthOrPercentageOrFoo` types fatty (which is the problem we're trying to avoid - #15061) and so, I dropped that attempt. Along the way, I introduced an internal type for `Length`, for representing all its non-calc variants (which are `Copy`). We could still have this type for the `LengthOrPercentageOrFoo` types which don't really need  `Length` since they already have their own variants for calc.

r? @Manishearth @emilio @SimonSapin or anyone interested

---
<!-- 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] These changes do not require tests because it's a refactor

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

Source-Repo: https://github.com/servo/servo
Source-Revision: cd0a6b98f4a9073e9ac98409c2fa917643552181
2017-01-28 14:08:38 -08:00
Manish Goregaokar 971a8aa41e servo: Merge #15065 - Use Box<CalcLengthOrPercentage> in specified values to avoid bloating inline sizes (from Manishearth:box-calclop); r=heycam
For #15061

CalcLOP is a large struct, and gets used quite often. While #15063 reduces its size a bit,
it will still be much larger than any of the other variants in the `specified::Length*` types,
so it will still bloat sizes, especially for specified values that contain many lengths.

This change boxes it in the length types, so that it just takes one word.

r? @heycam

Source-Repo: https://github.com/servo/servo
Source-Revision: f010fb58fdb4526a76581ba6536f807f2b2a4955
2017-01-17 11:49:52 -08:00
Emilio Cobos Álvarez 85d19a99d2 servo: Merge #14833 - style: Isolate the soon-to-be style-backend-specific code from the media_query module (from emilio:mq-refactor); r=heycam,bz
The idea here is having (for convenience) different `Expression` and `Device` representations for Gecko.

Both will be implemented in rust, but will use `nsMediaFeatures` as a source of media features instead of the Servo bits.

Does it sound good?

r? @heycam or @Manishearth

Source-Repo: https://github.com/servo/servo
Source-Revision: fdddeb1c9229b6f9bc202cb2df1a3701eec47e05
2017-01-07 05:03:41 -08:00
Emilio Cobos Álvarez e33a6984d2 servo: Merge #14739 - style: Cleanup and refactor how media types are represented (from servo:stylo-mq); r=Manishearth
This is necessary for the upcoming work in Stylo, given I plan to make MediaType
different for Servo and Gecko, and the Unknown variant doesn't fit in MediaType
to be fair, the device is never going to have any unknown media type.

Source-Repo: https://github.com/servo/servo
Source-Revision: d3875f6ec52fdb6bbe49719af6bff299c792ae0b
2016-12-30 06:05:43 -08:00
Emilio Cobos Álvarez 6609a2b21d servo: Merge #14540 - style: Basic @import support (from servo:at-import); r=SimonSapin,Ms2ger
r? @SimonSapin or @mbrubeck

cc @heycam and @bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: 38f136175e15acb6472466d141dedb6a253b0330
2016-12-16 09:43:19 -08:00
Xidorn Quan fca01e20b5 servo: Merge #14384 - Move Arc<RwLock<_>> out from CssRules tuple (from upsuper:cssrules-struct); r=Manishearth
<!-- Please describe your changes on the following line: -->
Otherwise it would be hard for Gecko to hold `CssRules`.

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
- [ ] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 39845faf261672b795af59602b45e7ce096b9f33
2016-11-29 03:26:46 -08:00
Gregory dd3f6b0834 servo: Merge #14192 - implement support for the width query (from gterzian:support_equality_constraints); r=emilio
<!-- Please describe your changes on the following line: -->
implement support for the `width` media query

---
<!-- 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/13670 (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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: bcc76f8a58f2ebe3886d16ff3eebbe68e3debf6c
2016-11-26 04:09:24 -08:00
Simon Sapin 174dbcace7 servo: Merge #14232 - CSSOM: Make Stylesheet fields have their own synchronization (from servo:moar-locks); r=upsuper
<!-- Please describe your changes on the following line: -->

r? @upsuper

---
<!-- 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 bug 1314208.

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 30867001d17222cc5d0b18086dca9f5d9bcb3934
2016-11-21 19:33:57 -06:00
Emilio Cobos Álvarez 9747761479 servo: Merge #14246 - Urlmageddon (from emilio:servo-url); r=SimonSapin
<!-- Please describe your changes on the following line: -->

Still needs a bunch of code in net to be converted in order to get more
advantage of this for images and stuff, but meanwhile this should help quite a
bit with #13778.

Still wanted to get this in.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 22aebdf5d41a3509cd6515ccf5edcdf33715a76d
2016-11-17 15:34:47 -06:00
Manish Goregaokar d8a79aa1af servo: Merge #14190 - Immutable CSSOM (from Manishearth:cssom); r=SimonSapin
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

Source-Repo: https://github.com/servo/servo
Source-Revision: afc60bee2809059b8b754a1c6d6d10c1d36326fb
2016-11-16 15:05:59 -06:00
Takanori Ishibashi a69e0fd09a servo: Merge #14199 - Update CSSRule naming from 'CSSRule' to 'CssRule' (from 11Takanori:CSSRule_to_CssRule); r=nox
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: b63c85c31b10e449b7334890becacb08def81f96
2016-11-14 03:36:37 -06:00
Xidorn Quan 306c3d3de4 servo: Merge #14159 - Allow empty media query list (from upsuper:media-query); r=Wafflespeanut
<!-- 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
- [ ] 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: c3dc50b7ac553acc7116a2fca4c4498e8b3a8a72
2016-11-10 01:37:57 -06:00
Xidorn Quan c8c928d000 servo: Merge #14121 - Rename media_queries::MediaQueryList to MediaList (from upsuper:medialist); r=Wafflespeanut
<!-- 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 56b4065ee83b3afb420fd6119685ba975f143885
2016-11-08 01:46:40 -06:00
Simon Sapin 7cb2f9a2dc servo: Merge #14043 - Update to string-cache 0.3 (from servo:string-cache-up); r=nox
Previously, `string-cache` defined:
*  An string-like `Atom` type,
* An `atom!("foo")` macro that expands to a value of that type, for a set of strings known at compile-time,
* A `struct Namespace(Atom);` type
* A `ns!(html)` macro that maps known prefixed to `Namespace` values with the corresponding namespace URL.

Adding a string to the static set required making a change to the `string-cache` crate.

With 0.3, the `Atom` type is now generic, with a type parameter that provides a set of static strings. We can have multiple such sets, defined in different crates. The `string_cache_codegen` crate, to be used in build scripts, generates code that defines such a set, a new atom type (a type alias for `Atom<_>` with the type parameter set), and an `atom!`-like macro.

The html5ever repository has a new `html5ever_atoms` crate that defines three such types: `Prefix`, `Namespace`, and `LocalName` (with respective `namespace_prefix!`, `namespace_url!`, and `local_name!` macros). It also defines the `ns!` macro like before.

This repository has a new `servo_atoms` crate in `components/atoms` that, for now, defines a single `Atom` type (and `atom!`) macro. (`servo_atoms::Atom` is defined as something like `type Atom = string_cache::Atom<ServoStaticStringSet>;`, so overall there’s now two types named `Atom`.)

In this PR, `servo_atoms::Atom` is used for everything else that was `string_cache::Atom` before. But more atom types can be defined as needed. Two reasons to do this are to auto-generate the set of static strings (I’m planning to do this for CSS property names, which is the motivation for this change), or to have the type system help us avoid mix up unrelated things (this is why we had a `Namespace` type ever before this change).

Introducing new types helped me find a bug: when creating a new attribute `dom::Element::set_style_attr`, would pass `Some(atom!("style"))` instead of `None` (now `Option<html5ever_atoms::Prefix>` instead of `Option<string_cache::Atom>`) to the `prefix` argument of `Attr::new`. I suppose the author of that code confused it with the `local_name` argument.

---

Note that Stylo is not affected by any of this. The `gecko_string_cache` module is unchanged, with a single `Atom` type. The `style` crate conditionally compiles `Prefix` and `LocalName` re-exports for that are both `gecko_string_cache::Atom` on stylo.

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 5b4cc9568dbd5c15e5d2fbc62719172f11566ffa
2016-11-03 11:19:44 -05:00
Jack Moffitt 2f97a7cbc3 servo: Merge #13453 - Implement matchMedia and MediaQueryList (from metajack:media-query-list); 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
- [ ] These changes fix #13376 (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. -->

Fixes #13376.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6ef46ab9e4ec08d5f5226d41f0cac77c3584bae9
2016-11-02 14:51:12 -05:00
Simon Sapin 8013dbe3f5 servo: Merge #13839 - Add RwLock in more Arc’d things in stylesheets (from servo:locked-style); r=mbrubeck
<!-- Please describe your changes on the following line: -->

CSSOM needs hold potentially multiple references (through `Arc`) to these objects, and then mutate them.

CC @upsuper
r? @mbrubeck

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 4e5ad268b15aa222c0d049796dde7c6e7bc0897b
2016-10-20 11:29:27 -05:00
Martin Robinson c116a510e2 servo: Merge #12817 - Update to euclid 0.8 (from servo:euclid); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 5b915c403d2e96bd2917e7df4f2a58a6668a0c0e
2016-08-11 20:12:29 -05:00
Simon Sapin c710b104be servo: Merge #12515 - Make the style crate more concrete (from servo:concrete-style); r=bholley
Background:

The changes to Servo code to support Stylo began in the `selectors` crate with making pseudo-elements generic, defined be the user, so that different users (such as Servo and Gecko/Stylo) could have a different set of pseudo-elements supported and parsed. Adding a trait makes sense there since `selectors` is in its own repository and has others users (or at least [one](https://github.com/SimonSapin/kuchiki)).

Then we kind of kept going with the same pattern and added a bunch of traits in the `style` crate to make everything generic, allowing Servo and Gecko/Stylo to do things differently. But we’ve also added a `gecko` Cargo feature to do conditional compilation, at first to enable or disable some CSS properties and values in the Mako templates. Since we’re doing conditional compilation anyway, it’s often easier and simpler to do it more (with `#[cfg(feature = "gecko")]` and `#[cfg(feature = "servo")]`) that to keep adding traits and making everything generic. When a type is generic, any method that we want to call on it needs to be part of some trait.

----

The first several commits move some code around, mostly from `geckolib` to `style` (with `#[cfg(feature = "gecko")]`) but otherwise don’t change much.

The following commits remove some traits and many type parameters through the `style` crate, replacing them with pairs of conditionally-compiled API-compatible items (types, methods, …).

Simplifying code is nice to make it more maintainable, but this is motivated by another change described in https://github.com/servo/servo/pull/12391#issuecomment-232183942. (Porting Servo for that change proved difficult because some code in the `style` crate was becoming generic over `String` vs `Atom`, and this PR will help make that concrete. That change, in turn, is motivated by removing geckolib’s `[replace]` override for string-cache, in order to enable using a single Cargo "workspace" in this repository.)

r? @bholley

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require new 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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 2d01d41a506bcbc7f26a2284b9f42390d6ef96ab

--HG--
rename : servo/ports/geckolib/selector_impl.rs => servo/components/style/gecko_selector_impl.rs
rename : servo/ports/geckolib/values.rs => servo/components/style/gecko_values.rs
rename : servo/ports/geckolib/properties.mako.rs => servo/components/style/properties/gecko.mako.rs
2016-07-20 02:58:34 -05:00
Cameron McCormack 723cf0f5c4 servo: Merge #11287 - Support -moz-binding in geckolib (from heycam:moz-binding); r=bholley
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 --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because changes target stylo

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

Source-Repo: https://github.com/servo/servo
Source-Revision: 2a2b88f42c55614f949f218b0444778e8e2bfc78
2016-05-24 14:41:04 -07:00
Simon Sapin 031eaaddbf servo: Merge #10606 - Remove the url! plugin (from servo:remove-url-plugin); r=nox
In rust-url 1.0 the `Url` struct is going to have private fields, and there is no way to to create an aribitrary one without going through the parser.

The plugin never had a clear demonstrated performance benefit, it was made mostly because it was possible and relatively easy at the time.

This commit was originally part of #9840, but it’s taking a while to land and I keep removing new uses of `url!` when rebasing.

r? @nox

Source-Repo: https://github.com/servo/servo
Source-Revision: 3368565b3c6c76e5ce2d170d5c5cfb2f52a56956
2016-04-14 18:45:35 +05:01
Emilio Cobos Álvarez b1dd4fcd79 servo: Merge #9567 - style: Make the whole style crate independent of the implementation (from emilio:general-pseudo-element-parsing); r=bholley,SimonSapin
This allows, among other things, having different implementations for parsing pseudo{elements, classes} in both `ports/geckolib` and in servo.

Source-Repo: https://github.com/servo/servo
Source-Revision: c11844cbf28054784c8d65781cff20045d8ee48b
2016-02-14 03:30:59 +05:01
Bobby Holley 97c1afa558 servo: Merge #9261 - Remove the msg dependency from style (from bholley:geckolib_nomsg); r=Manishearth
This is part of slimming down the dependencies of geckolib.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3680e82cab766a412a969a21c0cdff0c7f97d7bc
2016-01-12 08:54:31 +05:01