Commit graph

2581 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
c7ce2ff483
style: Make numbers keep track of whether they were specified as calc(). 2017-03-27 03:56:30 +02:00
bors-servo
c20bbb920c Auto merge of #16143 - emilio:lops, r=Manishearth
style: Be consistent with naming and serialization of "0" with LenghtOrPercentageOrNumber.

<!-- 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/16143)
<!-- Reviewable:end -->
2017-03-26 18:05:40 -07:00
bors-servo
7b64c3c419 Auto merge of #16142 - emilio:dumbness, r=canaltinova
style: Make PercentageOrNumber also reject negative percentages.

It always returns true, so this is just stupid.

<!-- 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/16142)
<!-- Reviewable:end -->
2017-03-26 16:42:48 -07:00
streichgeorg
a700972cbb Issue #15977: Serialize counter-increment when there are no properties 2017-03-26 21:52:40 +02:00
Emilio Cobos Álvarez
5ca16a844c
style: Be consistent with naming and serialization of "0" with LenghtOrPercentageOrNumber. 2017-03-26 20:10:50 +02:00
Emilio Cobos Álvarez
1ce9758f90
style: Simplify Number::parse_with_minimum. 2017-03-26 20:02:19 +02:00
Emilio Cobos Álvarez
372379428b
style: Make PercentageOrNumber also reject negative percentages. 2017-03-26 19:56:55 +02:00
Nazım Can Altınova
494238ab29
Add support for -moz-image-rect 2017-03-25 21:58:36 +03:00
Nazım Can Altınova
645971b387
Rename and move PercentageOrNumber to values 2017-03-25 21:58:32 +03:00
bors-servo
fe45283169 Auto merge of #16121 - froydnj:unused-property-mako-imports, r=cbrewster
remove unused `use` statements in mako helpers

These are no longer needed, according to `./mach build -d` and grep.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because compilation is sufficient

<!-- 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/16121)
<!-- Reviewable:end -->
2017-03-24 20:32:06 -07:00
bors-servo
1584bbd3ec Auto merge of #16122 - Manishearth:stylo-font-size, r=heycam
stylo: Handle font-size keywords correctly

r=heycam https://bugzilla.mozilla.org/show_bug.cgi?id=1341775

<!-- 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/16122)
<!-- Reviewable:end -->
2017-03-24 12:30:10 -07:00
Boris Zbarsky
16252633bd Fix writing-mode display fixup to check the right condition.
It should be checking the value of the 'writing-mode' property, not the value of
the "writing mode" concept.  The latter is influenced by other properties like
'direction' and whatnot.  That was causing this code to convert inlines to
inline-blocks if they just had a different direction from their parent, which is
not correct
2017-03-24 14:21:51 -04:00
Manish Goregaokar
3139a90386 stylo: Special-case initial-computation of font-size
MozReview-Commit-ID: Ff6kt8RLChI
2017-03-24 11:10:35 -07:00
Manish Goregaokar
fddddc9711 stylo: Calculate font-size keywords based on base size
MozReview-Commit-ID: Ff6kt8RLChI
2017-03-24 10:54:06 -07:00
Manish Goregaokar
0aceddd47b stylo: Compute font-size between font-family and all late properties
MozReview-Commit-ID: Ff6kt8RLChI
2017-03-24 10:53:54 -07:00
bors-servo
6d9a552647 Auto merge of #16119 - BorisChiou:stylo/restylehint, r=upsuper
stylo: Bug 1349834 - Update RESTYLE_STYLE_ATTRIBUTE to sync Gecko change.

This is an interdependent patch for Bug 1349834. We remove eRestyle_SVGAttrAnimations from nsRestyleHint, so need to update the bindgen and the value of RESTYLE_STYLE_ATTRIBUTE.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1349834](https://bugzilla.mozilla.org/show_bug.cgi?id=1349834)
- [X] These changes do not require tests because we just remove an unused flag from Gecko.

<!-- 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/16119)
<!-- Reviewable:end -->
2017-03-24 09:20:54 -07:00
Nathan Froyd
5f49e38650 remove unused use statements in mako helpers
These are no longer needed, according to `./mach build -d` and grep.
2017-03-24 11:28:43 -04:00
bors-servo
0f2c71aa66 Auto merge of #16044 - bd339:iss15754, r=emilio
Make writing-mode affect computed display

