Commit graph

2316 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
32bf8093cc
Bug 1340334: Allow sibling hints in StoredRestyleHint, and handle them correctly. r=bholley
MozReview-Commit-ID: H6NuKsfjEdj
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-02 03:05:56 +01:00
Simon Sapin
288ef97055 Update cssparser for https://github.com/servo/rust-cssparser/pull/123 2017-02-28 17:16:36 +01:00
bors-servo
7ee6294922 Auto merge of #15761 - upsuper:shorthand, r=Manishearth
Have shorthand parsing functions not return Option for their longhands

<!-- 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/15761)
<!-- Reviewable:end -->
2017-02-27 23:08:33 -08:00
Xidorn Quan
e850d9572a Don't serialize currentcolor for border shorthand 2017-02-28 17:17:54 +11:00
Xidorn Quan
f33b0b4ea3 Have shorthand parsing functions return values
Shorthands are responsible to set all its longhands to a proper value,
rather than returning None.

Fixes #15380.
2017-02-28 15:24:08 +11:00
Xidorn Quan
2e07ce7e84 Add get_initial_specified_value to many longhands 2017-02-28 15:20:34 +11:00
Xidorn Quan
ce46e6d034 Remove raw_longhand helper function 2017-02-28 13:45:12 +11:00
Xidorn Quan
b24614f894 Resolve color:currentcolor during computing
The keyword value "currentcolor" should be preserved rather than being
replaced by the CSS-wide keyword "inherit" during parsing.
2017-02-28 13:44:50 +11:00
bors-servo
4b39431215 Auto merge of #15464 - KiChjang:pseudo-lang, r=emilio
Support lang pseudo class

Fixes #8219.

<!-- 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/15464)
<!-- Reviewable:end -->
2017-02-27 17:21:50 -08:00
Keith Yeung
7456bcf02b Support lang pseudo class 2017-02-27 17:21:20 -08:00
bors-servo
cecbc33c01 Auto merge of #15742 - emilio:stylo-orig-display, r=bzbarsky
stylo: Fix adjustment of the display property to save mOriginalDisplay properly.

r? @heycam

<!-- 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/15742)
<!-- Reviewable:end -->
2017-02-27 07:54:30 -08:00
bors-servo
b2539090fa Auto merge of #15613 - Varentsov:master, r=upsuper
fix {transform,perspective}-origin accepts (and ignores) anything for…

… their second part of value

<!-- 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
- [X] These changes fix #15487.

<!-- Either: -->
- [X] There are tests for these changes OR

<!-- 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/15613)
<!-- Reviewable:end -->
2017-02-26 17:40:23 -08:00
bors-servo
3086b3d291 Auto merge of #15733 - absoludity:fix-background-serialization, r=upsuper
Background serialization of multiple values.

Similar to animation, the serialization of multiple backgrounds should
return the longhands serialization if there are an unequal number of
values for the required properties. This is part of #15398

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

