Commit graph

14696 commits

Author SHA1 Message Date
Ting-Yu Lin
e80cb09be3 stylo: Fix pseudo element matching for XBL stylesheets (Bug 1371577)
MozReview-Commit-ID: GzWbztqW0V1
2017-06-14 17:58:15 +08:00
bors-servo
c6da6ba060 Auto merge of #17310 - chenpighead:stylo-font-variant, r=xidorn
stylo: support font-variant shorthand

From gecko bug: [Bug 1356134](https://bugzilla.mozilla.org/show_bug.cgi?id=1356134)

<!-- 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/17310)
<!-- Reviewable:end -->
2017-06-13 22:23:21 -07:00
Jeremy Chen
c7c753867b stylo: support font-variant shorthand.
We still count on Bug 1356124 to fix font-variant-alternates longhand, so we
can get font-variant shorthand work properly.

Some comments about Bug 1356124 have been removed, since this shorthand code
should just work once we fix Bug 1356124.

From gecko bug: Bug 1356134 (https://bugzilla.mozilla.org/show_bug.cgi?id=1356134)
2017-06-14 12:42:10 +08:00
bors-servo
3e0d70ba37 Auto merge of #17306 - mantaroh:paced, r=birtles
Return zero when computing distance of Option with both value is none.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1371480

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

<!-- Either: -->
There are tests for these changes, a test case will be landed in reftests in https://bugzilla.mozilla.org/show_bug.cgi?id=1371480

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17288)
<!-- Reviewable:end -->
2017-06-13 21:28:48 -07:00
Jeremy Chen
97ef40ee88 stylo: make font-variant-* longhands parsing more tolerant.
Avoid early returning Err() in parsers, so we could let the the caller
of the parsers to handle the rest of input, and return error if it requires
parsing entirely.

The point is let returning Err() stay inside input.try(), so we can count
on input.try() to restore the position when parsing invalid idents.

From gecko bug: Bug 1356134 (https://bugzilla.mozilla.org/show_bug.cgi?id=1356134)
2017-06-14 12:22:37 +08:00
bors-servo
5b3fb62b09 Auto merge of #17305 - hiikezoe:restyle-kind-fix, r=emilio
Don't process RestyleKind::MatchAndCascade during animation-only rest…

…yle.

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1372335

---
- [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 it's for stylo

<!-- 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/17305)
<!-- Reviewable:end -->
2017-06-13 20:28:18 -07:00
Mantaroh Yoshinaga
95b272d9aa Return zero when computing distance of Option with both value is none. 2017-06-14 11:03:53 +09:00
Hiroyuki Ikezoe
8d519011d8 Don't process RestyleKind::MatchAndCascade during animation-only restyle. 2017-06-14 10:51:53 +09:00
Hiroyuki Ikezoe
6c5915068a AllowedNumericType.is_ok() takes ParingMode as well.
And it returns true if ParsingMode.allows_all_numeric_values is true regardless
of AllowedNumericType itself.
2017-06-14 09:52:06 +09:00
Hiroyuki Ikezoe
7341574b66 Make AllowedLengthType.is_ok() returning true if parsing mode allows all numeric values.
Even if the type is NonNegative and the given value is a negative.
2017-06-14 09:51:54 +09:00
Hiroyuki Ikezoe
8bfed4cb3c Move ParsingMode into style_traits. 2017-06-14 09:51:36 +09:00
bors-servo
849bdc958c Auto merge of #17294 - emilio:less-refcount-churn, r=bholley
style: Less refcount churn while inserting in the rule tree.

There's no need for it since we know no GC is happening while we're doing it.

<!-- 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/17294)
<!-- Reviewable:end -->
2017-06-13 13:01:16 -07:00
Emilio Cobos Álvarez
46d4128d1f
style: Less refcount churn while inserting in the rule tree.
There's no need for it since we know no GC is happening while we're doing it.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-06-13 22:00:22 +02:00
bors-servo
6db2354b73 Auto merge of #17298 - asajeffrey:script-more-debug-impls, r=mbrubeck
Added Debug implementations.

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

Added enough `Debug` implementations to be able to debug script thread message processing.

