Commit graph

13704 commits

Author SHA1 Message Date
bors-servo
997a3e8374 Auto merge of #16691 - heycam:custom-prop-name, r=xidorn
style: Correctly serialize CSS Custom Property names.

From https://bugzilla.mozilla.org/show_bug.cgi?id=1361303, and reviewed by Xidorn over there.
2017-05-02 04:19:59 -05:00
Cameron McCormack
53eb1bb5c6 style: Correctly serialize CSS Custom Property names. 2017-05-02 17:18:37 +08:00
bors-servo
f1ae547b9f Auto merge of #16688 - KuoE0:make-stylo-support-mozmm-unit, r=xidorn
Make stylo support mozmm unit

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

This issue is reported at https://bugzilla.mozilla.org/show_bug.cgi?id=1356104. Mozmm is defined at https://developer.mozilla.org/zh-TW/docs/Web/CSS/length.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the tests already exist in Gecko.

<!-- 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/16688)
<!-- Reviewable:end -->
2017-05-02 02:27:39 -05:00
KuoE0
507c90d40b Make style system support mozmm unit and compute it correctly.
MozReview-Commit-ID: hCUs8xuNd1
2017-05-02 14:16:17 +08:00
KuoE0
fc1e4e95ed Add a new FFI function Gecko_GetAppUnitsPerPhysicalInch to get the physical inch of device context in Gecko.
MozReview-Commit-ID: HiLkw5r05OT
2017-05-02 14:16:12 +08:00
bors-servo
f284a15e4b Auto merge of #16686 - aethanyc:bug1321754, r=heycam
stylo: Parse eSafeAgentSheetFeatures as agent sheet

This was reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1321754

<!-- 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/16686)
<!-- Reviewable:end -->
2017-05-01 23:52:36 -05:00
Ting-Yu Lin
81fdd0bfc8 stylo: Parse eSafeAgentSheetFeatures as agent sheet
This was reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1321754

MozReview-Commit-ID: 7GdsOP8lBxk
2017-05-02 11:42:49 +08:00
bors-servo
4426236adf Auto merge of #16681 - mbrubeck:slice_patterns, r=emilio
Stop using unstable slice_patterns feature

cc #5286

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because no functionality changed

<!-- 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/16681)
<!-- Reviewable:end -->
2017-05-01 21:48:33 -05:00
bors-servo
8850a01b81 Auto merge of #16683 - nox:place-content, r=emilio
Fix serialisation of place-content

<!-- 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/16683)
<!-- Reviewable:end -->
2017-05-01 19:57:40 -05:00
Anthony Ramine
16dd584bcc Fix serialisation of place-content 2017-05-02 00:52:32 +02:00
Emilio Cobos Álvarez
17ec634665
Guard inheriting font-size with what we actually need.
MozReview-Commit-ID: C4QaV5cNLh5
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-01 23:56:58 +02:00
Matt Brubeck
10478b4fa3 Stop using unstable slice_patterns feature 2017-05-01 14:19:00 -07:00
bors-servo
e92a79619e Auto merge of #16670 - emilio:sharing-is-sometimes-hard, r=bholley
style: Account for cousin sharing in the revalidation logic.

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

<!-- 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/16670)
<!-- Reviewable:end -->
2017-05-01 14:20:43 -05:00
Emilio Cobos Álvarez
e09ae428eb
style: Account for cousin sharing in the revalidation logic.
Fixes bug 1361013.
2017-05-01 20:22:16 +02:00
bors-servo
0abd5bbabd Auto merge of #16674 - canaltinova:angle-unit, r=emilio
Preserve units in computed Angle

<!-- Please describe your changes on the following line: -->
It was converting all angles to radians before. But other browsers preserves the angle units. Fixed that behavior.

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

<!-- 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/16674)
<!-- Reviewable:end -->
2017-05-01 09:45:04 -05:00
Nazım Can Altınova
f8710bc189
stylo: Support other unit types in computed angle 2017-05-01 16:25:18 +03:00
bors-servo
b7f06d2c20 Auto merge of #16672 - nox:moz-force-broken-image-icon, r=emilio
Implement -moz-force-broken-image-icon in geckolib

<!-- 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/16672)
<!-- Reviewable:end -->
2017-05-01 08:14:34 -05:00
Anthony Ramine
2c9a2f61f4 Implement -moz-force-broken-image-icon in geckolib 2017-05-01 15:00:23 +02:00
bors-servo
9b72d909f9 Auto merge of #16673 - nox:align, r=emilio
Fix AlignFlags::to_css

