Commit graph

6718 commits

Author SHA1 Message Date
Boris Chiou
c7dc3e4008 Bug 1335942 - Part 1: Introduce mozilla::AnimationValue. r=manishearth
Use AnimationValue to wrap StyleAnimationValue and RawServoAnimationValue.
2017-02-08 12:32:09 +08:00
z1mvader
6bf5c24434 removed invalid FIXME 2017-02-07 15:01:52 -05:00
Ms2ger
2ddf1f2d91 Fix some build warnings. 2017-02-07 16:11:56 +01:00
bors-servo
449147b8df Auto merge of #15237 - samuknet:negative-letter-spacing-word-spacing, r=emilio
Allow negative values for letter-spacing and word-spacing.  Inline Le…

<!-- Please describe your changes on the following line: -->
Allow negative values when parsing `letter-spacing` and `word-spacing`.  Inline `parse_non_negative` in `Length`.

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

<!-- 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/15237)
<!-- Reviewable:end -->
2017-02-06 19:29:31 -08:00
Xidorn Quan
80541219bc Not blockify flow-root 2017-02-07 14:21:08 +11:00
Xidorn Quan
33a9c4383c Use -stdlib=libc++ on mac for stylo bindgen 2017-02-07 12:15:31 +11:00
Sam
3682434828 Allow negative values for letter-spacing and word-spacing. Inline Length parse functions.
Signed-off-by: Sam <sam@sam.uk.net>

Use existing parse functions for any length parsing of letter-spacing and word-spacing.

Signed-off-by: Sam <sam@sam.uk.net>

Add letter-spacing test

Signed-off-by: Sam <sam@sam.uk.net>

Add tests for letter-spacing and word-spacing negative parsing.

Signed-off-by: Sam <sam@sam.uk.net>

Remove extra line.

Signed-off-by: Sam <sam@sam.uk.net>

Remove _ of _context.

Signed-off-by: Sam <sam@sam.uk.net>

Refactor tests to use new NoCalcLength

Signed-off-by: Sam <sam@sam.uk.net>

Remove unused import.

Signed-off-by: Sam <sam@sam.uk.net>

Remove un-needed use.
2017-02-06 23:52:35 +00:00
Xidorn Quan
4a0482f0a0 Add comma between layers for mask shorthand 2017-02-06 09:58:08 +11:00
Xidorn Quan
920b0ee6ca Don't require mask-mode to follow mask-image 2017-02-06 09:56:50 +11:00
mrmiywj
eb115e02e1 add support for mask_position_parse/serial 2017-02-05 00:38:03 +08:00
Manish Goregaokar
34ba00e6d9 Basic handling framework for presentation attributes in Stylo, with handling for font-size and color
This introduces a basic framework for servo's style system to be able
to query the style of presentation attributes which it can then insert
into the cascade. It uses that framework to implement the size and
color attributes on <font>.

There are a number of improvements that can be done on top of this:

 - Implement all other properties
 - Abstractify the ruledata parameter of the mappers using templates or virtual dispatch so that it can be a Servo decl block instead
 - Implement aforementiond abstraction over Servo decl blocks (this obsoletes the code in the first item above, so it might just be better to skip that and directly do this)
 - Replace uses of nsHTMLStyleSheet with an abstract base class containing common elements between Servo and Gecko

I'd prefer for these to be done in separate steps.
2017-02-03 17:35:44 -08:00
Hiroyuki Ikezoe
d588427c2c Update bindings. 2017-02-04 08:54:37 +09:00
Hiroyuki Ikezoe
22ff72dfc0 Make transform property animatable.
This just changes animatable to True, drops 'if product == "servo" block
, fixes indentations and moves 'use' declarations at the top of the file.

MozReview-Commit-ID: A96oxYXmknV
2017-02-04 08:54:00 +09:00
Hiroyuki Ikezoe
10b6c1bb4f Implement clone_transform.
The implementation of clone_transform is an adaptation of set_transform.

MozReview-Commit-ID: ESE1ha0x666
2017-02-04 08:54:00 +09:00
bors-servo
50dca76ae3 Auto merge of #15372 - emilio:bindgenup, r=upsuper
BindgenUp