<!-- Please describe your changes on the following line: -->
The first manual test-case in #15754 passes now, but the second test-case still renders "Text" horizontally, which is apparently because of servo's experimental support for writing-mode.

---
<!-- 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 #15754 (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/16044)
<!-- Reviewable:end -->
2017-03-24 08:05:36 -07:00
Boris Chiou
a03bde357c Bug 1349834 - Update RESTYLE_STYLE_ATTRIBUTE to sync Gecko change. 2017-03-24 22:36:09 +08:00
bors-servo
30fc790df1 Auto merge of #16112 - bholley:mozappearance, r=Manishearth
Add 'appearance' property to Stylo (with '-webkit-appearance' alias) (take 2)

Replacement for #16110.

<!-- 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/16112)
<!-- Reviewable:end -->
2017-03-23 21:14:03 -07:00
Mats Palmgren
2d2b98917f Add 'appearance' property to Stylo (with '-webkit-appearance' alias) 2017-03-23 21:13:40 -07:00
Hiroyuki Ikezoe
6bbd8b09f4 Add a function to get after-change style for CSS Transition. 2017-03-24 10:39:50 +09:00
Hiroyuki Ikezoe
dde46c5c90 Make cascade_internal() reusable with rule nodes.
A new function, cascade_with_rules, takes StrongRuleNode
and computes cascading result values with the StrongRuleNode.
This new function will be used for getting after-change-style
for CSS Transitions.
2017-03-24 10:39:49 +09:00
Hiroyuki Ikezoe
aa6433b6d6 Add a function that returns new rules by removing transition and animation level rules.
This will be used for additive animations and SMIL.
2017-03-24 10:39:44 +09:00
Hiroyuki Ikezoe
959f1c8360 Add a function that returns new rules by removing transition level rule.
This will be used for after-change-style of CSS Transition.
2017-03-24 09:57:00 +09:00
Hiroyuki Ikezoe
4c4b01954c Drop mut from pseudo_style for the argument of cascade_internal. 2017-03-24 09:56:56 +09:00
bors-servo
636f8ceb50 Auto merge of #15972 - jryans:ps-contain, r=emilio
Parsing / serialization for CSS contain

Adds parsing / serialization for CSS contain to the style package.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15955
- [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/15972)
<!-- Reviewable:end -->
2017-03-23 13:23:51 -07:00
bors-servo
f00f3fa81c Auto merge of #16104 - Wafflespeanut:box-shadow-serialization, r=Wafflespeanut
Properly serialize <box-shadow>

Rebase of #15703, fixes #15203

<!-- 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/16104)
<!-- Reviewable:end -->
2017-03-23 10:57:03 -07:00
Nikita-04
ce7d63bbd5 Properly serialize <box-shadow> 2017-03-23 23:26:18 +05:30
Bobby Holley
e485365288 Bug 1348606 - Use a threadsafe array for counters. r=xidorn
MozReview-Commit-ID: KgTgcD5mGqr
2017-03-23 09:35:12 -07:00
J. Ryan Stinnett
535959f2a5 Parsing / serialization for CSS contain 2017-03-23 11:29:12 -05:00
bors-servo
9d0b481789 Auto merge of #16094 - emilio:simplify-float-pos, r=heycam,upsuper
Bug 1349885: stylo: Simplify computation of float and position.

