Commit graph

12801 commits

Author SHA1 Message Date
Matt Brubeck
b8dead37f6 Bug 1348487 - stylo: Don't allow combinators in :-moz-any. 2017-03-20 08:28:56 -07:00
Simon Sapin
d5074136e3 Rename ReadGuards to StylesheetGuards 2017-03-19 22:30:42 +01:00
Simon Sapin
2952ccfae2 Fix another deadlock 2017-03-19 22:30:41 +01:00
Simon Sapin
d9491187dc Parse stylesheets without acquiring a shared lock. 2017-03-19 22:30:40 +01:00
Simon Sapin
cc046300f0 Remove some indirection. 2017-03-19 22:30:39 +01:00
Simon Sapin
1e38013783 Refactor StylesheetLoader so impls do not need to acquire a shared lock.
This fixes a deadlock:
https://github.com/servo/servo/pull/16014#issuecomment-287527067
2017-03-19 22:30:39 +01:00
Simon Sapin
1bacd0eb15 Move all PropertyDeclarationBlock from RwLock<_> to Locked<_> 2017-03-19 22:30:38 +01:00
Simon Sapin
aeffca2a59 Replace RwLock<StyleRule> with Locked<StyleRule> 2017-03-19 22:30:37 +01:00
Simon Sapin
57724e5a37 Replace RwLock<Keyframe> with Locked<Keyframe> 2017-03-19 22:30:37 +01:00
Simon Sapin
adb97d4cbe Wrap most CSS rules in Locked<_> instead of RwLock<_> 2017-03-19 22:30:36 +01:00
Simon Sapin
f35b4e27b3 Replace RwLock<CssRules> with Locked<CssRules> 2017-03-19 22:30:35 +01:00
Simon Sapin
b213daaa88 Tidy 2017-03-19 22:30:34 +01:00
Simon Sapin
600152bd00 Replace more RwLock<MediaList> with shared_lock::Locked<MediaList> 2017-03-19 22:30:34 +01:00
Simon Sapin
fe4e70c5f8 Introduce a ToCssWithGuard trait 2017-03-19 22:30:33 +01:00
Simon Sapin
3ae2ecbec2 More lock acquire in callers 2017-03-19 22:30:32 +01:00
Simon Sapin
d18b1280f2 Move shared lock acquires up the call stack. (Or is it down?) 2017-03-19 22:30:32 +01:00
Simon Sapin
c5a7294e05 Replace RwLock<MediaList> with shared_lock::Locked<MediaList> 2017-03-19 22:30:31 +01:00
Simon Sapin
8feb9e8047 Add SharedRwLock<T> and Locked<T> 2017-03-19 22:30:24 +01:00
bors-servo
fbd561bc2f Auto merge of #15604 - zploskey:reset_font_shorthand_serialization, r=SimonSapin
serialize font: to empty on non-default subprops

Fixes font shorthand serialization so that it serializes to "" when non-default subproperties are defined. These subproperties are those defined in #15033.

Adds tests:
- font_should_serialize_to_empty_if_there_are_nondefault_subproperties
- font_should_serialize_all_available_properties

The second test was previously commented out and underwent some cleanup to make it run.

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

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

<!-- 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/15604)
<!-- Reviewable:end -->
2017-03-19 08:26:43 -07:00
Simon Sapin
a8ab65b869 Remove never-sent ReflowWithNewlyLoadedWebFont message, fix #16026 2017-03-19 09:07:54 +01:00
Zach Ploskey
cbaa6e262c Serialize font to "" on some nondefault properties
Fixes font shorthand serialization so that it serializes to "" when
certain subproperties of the font shorthand are set to non-default
values. These subproperties are:
- font-size-adjust
- font-kerning
- font-variant-caps
- font-variant-position
- font-language-override

Additionally, enable the above subproperties in the tests.
2017-03-19 00:16:19 -07:00
bors-servo
a2c33ac6e6 Auto merge of #16028 - canaltinova:pseudos-for-alt, r=Manishearth
Stylo: Add support for -moz-*  pseudo-classes for alt text

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

<!-- Either: -->
- [X] These changes do not require tests because they are stylo 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/16028)
<!-- Reviewable:end -->
2017-03-18 13:45:01 -07:00
George White
00da1eb810 Add parsing/serialisation for 'grid-auto-flow' 2017-03-18 23:38:31 +05:30
Nazım Can Altınova
d23cbd37b8
Stylo: Add support for -moz-* pseudo-classes for alt text 2017-03-18 19:46:53 +03:00
bors-servo
7fcba10614 Auto merge of #16023 - emilio:nits, r=emilio
style: Fix some nits

I was looking at the code that used Length for #16015, and found these two.

<!-- 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/16023)
<!-- Reviewable:end -->
2017-03-18 07:24:52 -07:00
Emilio Cobos Álvarez
60d340d76f
style: Remove outdated comment. 2017-03-18 15:05:26 +01:00
Emilio Cobos Álvarez
fe9d88326e
style: Fix alignment of the padding properties. 2017-03-18 15:05:25 +01:00
Emilio Cobos Álvarez
a1930fc554
stylo: Add a build log mechanism.
MozReview-Commit-ID: 4Zo1EveUYkK
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-18 13:21:10 +01:00
Bobby Holley
97dd3a1b08 Box more specified values to bring SpecifiedValue/PropertyDeclaration sizes down to 24/32 bytes.
MozReview-Commit-ID: xstAfjVQqi
2017-03-17 22:18:19 -07:00
bors-servo
8f3f8098c3 Auto merge of #16006 - upsuper:box-ordinal-group, r=Manishearth
Implement -moz-box-ordinal-group property