<!-- 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/16673)
<!-- Reviewable:end -->
2017-05-01 07:00:36 -05:00
Anthony Ramine
4099091afe Fix AlignFlags::to_css 2017-05-01 13:36:01 +02:00
Nazım Can Altınova
4483a7694a
stylo: Use computed Angle in computed value of filter property
Using specified Angle was wrong because it can keep calc
value and serialize with calc(). Also that will allow us to pass
angle unit later.
2017-05-01 14:28:04 +03:00
Hiroyuki Ikezoe
1b6e32ebef Update bindings. 2017-05-01 19:37:45 +09:00
Hiroyuki Ikezoe
7a01a5f5c4 There is no need to clone for animation/transition declaration block.
Because it's a newly created Arc<Locked<PropertyDeclarationBlock> in
get_animation_rule.
2017-05-01 19:23:40 +09:00
Hiroyuki Ikezoe
83a4935b60 Pass AnimationValueMap raw pointer instead of Arc to Gecko_GetAnimationRule() 2017-05-01 19:23:34 +09:00
Cameron McCormack
2296649b5c style: Correctly handle Gecko prefixed text-align values in property glue. 2017-05-01 17:22:28 +08:00
bors-servo
c71d97ae5e Auto merge of #16665 - longsonr:1347409, r=heycam,emilio
Servo changes for bug 1347409

bug 1347409 is introducing a fallback type for SVG paint servers so that we can distinguish between url(something) and url(something) none and serialise those cases correctly. When we get a url(something) color we need to set the mFallbackType to eStyleSVGFallbackType_Color.

This change has already been reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1347409

---
<!-- 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 are covered by tests that will land in gecko as part of the rest of the patch there.

<!-- 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/16665)
<!-- Reviewable:end -->
2017-04-30 20:26:54 -05:00
bors-servo
38bbacda70 Auto merge of #16664 - emilio:fix-eternal-todo, r=bholley
style: Avoid allocating a unique nsStyleSVG and nsStyleBackground per element

Should also help with https://bugzilla.mozilla.org/show_bug.cgi?id=1360881, and it's a TODO that has always been there.

This is on top of #16663, so only last commit needs review.

<!-- 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/16664)
<!-- Reviewable:end -->
2017-04-30 19:14:43 -05:00
bors-servo
bf0bf4f4b4 Auto merge of #16663 - emilio:style-builder, r=bholley
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.

This should fix most of the complaints that caused
https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a
bunch of other FIXMEs across the style system.

<!-- 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/16663)
<!-- Reviewable:end -->
2017-04-30 18:31:41 -05:00
Robert Longson
8f5cb99b92 Set fallback type to eStyleSVGFallbackType_Color when a colour is encountered 2017-04-30 23:06:24 +01:00
Emilio Cobos Álvarez
54f33a6bfd
style: Avoid allocating a unique nsStyleSVG and nsStyleBackground per element.
Should also help with https://bugzilla.mozilla.org/show_bug.cgi?id=1360881
2017-04-30 23:57:22 +02:00
Emilio Cobos Álvarez
3b857f1c4e
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.
This should fix most of the complaints that caused
https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a
bunch of other FIXMEs across the style system.
2017-04-30 23:45:40 +02:00
Emilio Cobos Álvarez
0c5681140a
style: Use SmallVec in the computed value representation of most stuff. 2017-04-30 23:32:32 +02:00
Bobby Holley
a6ef89a7fe Make note_selector more efficient.
My measurements are inconclusive as to whether this really moves the
needle, but it seems like the right way to do it in any case.

MozReview-Commit-ID: 7OuCc2aQ7jH
2017-04-29 16:07:44 -07:00
Bobby Holley
b4a2e2f17c Clean up note_selector a bit and stop handling combinators in two places.
MozReview-Commit-ID: HhVi72K4yp0
2017-04-29 16:07:43 -07:00
Bobby Holley
71ecff849b Use a single rule hash for both lower_name and name.
Right now in the common case we're doing twice the work during stylist update,
and also checking is_html_element_in_html_document twice during lookup. This
patch aligns us with what Gecko does.