<!-- 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/15733)
<!-- Reviewable:end -->
2017-02-26 16:54:11 -08:00
Simon Sapin
d007eef5c7 Remove some accessors for public fields.
(Maybe they date from this was a trait?)
2017-02-26 19:24:51 +01:00
Simon Sapin
e0c63efe01 Remove/don’t call no-op compute_font_hash method for stylo.
This removes a potentially-costly Arc::mut call.
2017-02-26 19:24:51 +01:00
Simon Sapin
4ad844f7bd Rename PropertyBitField to LonghandIdSet 2017-02-26 19:24:50 +01:00
Simon Sapin
c81ebca7df Move PropertyBitField out of its module 2017-02-26 19:02:55 +01:00
Simon Sapin
16a34ef6b6 Remove PropertyBitField::{get,set}_* methods 2017-02-26 19:02:54 +01:00
Simon Sapin
86562992da Cascade: skip duplicated properties before rather than after a virtual call. 2017-02-26 19:02:53 +01:00
Simon Sapin
0b4877590f Move deduplicate_property_declarations to PropertyDeclaration::deduplicate 2017-02-26 19:02:51 +01:00
Simon Sapin
066c5a01b2 Rewrite deduplicate_property_declarations to not require Mako. 2017-02-26 19:02:51 +01:00
Neck Varentsov
e165d1f885 fix {transform,perspective}-origin accepts (and ignores) anything for their second part of value 2017-02-26 20:54:14 +03:00
Emilio Cobos Álvarez
f695789aaa
stylo: Fix adjustment of the display property to save mOriginalDisplay properly. 2017-02-26 13:23:18 +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
2f996e34f5 Use ascii_case_insensitive_phf_map! in PropertyId::parse 2017-02-26 11:10:33 +01:00
Simon Sapin
33ef6f78e5 Update to cssparser 0.11 2017-02-26 11:09:53 +01:00
Michael Nelson
f5af381f19 Fixes serialization of multiple transitions.
Similar to animations and backgrounds, multiple transitions should be
serialized as a list of shorthand values only if the number of values
for each longhand property is the same. Otherwise we default to the
longhand serialization. Fixes #15398
2017-02-26 20:48:18 +11: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
Simon Sapin
4fa3e8e82c Replace 1-variant match_ignore_ascii_case! with expect_ident_matching 2017-02-26 10:39:10 +01:00
Simon Sapin
ba6d791ff5 Define keyword values in ASCII lowercase
The match_ignore_ascii_case! macro does ASCII-case-insensitive matching.
In cssparser verion 0.11, it will require its patterns to be already
lower case.
2017-02-26 10:38:07 +01:00
Manish Goregaokar
3721b8b6a9 Disallow keyword values in min/max-size properties in the block direction 2017-02-25 23:26:21 -08:00
Michael Nelson
3a812b02a6 Background serialization of multiple values.
Similar to animation, the serialization of multiple backgrounds should
return the longhands serialization if there are an unequal number of
values for the required properties.
2017-02-26 07:37:06 +11:00
bors-servo
eb281531f8 Auto merge of #15730 - emilio:adjust-float, r=SimonSapin
style: Adjust float if the element is positioned per CSS 2.1 section 9.7

We've found crashes related to this in Gecko.

r? @simonsapin or @heycam

<!-- 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/15730)
<!-- Reviewable:end -->
2017-02-25 12:23:36 -08: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
bors-servo
26de7c6bc4 Auto merge of #14740 - glasserc:extremum-length, r=Manishearth
Add support for keyword values for min-width and max-width

This is a follow-up to #14432 which got closed and can no longer be re-opened.

This PR aims to add support for keyword-values max-content, min-content, fit-content, and fill-available to the properties that use them, namely min-width, min-height, max-width, and max-height.

It's still untested because I still haven't figured out how to do that. I guess I should write or find some web page that uses these properties.

Refs #13821.

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #13821  (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/14740)
<!-- Reviewable:end -->
2017-02-24 14:08:58 -08:00
Nazım Can Altınova
d7c227f614
Fix parsing of ClipRect 2017-02-25 00:10:43 +03:00
Ethan Glasser-Camp
dd4f331603 Add support for MaxLength
This builds on the ExtremumLength type from the previous commit.
2017-02-24 15:44:49 -05:00
Emilio Cobos Álvarez
e67f5c7585
style: Adjust float if the element is positioned per CSS 2.1 section 9.7
We've found crashes related to this in Gecko.
2017-02-24 21:28:56 +01:00
bors-servo
050d9d9097 Auto merge of #15710 - canaltinova:clip, r=emilio
Implement gecko glue for clip property

<!-- Please describe your changes on the following line: -->
Implemented gecko glue for clip property.