---
<!-- 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 do not require tests because we don't test debugging

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17298)
<!-- Reviewable:end -->
2017-06-13 10:31:25 -07:00
bors-servo
fe573c1ce9 Auto merge of #17299 - servo:derive-all-the-things, r=emilio
Revert "Derive ToCss for MozImageRect"

This reverts commit fe19c3810c.

<!-- 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/17299)
<!-- Reviewable:end -->
2017-06-13 09:31:19 -07:00
Anthony Ramine
8eec24cd46 Revert "Derive ToCss for MozImageRect"
This reverts commit fe19c3810c.
2017-06-13 18:00:29 +02:00
Alan Jeffrey
a47e94c8f6 Added Debug implementations. 2017-06-13 10:46:59 -05:00
bors-servo
c4d7a3d95c Auto merge of #17296 - canaltinova:pseudo-quirk, r=bholley
Handle PseudoElement cases in :active and :hover quirk

Reviewed by bholley in bugzilla bug.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1371963](https://bugzilla.mozilla.org/show_bug.cgi?id=1371963)

<!-- 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/17296)
<!-- Reviewable:end -->
2017-06-13 08:34:04 -07:00
bors-servo
8c2a7d6787 Auto merge of #17278 - asajeffrey:canvas-clear-webrender-image-key-when-resizing, r=emilio
Clear webrender image id when resizing a canvas.

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

Webrender isn't very happy if images change size, so clear the webrender image key when resizing a canvas.

---
<!-- 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 #17277
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17278)
<!-- Reviewable:end -->
2017-06-13 07:38:12 -07:00
Alan Jeffrey
4e04daa9d0 Clear webrender image id when resizing a canvas. 2017-06-13 09:30:26 -05:00
Nazım Can Altınova
57d02dc0e9
Handle PseudoElement case in :active and :hover quirk 2017-06-13 17:22:39 +03:00
bors-servo
682af8bb19 Auto merge of #17293 - servo:derive-all-the-things, r=emilio
Derive two more ToCss impls

<!-- 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/17293)
<!-- Reviewable:end -->
2017-06-13 06:36:12 -07:00
bors-servo
07f6e11485 Auto merge of #17292 - emilio:better-style-invalidation, r=heycam
style: Implement a more fine-grained invalidation method.

<!-- 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/17292)
<!-- Reviewable:end -->
2017-06-13 04:56:09 -07:00
Emilio Cobos Álvarez
30252ee829
style: Update bindings.
MozReview-Commit-ID: K7X7EyYR2X
2017-06-13 13:27:11 +02:00
Emilio Cobos Álvarez
6b0f4c0410
style: Move one-off checks out of the recursive invalidation function.
There isn't a need to pay the cost for them multiple times.

Bug: 1372068
MozReview-Commit-ID: 3K2mRcWTheJ
2017-06-13 13:27:09 +02:00
Emilio Cobos Álvarez
36bac58863
style: Don't try to go down the tree if there aren't invalidations.
This can happen when adding an empty stylesheet, for example.

Bug: 1372068
MozReview-Commit-ID: Jtm4eJBWjEA
2017-06-13 13:27:08 +02:00
Emilio Cobos Álvarez
4434509088
style: Add an AllLinksVisitedAndUnvisited for invalidation.
Otherwise, tests like the following fail, given we always match as unvisited,
and we'd never mark the link as needing invalidation.

<!doctype html>
<style>
a {
  color: red !important;
}

.foo :visited {
  color: green !important;
}
</style>
<div>
  <a href="https://google.es">visit me</a>
  <button onclick="this.parentNode.className = 'foo'">Then click me</button>
</div>

Bug: 1368240
MozReview-Commit-ID: LDv6S28c4ju
2017-06-13 13:27:06 +02:00
Emilio Cobos Álvarez
fdf9093466
style: Add missing visitedness check while invalidating elements.
This is needed for the omta test to pass. This is pretty much the equivalent to
the old restyle hints code.