This PR fixes #16000.

<!-- 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/16006)
<!-- Reviewable:end -->
2017-03-17 15:15:01 -07:00
bors-servo
0a3b373a6a Auto merge of #15799 - asajeffrey:script-window-xorigin-parent, r=nox
Implement dissimilar-origin window.parent and window.top

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

This PR implements `window.parent` and `window.top` for dissimilar-origin windows.

This PR builds on #15536, only the last commit is part of this PR.

---
<!-- 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 #14996 and fix #11660.
- [X] These changes do not require tests because there's already a parentage test in `mozilla/cross-origin-objects/cross-origin-objects.html`.

<!-- 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/15799)
<!-- Reviewable:end -->
2017-03-17 09:18:38 -07:00
Alan Jeffrey
6bcb5f68be Implement dissimilar-origin window.parent and window.top. 2017-03-17 10:53:20 -05:00
Anthony Ramine
60a7f46350 Enable the debugger on Android
Apparently mio 0.6.5 now fully supports Android.
2017-03-17 16:36:06 +01:00
bors-servo
0b590aeed7 Auto merge of #16004 - CJKu:bug-1339674, r=heycam
stylo: Update clip-path and transform-box glue.

<!-- Please describe your changes on the following line: -->
Gecko bug1340044 should be land immediately after this PR been merged.

---
<!-- 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 it changes only the declaration type of mTransformBox

<!-- 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/16004)
<!-- Reviewable:end -->
2017-03-17 05:53:10 -07:00
Xidorn Quan
a1acb29aed Add support for -moz-box-ordinal-group 2017-03-17 23:08:07 +11:00
Xidorn Quan
ab0e5c9d99 Switch column-count to use predefined integer type 2017-03-17 23:08:05 +11:00
Xidorn Quan
9233882d49 Switch z-index to use predefined integer type 2017-03-17 23:08:03 +11:00
Xidorn Quan
b489c4ed90 Make Interpolate impl generic for Either 2017-03-17 23:08:00 +11:00
Xidorn Quan
0d556ddbf0 Add a predefined integer type 2017-03-17 23:07:57 +11:00
cku
6ccbf499b8 stylo: Update transform-box glue. 2017-03-17 20:00:28 +08:00
cku
e8d8b9984f stylo: Update clip-path glue. 2017-03-17 19:55:31 +08:00
bors-servo
32784c5fa8 Auto merge of #16010 - nox:h5e, r=KiChjang
Properly coalesce whitespace when given a reference child (fixes #15979)

<!-- 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/16010)
<!-- Reviewable:end -->
2017-03-17 04:25:20 -07:00
Anthony Ramine
0d904e387e Properly coalesce whitespace when given a reference child (fixes #15979) 2017-03-17 11:40:03 +01:00
bors-servo
36234d717f Auto merge of #16005 - hiikezoe:animation-compose, r=heycam
Compose animation with servo's hashmap

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

---
<!-- 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] These changes do not require tests because it's for stylo.

<!-- 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/16005)
<!-- Reviewable:end -->
2017-03-17 03:09:31 -07:00
Hiroyuki Ikezoe
254d5f6229 Drop Servo_AnimationValues_Uncompute. 2017-03-17 17:57:22 +09:00
bors-servo
594a679002 Auto merge of #15929 - n0max:canvas_drawimage_crop_fix, r=nox
Fix crop_area_bytes_length calculation and add tests

<!-- Please describe your changes on the following line: -->
- Fix crop_area_bytes_length calculation (the height was multiplied by itself)
- Add tests for this error and for the case that the width is multiplied by itself

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

<!-- 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/15929)
<!-- Reviewable:end -->
2017-03-17 01:55:16 -07:00
Hiroyuki Ikezoe
b210813124 Put computed values into AnimationValueMap instead of hashtable in gecko.
Before this patch, we store each computed values in a hashtable,
nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>, for all
KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of
the hashtable into an nsTArray<ServoAnimationValue*> and then convert
the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock
in rust.  This way was really inefficient.
In this patch, we store the computed values into AnimationValueMap and
convert all AnimationValue in the map into PropertyDeclarationBlock
after EffectCompositor::GetAnimationRule.
2017-03-17 12:33:39 +09:00
Hiroyuki Ikezoe
c0baac4194 Add a function to convert AnimationValueMap to PropertyDeclarationBlock.
We need to convert all AnimationValue (AnimationValueMap) on an element
to PropertyDeclarationBlock in order to push the value inside the CSS cascade.

Two reasons we did not add the function in AnimationValueMap:

 1) All members of PropertyDeclarationBlock are private.
 2) Rust does not allow us impl for type alias, so if we do impl the function
    in AnimationValueMap we need to make AnimationValueMap as a tuple or struct.
2017-03-17 12:30:01 +09:00
Hiroyuki Ikezoe
52bee9a4cf Add AnimationValueMap and expose it in FFI.
Current Gecko composes all of effects in the composite order at once.
We can put each computed value into this AnimationValueMap every time composing
an effect.
2017-03-17 12:29:34 +09:00
Hiroyuki Ikezoe
ba18c14b91 Split get_animation_rules into get_animation_rule and get_transition_rule.
If an element has only CSS animations we don't need to get transition rule,
and vice versa. This will be used when we implement eRestyle_CSSAnimations
and eRestyle_CSSTransitions.
2017-03-17 12:28:37 +09:00