Commit graph

52 commits

Author SHA1 Message Date
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Xidorn Quan
7e92c15e00 Replace write! with to_css and write_str in some ToCss impls 2017-08-20 17:21:08 +10:00
Daisuke Akatsuka
c05baa2327 Implement clone_content method 2017-08-15 15:25:05 +09:00
Brad Werth
557ffa979d Rework MediaType to be an atom-based struct instead of an enum.
MozReview-Commit-ID: 1Tfrs9PBkhA
2017-08-09 13:25:30 -07:00
Boris Chiou
234d2c1b32 Bug 1374233 - Part 3: Use NonNegativeAu as computed values for font-size related properties.
For font-size and font-size-adjust.

MozReview-Commit-ID: 5rrfVSzB7WF
2017-08-04 14:21:59 +08:00
Emilio Cobos Álvarez
2c97ec1832
stylo: Avoid recreating the stylist in RebuildAllStyleData.
Bug: 1386602
Reviewed-by: heycam
MozReview-Commit-ID: 31G9BLgqEmm
2017-08-03 16:34:10 +02:00
Manish Goregaokar
0e3f7d782b stylo: Disable text-zoom for <svg:text> 2017-08-02 10:25:55 -07:00
Manish Goregaokar
16d46eaf7a stylo: Handle text-zoom for font-size 2017-08-02 10:25:14 -07:00
Xidorn Quan
a59fceeefc Handle device-pixel-ratio-webkit pref correctly. 2017-07-31 14:06:45 +10:00
Xidorn Quan
dd2b851f93 Remove Gecko_GetMediaFeatures and access nsMediaFeatures::features directly. 2017-07-29 20:20:33 +10:00
Xidorn Quan
388875ca44 Record viewport unit usage and generate proper restyle hint. 2017-07-25 19:02:21 +10:00
bors-servo
bf16b146e8 Auto merge of #17839 - heycam:opacity-smil, r=hiro
style: allow out-of-range opacity values for SMIL animations

From https://bugzilla.mozilla.org/show_bug.cgi?id=1371150.

<!-- 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/17839)
<!-- Reviewable:end -->
2017-07-24 19:13:08 -07:00
Cameron McCormack
c81d62d36f style: Record on a computed::Context whether we are computing a SMIL animated value. 2017-07-24 20:47:33 +08:00
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Alan Jeffrey
caa3585219 Fixed scaling artefacts in paint worklets caused by zoom and hidpi. 2017-07-20 17:25:50 -05:00
Emilio Cobos Álvarez
e374a54050
style: Cleanup the cascade a good bit. 2017-07-20 11:20:37 +02:00
Emilio Cobos Álvarez
07e1c6e75a
stylo: Cleanup the Gecko bits.
MozReview-Commit-ID: dbVDy1u4vp
2017-07-18 17:35:44 +02:00
Manish Goregaokar
808b1f509b stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it 2017-07-17 18:02:25 -07:00
Emilio Cobos Álvarez
6fefe522a3
style: Assert we never style a root element from another document.
Right now when calling getComputedStyle with an element from another document,
we return the style using the pres context of that document, not of the document
of the window getComputedStyle was called on, so this holds.

But it will stop holding if we ever change this, so assert it doesn't happen.

Bug: 1374062
Reviewed-By: Manishearth
MozReview-Commit-ID: 3g8yQWWdsen
2017-06-21 19:55:02 +02:00
Simon Sapin
a5bb55790f Untry style 2017-06-18 13:18:13 +02:00
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Cameron McCormack
19b61dfc08 style: Recascade the document when rem units are used and the root font-size changes. 2017-06-04 10:03:11 +08:00
Emilio Cobos Álvarez
dd3bf6f952
Ensure the default computed values are up-to-date before evaluating media queries.
Zoom changes can change the meaning of ems, so we can't re-evaluate media
queries with the old values, because otherwise we may miss a restyle.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: HQInvR7RPqR
2017-06-03 14:44:12 +02:00
Cameron McCormack
c768169149 style: Add support for disabled document colors. 2017-05-30 16:25:08 +08:00
Manish Goregaokar
ce2237e123 Move root_font_size to the device 2017-05-25 13:32:34 -07:00
bors-servo
8d950bd620 Auto merge of #17006 - emilio:negative-resolution, r=upsuper
style: Reject non-positive resolution values in media queries.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1366961
See: https://github.com/w3c/csswg-drafts/issues/1454

