Commit graph

4994 commits

Author SHA1 Message Date
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
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
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
Emilio Cobos Álvarez
eb08145b17
style: Update bindings. 2017-07-31 12:26:46 +02:00
Emilio Cobos Álvarez
c0922dabb6
style: Fix dynamic change handling of justify-items legacy values.
Bug: 1384542
Reviewed-by: heycam
MozReview-Commit-ID: NEPGlL4ri7
2017-07-31 11:55:06 +02:00
Emilio Cobos Álvarez
0e4c7c3722
style: Standardize different methods to inherit and reset properties.
This avoids special-casing justify-items.

MozReview-Commit-ID: FoEs2IHC1t6
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-07-31 11:55:05 +02:00
Emilio Cobos Álvarez
2d9255bff1
style: Get rid of GetParentAllowServo in implementation of CSS 'justify-items' property.
Bug: 1384542
Reviewed-by: heycam
MozReview-Commit-ID: 4qydjqSoVXs
2017-07-31 11:55:04 +02:00
Xidorn Quan
fbb569b0f2 Update binding files. 2017-07-31 14:32:08 +10:00
Xidorn Quan
a59fceeefc Handle device-pixel-ratio-webkit pref correctly. 2017-07-31 14:06:45 +10:00
Xidorn Quan
d34d662b82 Replace IsFramesTimingEnabled FFI function with direct pref cache access. 2017-07-31 14:06:37 +10:00
Xidorn Quan
e580b8acd8 Update binding files. 2017-07-30 20:15:42 +10:00
Cameron McCormack
4f525f6fa0 style: Preserve font-family identifier sequence when serializing. 2017-07-30 13:53:34 +08:00
Alan Jeffrey
d101f9c945 Implemented paint worklet arguments. 2017-07-29 15:32:13 -05:00
Cameron McCormack
9c0ce7847f style: Don't remain in an invalid state when encountering an at-rule in the wrong place.
Currently, attempting to parse an at-rule that is out of place, such as
an @import rule after a regular style rule, will cause the parser state
to be set to Invalid.  This will cause any following at-rule to be
rejected until we encounter a regular style rule, at which point we'll
go back to the Body state.  There's nothing in the CSS specs about
needing to reject all following at-rules (or, as the comment above
Invalid says, ignoring the entire rest of the style sheet).
2017-07-29 21:01:35 +08:00
bors-servo
6b320eaad3 Auto merge of #17906 - emilio:calc-bgsize, r=hiro,birtles
style: Don't unconditionally generate Calc values when converting background-size from Gecko.

Bug: 1385140
MozReview-Commit-ID: ERwq50WSvLV

<!-- 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/17906)
<!-- Reviewable:end -->
2017-07-29 06:41:27 -05:00
Xidorn Quan
dd2b851f93 Remove Gecko_GetMediaFeatures and access nsMediaFeatures::features directly. 2017-07-29 20:20:33 +10:00
Corey Farwell
befe538472 Utilize match_ignore_ascii_case! in more places. 2017-07-29 09:58:09 +00:00
bors-servo
dde1f46e16 Auto merge of #17911 - hiikezoe:rotate-to-matrix, r=canaltinova
Fix rotate_to_matrix

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

---
- [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/17911)
<!-- Reviewable:end -->
2017-07-29 01:01:10 -05:00
bors-servo
9eed902d2e Auto merge of #17903 - BorisChiou:stylo/animation/interpolatematrix_to_css, r=birtles
stylo: Implement ToCss for SpecifiedOperation::{InterpolateMatrix|AccumulateMatrix}.

DevTools may serialize an InterpolateMatrix or AccumulateMatrix by
KeyframeEffectReadOnly::GetProperties() (from Gecko side), so we have to implement both.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1381386](https://bugzilla.mozilla.org/show_bug.cgi?id=1381386).
- [X] These changes do not require tests because only Chrome-Only API needs this, and the serialization of InterpolateMatrix and AccumulateMatrix are not in the spec.

<!-- 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/17903)
<!-- Reviewable:end -->
2017-07-28 23:55:55 -05:00
bors-servo
ed75bcae75 Auto merge of #17912 - bzbarsky:stylo-first-line, r=emilio
Implement ::first-line support in stylo

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

Fixes Gecko bug 1324619.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because there are Gecko tests

<!-- 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/17912)
<!-- Reviewable:end -->
2017-07-28 22:51:20 -05:00
Boris Zbarsky
c531af96ae Make sure we don't recreate boxes just because we have a ::first-line.
Servo part of part 5 of the fix for Gecko bug 1324619.  r=emilio
2017-07-28 22:54:06 -04:00