<!-- 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/16094)
<!-- Reviewable:end -->
2017-03-23 05:35:28 -07:00
Emilio Cobos Álvarez
c8e0542059
Bug 1349885: stylo: Simplify computation of float and position. r=heycam,xidorn
MozReview-Commit-ID: Hh6391DXV5o
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-23 11:47:10 +01:00
Emilio Cobos Álvarez
ab2956a815
Bug 1349553: Account for negations of state-dependent selectors.
MozReview-Commit-ID: VyHuxh9q5N
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-23 09:51:24 +01:00
Emilio Cobos Álvarez
2b99c76052
Bug 1349553: Add a bit of debugging information to the preprocess_children stage.
MozReview-Commit-ID: 7zv62MRX8dE
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-23 09:51:22 +01:00
bors-servo
d4d8293f22 Auto merge of #16092 - bholley:specified_urls, r=emilio
Handle URLs more efficiently in stylo

Approved in https://bugzilla.mozilla.org/show_bug.cgi?id=1347435

<!-- 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/16092)
<!-- Reviewable:end -->
2017-03-22 19:13:07 -07:00
Bobby Holley
63e8367eee Don't resolve URLs at parse time for Stylo.
It's a bit unfortunate the use separate implementations of SpecifiedUrl for Servo
and Gecko, but they're different enough at this point that I don't think it really
makes sense to try to share everything. Splitting them out has some nice
simplifications as well.

I recognize that there's still some potential correctness issues for Servo using
the resolved URI in various places where the original URI may be the right thing,
but I've got too much on my plate to look into that for now.

MozReview-Commit-ID: BeDu93TQ4Ow
2017-03-22 19:11:30 -07:00
Bobby Holley
16e04046b5 Use a wrapper class to maintain the mBinding invariant and stop resolving during the cascade. 2017-03-22 18:10:47 -07:00
Boris Zbarsky
5a5a6cd876 Implement :required/:optional support for stylo.
Servo side of https://bugzilla.mozilla.org/show_bug.cgi?id=1349659
2017-03-22 20:20:17 -04:00
bors-servo
e0f1855c10 Auto merge of #16088 - mbrubeck:always-be-updating, r=emilio
Update parking_lot_core and smallvec

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they update third-party code only

<!-- 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/16088)
<!-- Reviewable:end -->
2017-03-22 16:21:28 -07:00
Matt Brubeck
822d4803bc Update parking_lot_core and smallvec 2017-03-22 14:55:49 -07:00
Boris Zbarsky
5415e8aa4c Use less fragile and more readable numbering for ElementState. 2017-03-22 16:23:16 -04:00
bors-servo
4715d3cd37 Auto merge of #16081 - methyl:grip-gap-shorthand, r=Manishearth
Stylo: Add grid-gap shorthand

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

Should I add any tests?

<!-- 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/16081)
<!-- Reviewable:end -->
2017-03-22 10:43:10 -07:00
Lucjan Suski
6eba65361d Stylo: Add grid-gap shorthand 2017-03-22 18:15:55 +01:00
Matt Brubeck
dbfb3813f6 Bug 1337068 - stylo: :empty, :-moz-first-node, :-moz-last-node, and :-moz-only-whitespace. 2017-03-22 08:18:47 -07:00
bors-servo
2fcbdb62f7 Auto merge of #16076 - methyl:grid-auto-flow-glue, r=Wafflespeanut
Stylo: Add gecko glue for grid-auto-flow

- [x] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #16025 (github issue number if applicable).
- [x] These changes do not require tests because we don't test gecko glue code

<!-- 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/16076)
<!-- Reviewable:end -->
2017-03-22 04:57:21 -07:00
Emilio Cobos Álvarez
a9b133bcbb
Bug 1345950: stylo: Fix slow selector flags. r=bholley
MozReview-Commit-ID: QwuSxulNG0
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-22 11:21:24 +01:00
Lucjan Suski
99aee290db Stylo: Add gecko glue for grid-auto-flow 2017-03-22 11:09:23 +01:00
bors-servo
cb1438e44f Auto merge of #15813 - canaltinova:will-change, r=upsuper,emilio
Implement parsing/serialization and glue for will-change property

Implement parsing/serialization  and glue for will-change property

---
<!-- 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 #15706 (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/15813)
<!-- Reviewable:end -->
2017-03-21 21:56:23 -07:00
Manish Goregaokar
f2f832d1d9 stylo: Support all non-ts pseudos with an argument 2017-03-21 12:33:57 -07:00