Clip property looks slightly different in gecko. `auto` top and left values are preserved as auto in [gecko](http://searchfox.org/mozilla-central/rev/39e4b25a076c59d2e7820297d62319f167871449/layout/style/nsRuleNode.cpp#10294,10316) but converted to 0 in [servo](https://dxr.mozilla.org/servo/rev/65624dbfc28442b58145215f524eb13aeb2cadf6/components/style/values/specified/mod.rs#942). Gecko is setting `NS_STYLE_CLIP_TOP_AUTO` and `NS_STYLE_CLIP_LEFT_AUTO` flags with that information. But I tried this property in stylo build and it is working correctly like this. It looks like it doesn't change the outcome of the property.
~Do we really need to set these flags?~
Manishearth and bz said that auto and 0 values are same.

---
<!-- 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 1341728](https://bugzilla.mozilla.org/show_bug.cgi?id=1341728)

<!-- Either: -->
- [X] These changes do not require tests because this is stylo side change.

<!-- 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/15710)
<!-- Reviewable:end -->
2017-02-24 07:44:48 -08:00
bors-servo
cd803afd1e Auto merge of #15691 - servo:moz-alt-content, r=bzbarsky
Stylo: add `content: -moz-alt-content`

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

Part of https://bugzilla.mozilla.org/show_bug.cgi?id=1341642

---
<!-- 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/15691)
<!-- Reviewable:end -->
2017-02-24 05:00:24 -08:00
Nazım Can Altınova
c3da55dd74
Implement gecko glue for clip property 2017-02-24 15:17:23 +03:00
Hiroyuki Ikezoe
bb3f2e9dba Drop Servo_AnimationValues_Populate. 2017-02-24 19:13:13 +09:00
Hiroyuki Ikezoe
b45e3f1011 Add RawGeckoComputedKeyframeValuesList in build_gecko.rs. 2017-02-24 19:13:04 +09:00
Hiroyuki Ikezoe
be29e8db00 Update bindings. 2017-02-24 19:12:54 +09:00
bors-servo
b52288af00 Auto merge of #15685 - absoludity:fix-animation-serialization-15398-pt2, r=upsuper
Fix animation serialization 15398 pt2

Fixes animation serialization so that an animation shorthand is serialized only when the value lists have the same length (part of #15398)

There are two commits here - the first is a refactoring to update PropertyDeclarationBlock::to_css to match the spec (please see the full commit message for perhaps too many details).

The second commit utilizes the changes in the first, and updates the animation serialization itself to write an empty serialization if the longhand value lists have different lengths, as per the original issue.
Interestingly, the refactoring of the first commit simplified quite a lot more than the fix for this bug, in particular, the special case of 'overflow' shorthand serialization is handled by default, without the extra special case code (now removed).

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15398 (github issue number if applicable).
- [X] There are tests for these changes OR

<!-- 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/15685)
<!-- Reviewable:end -->
2017-02-23 20:12:30 -08:00
bors-servo
f9f55789b8 Auto merge of #15712 - nox:rustc-serialize, r=metajack
Remove rustc-serialize from style and style_traits

<!-- 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/15712)
<!-- Reviewable:end -->
2017-02-23 19:19:34 -08:00
Michael Nelson
bcafe21dc9 Animation shorthand should be serialized only when the value lists have the same length.
Fixes #15398

The previous commit did most of the work here of updating the algorithm
to skip shorthands if a shorthand value was an empty string. This commit
just updates animations LonghandToSerialize's implementation of
to_css_declared to write an empty string value if the list lengths
differ (and updates the test to match).
2017-02-24 12:03:04 +11:00
bors-servo
1d13e6a2df Auto merge of #15700 - glennw:zoom-wip-2, r=mbrubeck
Introduce CSSPixel as a replacement for ViewportPx and PagePx.

<!-- 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/15700)
<!-- Reviewable:end -->
2017-02-23 16:01:16 -08:00
bors-servo
6c9e94b1c0 Auto merge of #15697 - glennw:border-image, r=jdm,pcwalton
Add support for most of the border-image properties, pass to WR.

This adds support for:
 * border-image (images, not gradients yet)
 * border-image-source
 * border-image-slice
 * border-image-repeat (stretch + repeat only for now)

Remaining work:
 * Connect border-image-outset (WR supports this).
 * 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/15697)
<!-- Reviewable:end -->
2017-02-23 13:40:40 -08:00
Ethan Glasser-Camp
76de979231 Implement a MinLength type
Implement an ExtremumLength type which contains all the enumerated
keyword values for min-width, min-height, max-width, and
max-height. Then, implement a MinLength which can be used for min-width
and min-height. So far this just maps to Gecko values.

Refs #13821.
2017-02-23 16:28:26 -05:00