Bug: 1368240
MozReview-Commit-ID: BLUfw5Wxpxd
2017-06-13 13:27:02 +02:00
Emilio Cobos Álvarez
14bb57c08f
style: Properly handle invalidation of eager pseudo-elements.
Bug: 1368240
MozReview-Commit-ID: EkzDVhC3GPH
2017-06-13 13:26:46 +02:00
Emilio Cobos Álvarez
cb06375fe2
style: Implement a more fine-grained invalidation method.
This commit also removes the old restyle_hints module and splits it into
multiple modules under components/style/invalidation/element/.

The basic approach is to walk down the tree using compound selectors as needed,
in order to do as little selector-matching as possible.

Bug: 1368240
MozReview-Commit-ID: 2YO8fKFygZI
2017-06-13 13:26:41 +02:00
Cameron McCormack
e314dbb4ac style: Don't skip style attributes on NAC. 2017-06-13 17:44:33 +08:00
Anthony Ramine
53b465895f Derive ToCss for EndingShape 2017-06-13 11:29:46 +02:00
Anthony Ramine
fe19c3810c Derive ToCss for MozImageRect 2017-06-13 11:29:25 +02:00
Emilio Cobos Álvarez
fd10729941
style: Also print the class name when logging elements.
Bug: 1368240
MozReview-Commit-ID: 1MSn4rty5RL
2017-06-13 10:59:17 +02:00
Emilio Cobos Álvarez
151b636562
style: Add a way to match a single compound selector.
Also improve the ergonomics of matches_complex_selector.

Bug: 1368240
MozReview-Commit-ID: 9DWDvyZmetM
2017-06-13 10:58:47 +02:00
Emilio Cobos Álvarez
262f6adc30
Record whether an snapshot is recording a class attribute change or id change.
I'll use this information in order to get fewer dependencies out of the
dependency set.

Bug: 1368240
MozReview-Commit-ID: 5HlmKmSNO8p
2017-06-13 10:57:43 +02:00
Anthony Ramine
f658215f12 Fix Animatable impl for LengthOrPercentageOrNone 2017-06-13 10:19:23 +02:00
Anthony Ramine
43a5257a0c Introduce #[css(function)] for #[derive(ToCss)]
Any variant with this attribute gets serialised as a CSS function,
using the variant name as the function name.
2017-06-13 10:19:23 +02:00
Anthony Ramine
fd1ab75af9 Derive ToCss for ShapeRadius<L> 2017-06-13 10:19:23 +02:00
bors-servo
8449eb4a62 Auto merge of #17285 - heycam:newly-bound, r=bholley
geckolib: Don't panic when attempting to restyle an element with newly applied XBL bindings.

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

<!-- 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/17285)
<!-- Reviewable:end -->
2017-06-12 18:46:41 -07:00
Cameron McCormack
f989a2c21c style: Update Gecko bindings. 2017-06-13 08:30:45 +08:00
Xidorn Quan
cdc537f23e Bug 1331291 part 1 - Set stylesheet url_data correctly for import rule. 2017-06-13 10:07:06 +10:00
Simon Sapin
138c03b24d Stylo: avoid atom refcount traffic in ID selector matching 2017-06-13 00:51:41 +02:00
Simon Sapin
b82713924c Pre-compute classes and IDs case-sensitivity 2017-06-13 00:36:12 +02:00
Simon Sapin
9316c41bf7 Make MatchingContext::quirks_mode field private, add read-only accessor. 2017-06-13 00:35:56 +02:00
Simon Sapin
700aaf2bd6 Move MatchingContext to a new module 2017-06-13 00:31:29 +02:00
Simon Sapin
c5c1c1b350 Classes/IDs case-sensitivity: get quirks mode from matching context. 2017-06-13 00:27:41 +02:00
Simon Sapin
5bccf98aa4 ID and class selectors are ASCII case-insensitive in quirks mode.
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
2017-06-12 23:33:53 +02:00
Simon Sapin
524fcac191 Add Atom::to_ascii_lowercase 2017-06-12 23:33:15 +02:00
bors-servo
75d6796cbd Auto merge of #17281 - bholley:shrink_rule_again, r=emilio
Pack bloom filter hashes better and save a word on Rule

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

<!-- 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/17281)
<!-- Reviewable:end -->
2017-06-12 12:41:39 -07:00