Commit graph

15622 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2c97ec1832
stylo: Avoid recreating the stylist in RebuildAllStyleData.
Bug: 1386602
Reviewed-by: heycam
MozReview-Commit-ID: 31G9BLgqEmm
2017-08-03 16:34:10 +02:00
bors-servo
46f6e68bad Auto merge of #17960 - mrobinson:fix-warning-for-table-colgroup, r=emilio
Fix warning in scroll root id assignment to TableColGroupFlow

The traversal currently expects every flow to have a scroll root id
assigned, even if it doesn't produce any display items. This change
fixes the error that arises from this situation.

<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they do not change behavior, just fix a runtime warning.

<!-- 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/17960)
<!-- Reviewable:end -->
2017-08-03 07:51:22 -05:00
bors-servo
c18cac1f34 Auto merge of #17958 - aethanyc:pseudo-classes-chrome-privilege-bug1381851, r=heycam
Pseudo classes chrome privilege (bug 1381851)

This is reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1381851

<!-- 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/17958)
<!-- Reviewable:end -->
2017-08-03 06:56:01 -05:00
bors-servo
452268eca9 Auto merge of #17959 - emilio:no-moar-parent, r=heycam
style: Move nsStyleContext::mParent to GeckoStyleContext.

Unfortunately this means that we lose the NS_STYLE_INHERIT_BIT optimization to
avoid posting changes if we had not requested the struct. In practice, I'm not
sure this optimization matters much, though, and we already compare all the
structs anyway.

We _could_ keep a weak parent pointer from the text style if needed, given we're
going to keep alive the text style at least until the parent style context goes
away, so should be safe, but I don't think the extra churn is worth it, to be
honest. Happy to do so as part of bug 1368290 if you think it's worth it.

Bug: 1385896
Reviewed-by: heycam
MozReview-Commit-ID: ka6tNwf4Ke

<!-- 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/17959)
<!-- Reviewable:end -->
2017-08-03 05:50:18 -05:00
Emilio Cobos Álvarez
6c5cf5e2ec
style: Move nsStyleContext::mParent to GeckoStyleContext.
Unfortunately this means that we lose the NS_STYLE_INHERIT_BIT optimization to
avoid posting changes if we had not requested the struct. In practice, I'm not
sure this optimization matters much, though, and we already compare all the
structs anyway.

We _could_ keep a weak parent pointer from the text style if needed, given we're
going to keep alive the text style at least until the parent style context goes
away, so should be safe, but I don't think the extra churn is worth it, to be
honest. Happy to do so as part of bug 1368290 if you think it's worth it.

Bug: 1385896
Reviewed-by: heycam
MozReview-Commit-ID: ka6tNwf4Ke
2017-08-03 12:46:51 +02:00
bors-servo
24b2cd89c1 Auto merge of #17961 - upsuper:font-display-pref, r=heycam
Make font-display descriptor behind the pref

This is the Servo side change of [bug 1386871](https://bugzilla.mozilla.org/show_bug.cgi?id=1386871).

<!-- 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/17961)
<!-- Reviewable:end -->
2017-08-03 04:46:52 -05:00
Martin Robinson
815ed0c29c Fix warning in scroll root id assignment to TableColGroupFlow
The traversal currently expects every flow to have a scroll root id
assigned, even if it doesn't produce any display items. This change
fixes the error that arises from this situation.
2017-08-03 11:34:26 +02:00
Xidorn Quan
df95a469a0 Make font-display descriptor behind the pref. 2017-08-03 19:07:12 +10:00
bors-servo
27d1fbe7ea Auto merge of #17952 - bholley:drain_smallvec, r=emilio
Use drain() over IntoIter on a few SmallVecs

This is all the ones I could find in style/ and selectors/.

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

<!-- 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/17952)
<!-- Reviewable:end -->
2017-08-03 03:46:02 -05:00
Ting-Yu Lin
c9e2396f3b style: Update gecko bindings
MozReview-Commit-ID: 3jRR36CYAUg
2017-08-03 16:30:18 +08:00
Ting-Yu Lin
7b28e86501 style: Update comments for push_applicable_declarations_as_xbl_only_stylist()
MozReview-Commit-ID: 4ohpfiYgjxl
2017-08-03 16:30:13 +08:00
Ting-Yu Lin
585c00f235 style: Introduce Chrome UI privilege for parsers
The motivation is that Chrome XBL stylesheets can be parsed under author
level, but we allow some event-state pseudo classes like
:-moz-handled-clicktoplay to be used.

Also synchronize the privilege of pseudo classes in
non_ts_pseudo_class_list.rs and nsCSSPseudoClassList.h (except :fullscreen).

MozReview-Commit-ID: 8fUjjC8hbQO
2017-08-03 16:30:08 +08:00
Ting-Yu Lin
fd3b399d26 style: Rename PSEUDO_CLASS_INTERNAL to PSEUDO_CLASS_ENABLED_IN_UA_SHEETS
Some of the pseudo classes in nsCSSPseudoClassList are enabled only in UA
sheets but not in chrome. Rename the "internal" flag to "enabled in UA
sheets" to make the semantics clearer.

