Commit graph

6718 commits

Author SHA1 Message Date
Simon Sapin
460fd6eba8 Deduplicate declarations when inserting each one, not at the end of parsing.
This will reduce the amount of re-allocations and copies.
It will be further optimized with a bit map.
2017-03-07 23:37:30 +01:00
Simon Sapin
4b4a873c3e Move parse method of PropertyDeclaration to ParsedDeclaration
This is what it now returns.
2017-03-07 23:37:29 +01:00
Simon Sapin
9d663ea7af Make PropertyDeclaration::parse return an enum rather than push to a Vec. 2017-03-07 23:37:29 +01:00
Simon Sapin
8160490272 Remove some unused impls. 2017-03-07 23:37:28 +01:00
Simon Sapin
7455ad5eb4 PropertyDeclarationParseResult -> Result<(), PropertyDeclarationParseError> 2017-03-07 23:37:27 +01:00
Simon Sapin
da6316fbe3 Return shorthand decarations as a new enum, don’t push them to a Vec. 2017-03-07 23:37:26 +01:00
bors-servo
b11847d86c Auto merge of #15837 - upsuper:bug1344135, r=emilio
Return true in set_property only when declaration block is changed

This is [bug 1344135](https://bugzilla.mozilla.org/show_bug.cgi?id=1344135).

<!-- 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/15837)
<!-- Reviewable:end -->
2017-03-07 13:51:33 -08:00
Hiroyuki Ikezoe
6503717c20 Skip animation and transition process in servo side.
Otherwise they trigger their animations and transitions.
We will introduce gecko's own process in bug 1341985 (animations) and
bug 1341372 (transitions).
2017-03-07 13:27:55 +09:00
Hiroyuki Ikezoe
16cba0876d Pass transition-property into gecko's struct. 2017-03-07 13:27:49 +09:00
Hiroyuki Ikezoe
3616e4240f Pass transition-timing-function into gecko struct. 2017-03-07 13:27:44 +09:00
Hiroyuki Ikezoe
d61a2ff29e Make a macro for timing function. 2017-03-07 13:27:39 +09:00
Hiroyuki Ikezoe
40822f9575 Pass transition-delay and transition-duration into gecko struct. 2017-03-07 13:27:32 +09:00
Hiroyuki Ikezoe
e340d37a9f Modify some macro for animations to be able to use for transition properties as well. 2017-03-07 13:26:48 +09:00
Hiroyuki Ikezoe
96dbc9849d ensure_len() for nsStyleAutoArray<StyleTransition>. 2017-03-07 13:26:03 +09:00
Hiroyuki Ikezoe
e5386ed7aa Update bindgens. 2017-03-07 13:24:01 +09:00
bors-servo
1d497857e8 Auto merge of #15836 - upsuper:animation, r=emilio,bholley
Fix animation shorthand parsing (again)

This is from [bug 1343168](https://bugzilla.mozilla.org/show_bug.cgi?id=1343168) and mostly same as #15793 which was backed out in #15814.

<!-- 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/15836)
<!-- Reviewable:end -->
2017-03-06 19:24:01 -08:00
avinash
f48f0567cf Add ServoUrl as a parameter to report_error(...) of ParseErrorReporter
passes test-tidy
removed match and used map

added new test test_report_error_passing_correct_url(...) and modified old unit tests

removed the option for servourl and tidied up

removed the duplicate test.

made a few more changes after @cbrewster suggestions.

changed _url to url in few places

fixed the indenting
2017-03-06 09:06:42 -06:00
Xidorn Quan
4f07826837 Return true in set_property only when declaration block is changed 2017-03-06 22:21:59 +11:00
Xidorn Quan
cd22bcd506 Treat empty animation entry invalid 2017-03-06 22:01:55 +11:00
Xidorn Quan
97f2ccacbb Parse none as just a normal animation item 2017-03-06 22:01:37 +11:00
Xidorn Quan
6b03760213 Simplify animation shorthand parsing code 2017-03-06 22:01:15 +11:00
Xidorn Quan
bfa847bad7 Allow animation-name to be omitted from shorthand 2017-03-06 22:00:55 +11:00
Xidorn Quan
d2bb111ff2 Add / fix get_initial_specified_value for animation longhands 2017-03-06 22:00:29 +11:00
Xidorn Quan
6273fa0305 Make animation-name parse none 2017-03-06 22:00:04 +11:00
Xidorn Quan
4bc0cac395 Replace assert! in animation code with debug_assert! 2017-03-06 21:58:08 +11:00
bors-servo
511b82eea3 Auto merge of #15465 - austinprete:caret-color, r=Wafflespeanut
Implement parsing/serialization for caret-color