r? @heycam or @upsuper or @bholley

<!-- 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/15372)
<!-- Reviewable:end -->
2017-02-03 14:45:13 -08:00
Emilio Cobos Álvarez
79d9e2bd51
BindgenUp 2017-02-03 21:31:55 +01:00
bors-servo
812a3a1c46 Auto merge of #15338 - upsuper:parse_one_decl, r=emilio
Parse value entirely for setting property via CSSOM

Fixes #15037

<!-- 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/15338)
<!-- Reviewable:end -->
2017-02-03 11:48:28 -08:00
bors-servo
48f3cc8325 Auto merge of #15356 - servo:font-face-descriptors, r=Manishearth
Add support for more @font-face descriptors

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

Part of https://bugzilla.mozilla.org/show_bug.cgi?id=1290237. I’ll add conversions to `nsCSSValue` separately because that requires new C++ functions in the stylo 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
- [ ] 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/15356)
<!-- Reviewable:end -->
2017-02-03 05:09:30 -08:00
Simon Sapin
9ec8418d8c Rename CommaSeparated to OneOrMoreCommaSeparated, reflecting its behavior. 2017-02-03 13:15:53 +01:00
bors-servo
e912400bc3 Auto merge of #15305 - dbaron:reset-more-for-font, r=Manishearth
Make additional properties be reset by the 'font' shorthand.