MozReview-Commit-ID: LKIiPk4pHFv
2017-08-03 16:30:03 +08:00
Fernando Jiménez Moreno
7fc3d59c0b stylo: serialize radial gradients computed value using modern unprefixed style 2017-08-03 09:33:28 +02:00
bors-servo
92b2c47fef Auto merge of #17950 - DarkDrek:downcast_to_is, r=jdm
Replace downcast with is

<!-- Please describe your changes on the following line: -->
I searched for all places where `if let Some(_) = self.downcast::` and replaced them with `::is`

---
<!-- 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
- [X] These changes fix #17697 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because `if let Some(_) = self.downcast::<Text>()` should be equivalent to `if self.is::<Text>()`

<!-- 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/17950)
<!-- Reviewable:end -->
2017-08-02 21:01:12 -05:00
bors-servo
32e2e546ac Auto merge of #17953 - nnethercote:bug-1383977, r=Manishearth
stylo: Measure Elements and ComputedValues.

This is for https://bugzilla.mozilla.org/show_bug.cgi?id=1383977.

<!-- Please describe your changes on the following line: -->
The patch provides FFI access to Gecko's SeenPtrs type from Rust, in
order to record what has already been measured when measuring Arcs. (The
SeenPtrs must be initialized on the Gecko side because the same table is
reused for measuring all Elements within a window, because Elements can
share ComputedValues.) I have confirmed with DMD that this is working
correctly.

The patch also introduces MallocSizeOfRepeats, which is like
MallocSizeOf but takes a SizeOfState, which holds a SeenPtrs table.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because testing is done on mozilla-central CI.

<!-- 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/17953)
<!-- Reviewable:end -->
2017-08-02 19:39:15 -05:00
bors-servo
45cba6a650 Auto merge of #17951 - hiikezoe:import-rule-check, r=emilio
Make replace_rules_internal return true only if important rules changed.

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

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

<!-- 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/17951)
<!-- Reviewable:end -->
2017-08-02 18:30:07 -05:00
Nicholas Nethercote
526e9691f8 stylo: Measure Elements and ComputedValues.
The patch provides FFI access to Gecko's SeenPtrs type from Rust, in
order to record what has already been measured when measuring Arcs. (The
SeenPtrs must be initialized on the Gecko side because the same table is
reused for measuring all Elements within a window, because Elements can
share ComputedValues.) I have confirmed with DMD that this is working
correctly.

The patch also introduces MallocSizeOfRepeats, which is like
MallocSizeOf but takes a SizeOfState, which holds a SeenPtrs table.
2017-08-03 09:15:38 +10:00
Bobby Holley
5a421d7c5f Use drain() over IntoIter on a few SmallVecs.
This is all the ones I could find in style/ and selectors/.
2017-08-02 15:42:57 -07:00
bors-servo
ba9bec6412 Auto merge of #17939 - emilio:multiple-walk-selector, r=bzbarsky
style: Avoid looping through every selector more than twice.

I've left the Invalidation stuff on its own since that's more complex, but I
think this may help a bit (perhaps not too much though?) with the slow rebuild
times.

<!-- 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/17939)
<!-- Reviewable:end -->
2017-08-02 17:35:57 -05:00
Emilio Cobos Álvarez
fc77f1fe31
style: Avoid looping through every selector more than twice.
I've left the Invalidation stuff on its own since that's more complex, but I
think this may help a bit (perhaps not too much though) with the slow rebuild
times.
2017-08-03 00:32:52 +02:00
Hiroyuki Ikezoe
07421a8e9c Make replace_rules_internal return true only if important rules changed. 2017-08-03 07:18:32 +09:00
bors-servo
e07beacd4d Auto merge of #17944 - hiikezoe:display-property-animation, r=emilio
Display property animation for SMIL

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

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

<!-- 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/17944)
<!-- Reviewable:end -->
2017-08-02 16:27:58 -05:00
DarkDrek
53476f2397 Replace downcast with is 2017-08-02 21:51:17 +02:00
bors-servo
3ef182ca36 Auto merge of #17945 - ferjm:typedef.dom.binding, r=jdm
Generate DOM bindings imports for webidl typedefs

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

<!-- 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/17945)
<!-- Reviewable:end -->
2017-08-02 13:22:32 -05:00
Manish Goregaokar
0e3f7d782b stylo: Disable text-zoom for <svg:text> 2017-08-02 10:25:55 -07:00
Manish Goregaokar
fb107d8cd5 stylo: Handle text-zoom for line-height 2017-08-02 10:25:43 -07:00
Manish Goregaokar
613012d9fb stylo: Handle text-zoom for scriptminsize 2017-08-02 10:25:27 -07:00
Manish Goregaokar
16d46eaf7a stylo: Handle text-zoom for font-size 2017-08-02 10:25:14 -07:00
Fernando Jiménez Moreno
354d94059b Generate DOM bindings imports for webidl typedefs 2017-08-02 13:15:45 +02:00
Hiroyuki Ikezoe
0841db70ee Set restyle subtree restyle hint if the element animates display style from 'none' to other.
When display style is changed from 'none' to other in animation-only restyle
we need to resolve descendant elements' style that were in the display:none
subtree.