<!-- Please describe your changes on the following line: -->
This pull request implements parsing and serialization for the caret-color CSS property, per issue #15309 .

---
<!-- 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 #15309

<!-- 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/15465)
<!-- Reviewable:end -->
2017-03-05 23:53:26 -08:00
Emilio Cobos Álvarez
dffba35d83
style: Remove unneeded indirection in LonghandsToSerialize. 2017-03-06 08:04:22 +01:00
Jyotsna Prakash
27b60135be replace match with if-let 2017-03-05 17:52:39 -08:00
austinprete
a2074f2653 Implement parsing/serialization for caret-color 2017-03-05 10:52:32 -07:00
bors-servo
8c4931f26f Auto merge of #15702 - shubDhond:master, r=upsuper
Invalid three value positions are no longer accepted

<!-- Please describe your changes on the following line: -->
- Position parse no longer accepts invalid three value positions

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

<!-- 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/15702)
<!-- Reviewable:end -->
2017-03-04 03:11:44 -08:00
Manish Goregaokar
58d32b284a Support more XUL properties 2017-03-03 17:22:08 -08:00
Bobby Holley
3a56899201 Revert "Auto merge of #15793 - upsuper:animation, r=emilio,bholley"
This reverts commit 7cd4c69c40, reversing
changes made to 1b1fadb8b8.
2017-03-03 11:50:15 -08:00
bors-servo
c32181c6db Auto merge of #15809 - emilio:nsstuff, r=emilio
stylo: Backport rust-nsstring crash fixes to the vendored version.

<!-- 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/15809)
<!-- Reviewable:end -->
2017-03-03 09:15:15 -08:00
Emilio Cobos Álvarez
feac01f793
stylo: Backport rust-nsstring crash fixes to the vendored version. 2017-03-03 17:33:55 +01:00
Karan Singh
3d5b607ba5 Add remaining keyword values of -moz-user-select (fixes #15197) 2017-03-03 16:13:54 +01:00
bors-servo
7cd4c69c40 Auto merge of #15793 - upsuper:animation, r=emilio,bholley
Fix animation shorthand parsing

which is somehow broken after #15779.

But it seems there are various issue around the animation shorthand parsing, so I try to fix it to make it match the spec.

I expect this change to fix most parsing failures in Gecko's test suite, although I haven't tested.

<!-- 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/15793)
<!-- Reviewable:end -->
2017-03-03 03:28:21 -08:00
Xidorn Quan
53027723ae Parse none as just a normal animation item 2017-03-03 16:12:11 +11:00
Xidorn Quan
1bb1eeeb53 Simplify animation shorthand parsing code 2017-03-03 16:12:09 +11:00
Xidorn Quan
a06b3f2039 Allow animation-name to be omitted from shorthand 2017-03-03 16:12:08 +11:00
Xidorn Quan
88772f9cb9 Add / fix get_initial_specified_value for animation longhands 2017-03-03 16:12:07 +11:00
Xidorn Quan
550c64cbf2 Make animation-name parse none 2017-03-03 16:12:06 +11:00
Emilio Cobos Álvarez
71997e6ed9
style: Remove unused goal field from SharedStyleContext. 2017-03-03 03:46:10 +01:00
Emilio Cobos Álvarez
b4daadf7f2
style: Remove unused screen_size_changed layout context field. 2017-03-03 01:01:44 +01:00
Xidorn Quan
deb1b0aea6 Replace assert! in animation code with debug_assert! 2017-03-03 10:25:19 +11:00
bors-servo
d0856fd4cd Auto merge of #15791 - emilio:hint, r=bholley
Bug 1340334: Allow sibling hints in StoredRestyleHint, and handle them correctly.

Reviewed upstream by Bobby.

<!-- 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/15791)
<!-- Reviewable:end -->
2017-03-01 18:08:43 -08:00
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
Xidorn Quan
4bc0fbeeb1 Impl ToCss on LonghandsToSerialize directly 2017-03-02 11:10:30 +11:00
Xidorn Quan
f327b2fc73 Make LonghandsToSerialize store reference to specified value
This significantly simplify the code.
2017-03-02 11:09:06 +11:00
Xidorn Quan
2cc6593fa1 Don't serialize shorthand when some but not all of its longhands are CSS-wide keyword
Shorthand cannot represent CSS-wide keyword in individual longhands, and
thus we cannot serialize longhand with CSS-wide keyword as part of a
shorthand.
2017-03-02 11:09:05 +11:00
Xidorn Quan
03f6d21cb5 Make DeclaredValue store CSSWideKeyword
Rather than having separate variant for each CSS-wide keyword.
2017-03-02 11:09:05 +11:00