<!-- 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/17006)
<!-- Reviewable:end -->
2017-05-24 22:20:37 -05:00
Emilio Cobos Álvarez
fa93d82041
style: Reject non-positive resolution values in media queries.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1366961
See: https://github.com/w3c/csswg-drafts/issues/1454
2017-05-23 15:52:48 +02:00
Xidorn Quan
fc2d167184 Add -webkit-prefix for serialization when necessary. 2017-05-23 15:43:03 +10:00
Bobby Holley
d78ca4c4f9 Use StyleArc in the style system.
MozReview-Commit-ID: flF0fv9E9M
2017-05-02 17:35:44 -07:00
Emilio Cobos Álvarez
3b857f1c4e
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.
This should fix most of the complaints that caused
https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a
bunch of other FIXMEs across the style system.
2017-04-30 23:45:40 +02:00
Anthony Ramine
f68e2fded9 Propagate quirks mode all the way to ParserContext
The quirks mode is still not properly propagated in geckolib.
2017-04-27 10:41:55 +02:00
Hiroyuki Ikezoe
973d8287a9 Support vendor prefix keyframes rule.
If there are multiple prefixed/non-prefixed @keyframes with the same name;

* non-prefixed rule overrides earlier rules.
* prefixed rule overrides earlier prefixed rules.
2017-04-21 12:18:12 +09:00
Emilio Cobos Álvarez
52ef1c9714
Bug 1356074: Implement keyword-valued media queries. r=heycam
MozReview-Commit-ID: 1oskYLM11us
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-14 12:09:07 +08: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
Emilio Cobos Álvarez
78a3408405
Fix a few media query parsing bugs.
MozReview-Commit-ID: 6nUd2vA6zO
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-11 16:51:34 +08:00
Manish Goregaokar
25667d0321 stylo: Use gecko's font metrics 2017-04-10 14:29:51 +08: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
eaf27ccfa0
style: Kill SharedStyleContext::default_computed_values.
Now that cascade() gets a Device, we can use the default computed values from
there to avoid propagating that state all over the place.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-14 00:49:16 +01:00
Matt Brubeck
16e318d055
Add support for non-standard -moz color keyword values.
Closes #15928
2017-03-14 00:49:08 +01:00
Xidorn Quan
52c9f4b527 Implement MediaList for Stylo. 2017-03-13 17:55:25 +11:00
Emilio Cobos Álvarez
95ccfa748e
Bug 1303229: Get the proper viewport size for stylo. r=heycam
At least until we support scrollbars properly, this size is going to be the
correct one. I've left a TODO to grab the proper one once we support it.

This allows to trivially test viewport units for now.

MozReview-Commit-ID: JdaZ6WlZ2C6
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-11 11:54:12 +01:00
bors-servo
94e563e4d9 Auto merge of #15735 - servo:cssparserup, r=emilio
Update cssparser to 0.11

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

<s>Depends on https://github.com/servo/rust-cssparser/pull/122.</s>

---
<!-- 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/15735)
<!-- Reviewable:end -->
2017-02-26 02:19:32 -08:00
Simon Sapin
0f2d000a23 Borrow input to match_ignore_ascii_case!
In cssparser version 0.11, this macro will stop implicitly borrowing its
own input.
2017-02-26 10:40:09 +01:00
Emilio Cobos Álvarez
6875c65d37
Bug 1341083: Implement dynamic restyling for display: contents. r=heycam
MozReview-Commit-ID: KimTU2j4V4p
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-25 19:58:56 +01:00
Ravi Shankar
590c9579f0 Change LengthOrPercentage to make use of NoCalcLength 2017-01-29 02:30:25 +05:30
Manish Goregaokar
9c69b3d0a5 Regen bindings 2017-01-21 16:54:17 -08:00
Emilio Cobos Álvarez
3b36f4c58e
Bug 1331213: Implement the resolution override. r=heycam
MozReview-Commit-ID: LFGam2hDoh7
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:18:56 +01:00
Emilio Cobos Álvarez
13878d674c
Bug 1331213: Implement Device::media_type, without supporting overrides for now. r=heycam
MozReview-Commit-ID: 9AeHViwoX1t
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:18:53 +01:00
Emilio Cobos Álvarez
10a1b887d6
Bug 1331213: Implement the bulk of media query evaluation. r=heycam
Two main notes:

 * The nsStringBuffer bit goes untested, since it's only used on windows and
   there's no way I can test it, please review with care.

 * I haven't implemented yet the "enumerated" media queries. I'd want to do it
   as a follow-up, because I'm running out of time, and it requires some
   investigation.

MozReview-Commit-ID: 1pBbzyIViPk
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:18:49 +01:00