A number of properties are supposed to be reset to initial values by the
'font' shorthand.  This does so for all such properties that Servo
currently supports (conditional on when they're supported).

Fixes #15033.

It's not clear to me that the use of <code>None</code> is correct for resetting to initial values, but it seems to match what at least some other shorthands do (I think I was looking at the code for border), and it appears to fix the tests as expected.  I haven't probed into it more than that.

/cc @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 (I haven't quite gotten the servo build to work, but stylo build works)
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15033 (github issue number if applicable).

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

This has test coverage when running stylo.  In particular, it fixes a bunch of sets of mochitest failures in layout/style/test/test_value_storage.html, with the set for each value of the 'font' shorthand listed in property_database.js looking like:
```
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font'
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-style')
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant')
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-weight')
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-size')
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'line-height')
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-family')
 TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-stretch')
-TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-size-adjust') - didn't expect "", but got it
+TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-size-adjust')
 TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-feature-settings') - didn't expect "", but got it
 TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-language-override') - didn't expect "", but got it
-TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-kerning') - didn't expect "", but got it
+TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-kerning')
 TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-synthesis') - didn't expect "", but got it
 TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-alternates') - didn't expect "", but got it
-TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-caps') - didn't expect "", but got it
+TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-caps')
 TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-east-asian') - didn't expect "", but got it
 TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-ligatures') - didn't expect "", but got it
 TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-numeric') - didn't expect "", but got it
-TEST-UNEXPECTED-FAIL | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-position') - didn't expect "", but got it
+TEST-PASS | layout/style/test/test_value_storage.html | setting 'medium serif' on 'font' (for 'font-variant-position')
```

I'm not sure if separate Servo test coverage is 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/15305)
<!-- Reviewable:end -->
2017-02-02 16:43:26 -08:00
bors-servo
99899d0eb5 Auto merge of #15353 - bholley:inline_more_ffi, r=emilio
stylo: Optimize some FFI calls

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

<!-- 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/15353)
<!-- Reviewable:end -->
2017-02-02 14:32:54 -08:00
Bobby Holley
001f258322 Bug 1335863 - Inline common case parent access. r=emilio 2017-02-02 14:32:23 -08:00
Bobby Holley
e78f2404e1 Bug 1335863 - Inline Gecko_IsHTMLElementInHTMLDocument. r=emilio 2017-02-02 14:32:23 -08:00
Bobby Holley
ae88d22399 Update bindings. 2017-02-02 14:32:22 -08:00
L. David Baron
7a65a472a2 Make additional properties be reset by the 'font' shorthand.
A number of properties are supposed to be reset to initial values by the
'font' shorthand.  This does so for all such properties that Servo
currently supports (conditional on when they're supported).

Fixes #15033.
2017-02-02 12:28:52 -08:00
Simon Sapin
4701850f37 Add unicode-range descriptor to @font-face 2017-02-02 20:28:21 +01:00
Matt Brubeck
727a1fe3de Update clap, clippy, deflate, flate2, open, unicode-segmentation, owning_ref, parking_lot, phf, quote, walkdir 2017-02-02 11:18:33 -08:00
Simon Sapin
0f351cb851 Fix incorrectly copy-pasted doc-comments. 2017-02-02 20:00:40 +01:00
Simon Sapin
f6bf397bb2 Add font-stretch descriptor to @font-face 2017-02-02 19:59:03 +01:00
Simon Sapin
fe8f5fad16 Add font-weight descriptor to @font-face 2017-02-02 19:58:40 +01:00
Simon Sapin
8767b0d7cc Add font-style descriptor in @font-face 2017-02-02 19:57:40 +01:00
Simon Sapin
5405fb0d73 Use FamilyName instead of FontFamily in @font-face
… to exclude generic families, per spec:
https://drafts.csswg.org/css-fonts/#font-family-desc
2017-02-02 19:37:31 +01:00
Simon Sapin
52aa2431a9 Introduce a FamilyName type, like FontFamily but not a generic family. 2017-02-02 19:13:06 +01:00
Simon Sapin
44f6c60d91 Separate mandatory and optional descriptors in @font-face parsing macro. 2017-02-02 19:02:57 +01:00
Simon Sapin
4bcae573b3 Macroize @font-face descriptor definitions 2017-02-02 18:32:02 +01:00
Simon Sapin
2b83d844da Use the Parse trait for @font-face parsing. 2017-02-02 18:32:01 +01:00
Simon Sapin
7724bb01a3 Remove intermediate FontFaceDescriptorDeclaration enum.
Have `@font-face` parsing write to `FontFaceRule` directly.
2017-02-02 18:32:01 +01:00
bors-servo
fb7f65fc57 Auto merge of #15317 - emilio:style-attr-restyle, r=bholley
style: Avoid selector-matching when only the style attribute is changed.

r? @bholley

<!-- 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/15317)
<!-- Reviewable:end -->
2017-02-02 03:00:22 -08:00
Emilio Cobos Álvarez
2594cb9c33
style: Refactor the traversal so it's more easy to read and straight-forward. 2017-02-02 11:58:36 +01:00
Emilio Cobos Álvarez
8859aa004f
style: Avoid selector-matching when only the style attribute is changed. 2017-02-02 11:58:08 +01:00
bors-servo
8aa23b46db Auto merge of #15340 - upsuper:border-image-width, r=Wafflespeanut
Reject negative value for border-image-width

<!-- 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/15340)
<!-- Reviewable:end -->
2017-02-02 01:10:21 -08:00
Xidorn Quan
bf52419716 Reject negative value for border-image-width 2017-02-02 17:09:10 +11:00
Xidorn Quan
d06ffc2289 Parse value entirely for setting property via CSSOM
Fixes #15037
2017-02-02 16:07:49 +11:00
Xidorn Quan
c8970f7e21 Ignore initial values in text-decoration 2017-02-02 15:41:56 +11:00
Manish Goregaokar
c0e1a1f963 Ensure that gradients have at least 2 stops 2017-01-31 22:23:00 -08:00
Manish Goregaokar
5117b7ec5a Preallocate in deduplicate_property_declarations 2017-01-31 16:43:57 -08:00
Hiroyuki Ikezoe
35192b03c3 Assert if there is an important declaration while collecting animated properties in keyframes.
Parser has already dropped it.
2017-02-01 07:33:37 +09:00
Hiroyuki Ikezoe
a80725c91b Allow empty keyframe and keyframes with non-animatable properties.
We need to create CSS animations that have empty keyframe or keyframes
which have only invalid properties or non-animatable properties to fire
animation events for such animations.
2017-02-01 07:06:38 +09:00
Emilio Cobos Álvarez
0b2c32a45a
style: Temporarily force selector matching for style attribute restyles.
The test failures on try were because of this.
2017-01-30 23:53:55 +01:00
Emilio Cobos Álvarez
f48328edfe
style: Remove a bit of unused code. 2017-01-30 23:53:54 +01:00