Three possible ways to resolve the descendant elements' style;

1) Traversing unstyled elements in animation-only restyle
   We can't simply traverse unstyled elements in the animation-only restyle
   since when we decided to traverse the unstyled elements we don't know yet
   the elements will be initially styled or are in display:none subtree. It
   will result that the new elements are styled in animation-only restyle,
   it's undesirable.

2) Creating a SequentialTask and resolve the descendants' style with
   ServoStyleSet::StyleNewSubtree()
   We can't resolve the descendants' styles with ServoStyleSet::StyleNewSubtree()
   in SequentialTask since at the moment we are still in servo traversal (i.e.
   sInServoTraversal is true). That means AutoSetInServoTraversal fails
   in PrepareAndTraverseSubtree().

3) Creating a SequentialTask and set restyle subtree hint and defer descendants'
   restyle in a subsequent normal traversal
   Note that, when we process throttled animations flush, we don't process
   normal traversal so the descendants will not be traversed until normal
   restyle happens but it will not be a big problem since it's really rare
   that user clicks display animation element just at the right moment when
   display property changes from none to other.  Also, if it will be really
   a problem, we should process *only* transform animations on the compositor,
   it's ideally right thing to do. Display property never runs on the
   compositor.

This patch takes the third approach.
2017-08-02 18:35:01 +09:00
Hiroyuki Ikezoe
ffc01687e4 Move the logic for Servo_NoteExplicitHints into wrapper.rs.
In a subsequent patch in this series, we will call it from servo side.
2017-08-02 18:34:56 +09:00
bors-servo
de5f6f19bd Auto merge of #17943 - Manishearth:bump-au, r=emilio
Bump app units to 0.5.2

Prerequisite for landing text zoom stuff.

<!-- 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/17943)
<!-- Reviewable:end -->
2017-08-02 04:10:08 -05:00
Manish Goregaokar
507c20e2d9 Bump app units to 0.5.2 2017-08-02 01:24:37 -07:00
bors-servo
5fff90c73f Auto merge of #17883 - frewsxcv:frewsxcxv-lowercase, r=SimonSapin
Audit usages of unicode case-changing methods.

Part of https://github.com/servo/servo/issues/17777.

<!-- 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/17883)
<!-- Reviewable:end -->
2017-08-02 03:01:26 -05:00
Xidorn Quan
7a642dc952 Update binding files. 2017-08-02 10:35:20 +10:00
Xidorn Quan
ef4352d2a5 Add context-{fill,stroke}-opacity support to {fill,stroke}-opacity. 2017-08-02 10:35:18 +10:00
Xidorn Quan
7827ca6bb5 Make stroke-dasharray accept context-value. 2017-08-02 10:35:17 +10:00
Xidorn Quan
aa80859a71 Add SVGLength which accepts context-value, and use it for stroke-{width,dashoffset}. 2017-08-02 10:03:15 +10:00
Xidorn Quan
3991e7d344 Have CoordDataValue derive Debug and PartialEq. 2017-08-02 10:03:09 +10:00
Xidorn Quan
0071c7663f Add svg mods and move SVG-related types into them. 2017-08-02 10:03:08 +10:00
bors-servo
4d71eed898 Auto merge of #17929 - dadaa:make-grid-template-XX-animatable, r=hiro,waffles
Make grid-template-areas/columns/rows animatable

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

<!-- Either: -->
- [X] There are tests for these changes. The test code is patch 4 in https://bugzilla.mozilla.org/show_bug.cgi?id=1379922

<!-- 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/17929)
<!-- Reviewable:end -->
2017-08-01 16:34:50 -05:00
Boris Zbarsky
2e02487526 Don't start kicking off work units during parallel stylo traversal until they're actually full.
This improves style sharing at the cost of a bit less parallelism.  Fixes Gecko
bug 1385982.  r=bholley
2017-08-01 15:59:31 -04:00
Manish Goregaokar
38ce1d96b1 Remove doc comment on statement
rustc warns about these now
2017-08-01 10:48:17 -07:00
Emilio Cobos Álvarez
8eef60ae1f
stylo: Fix restyle hint conversion to handle eRestyle_ForceDescendants correcty. 2017-08-01 17:13:01 +01:00
Daisuke Akatsuka
f4bd93ea38 Make grid-template-columns/rows animatable 2017-08-01 17:13:42 +09:00
Daisuke Akatsuka
2250e79976 Support calc for fit-content() 2017-08-01 17:13:01 +09:00
Daisuke Akatsuka
4dcc2d1c9d Make grid-template-areas animatable 2017-08-01 17:12:23 +09:00
Josh Matthews
4b736354c4 Report an error for invalid CSS color values (bug 1381143). 2017-07-31 16:49:53 -04:00
Alan Jeffrey
936dd3ef63 Speculatively evaluate paint functions during style. 2017-07-31 13:02:28 -05:00