MozReview-Commit-ID: D4TyG30BP8C
2017-04-29 16:07:41 -07:00
Bobby Holley
080ff126b5 Factor out the various things stylist does per-selector into helpers.
This makes things more readable, and easier to profile (since the Gecko
profiler doesn't have any intra-function granularity, so I tend to make
helpers non-inline when drilling down into what's expensive).

It allows us to iterate the selector list once, which could help cache locality
for rules with many selectors.

MozReview-Commit-ID: GdFtgrbYCIu
2017-04-29 16:07:40 -07:00
Bobby Holley
b4d05919e2 Unbust unit tests.
Not sure how this managed to get past bors before.
2017-04-29 16:07:39 -07:00
bors-servo
0c4e13cbc5 Auto merge of #16658 - n0max:remove-index-size-error, r=emilio
Remove IndexSizeError in CanvasRenderingContext2D::drawImage

<!-- Please describe your changes on the following line: -->
The current spec don't expect the IndexSizeError if the rectangle is empty.

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

<!-- Either: -->
- [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/16658)
<!-- Reviewable:end -->
2017-04-29 13:42:11 -05:00
n0max
49820a6797 Remove IndexSizeError in CanvasRenderingContext2D::drawImage 2017-04-29 19:27:00 +02:00
bors-servo
5dac4fbd2d Auto merge of #16646 - nox:loponu, r=emilio
Reverse Number and LengthOrPercentage in LengthOrPercentageOrNumber

"0" must be parsed as the number 0, not the unitless 0px length.

<!-- 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/16646)
<!-- Reviewable:end -->
2017-04-29 12:11:51 -05:00
bors-servo
53c62e890a Auto merge of #16385 - pyfisch:radial-gradient, r=emilio
Implement radial gradients

<!-- Please describe your changes on the following line: -->
This PR passes the `radial-gradient` function down from CSS parsed properties to webrender. It currently lacks tests but the examples from MDN and some other tests work fine. Probably there are some wpt tests I can enable?

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

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

<!-- 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/16385)
<!-- Reviewable:end -->
2017-04-29 09:40:32 -05:00
Pyfisch
d48c1222ca Changes needed for rebase. 2017-04-29 14:38:33 +02:00
bors-servo
93a513c06f Auto merge of #16640 - hiikezoe:timing-function, r=xidorn
Use FunctionKeyword for computed_value of timing function

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

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

<!-- Either: -->
- [X] These changes do not require tests because mozilla-central has test cases.  There might be some test cases in servo tree.

<!-- 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/16640)
<!-- Reviewable:end -->
2017-04-28 22:49:26 -05:00
bors-servo
bf32a7b9bd Auto merge of #16588 - KiChjang:fix-fixed-table-layout-column-width, r=mbrubeck
Fix fixed table layout column width distribution

Fixes #16324.

Replaces the incorrect [CSS3 "distributing excess width to columns" algorithm](https://drafts.csswg.org/css-tables-3/#distributing-width-to-columns) and implements the simpler [CSS2 fixed table layout algorithm](https://drafts.csswg.org/css2/tables.html#fixed-table-layout).

<!-- 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/16588)
<!-- Reviewable:end -->
2017-04-28 12:56:06 -05:00
Emilio Cobos Álvarez
5cbc6a9b16
Bug 1360508: Adjust text-combine properly. r=jryans
Text style is always resolved via ServoStyleSet::ResolveStyleForText, either
from the frame constructor initially, or from
ServoRestyleManager::ProcessPostTraversalForText.

So text-only adjustments should go there instead. Since that doesn't call into
cascade(), all the code that passes `pseudo` there is dead code we can remove.

MozReview-Commit-ID: jpbBYpLlUL
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-28 17:21:10 +02:00
bors-servo
ad87d36a69 Auto merge of #16623 - aacunningham:issue-16604-define-keyword-type-modification, r=Wafflespeanut
Move impl's into macro for macro-generated keyword types

Three keyword types are created through a macro but have some of their
impl's handled elsewhere. Since all impl's are the same, this commit
moves them into the macro to have them auto generated, for more concise
code.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this doesn't add any new features, just alters `impl` locations

<!-- 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/16623)
<!-- Reviewable:end -->
2017-04-28 08:09:13 -05:00
bors-servo
3b516af783 Auto merge of #16590 - MortimerGoro:texture_rgb, r=emilio
Fix WebGL premultiplied alpha. Fix texImage2D calls with RGB images.

Fix WebGL premultiplied alpha testcases.

Fix broken textures in some WebGL demos (e.g. Three.js). This was caused by WebGL::texImage2D calls with RGB formats. Alpha must be removed from the rgba8 pixel vector before submitting the data to the GPU.

---
<!-- 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: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/16590)
<!-- Reviewable:end -->
2017-04-28 07:12:05 -05:00
bors-servo
b7b5de0350 Auto merge of #16610 - Manishearth:fixup-overflow, r=emilio
overflow: -moz-scrollbars-none is shorthand-only

<!-- 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/16610)
<!-- Reviewable:end -->
2017-04-28 06:19:00 -05:00
bors-servo
22747e2763 Auto merge of #16642 - upsuper:bug1355394, r=heycam
stylo: Implement access to CSSSupportsRule

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

<!-- 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/16642)
<!-- Reviewable:end -->
2017-04-28 05:11:04 -05:00
Anthony Ramine
193e1d5569 Reverse Number and LengthOrPercentage in LengthOrPercentageOrNumber
"0" must be parsed as the number 0, not the unitless 0px length.
2017-04-28 11:51:24 +02:00