Commit graph

16286 commits

Author SHA1 Message Date
Manish Goregaokar
489bbb849a Bump app_units; use from_f64_au 2017-09-08 00:37:25 -07:00
bors-servo
812cac78f0 Auto merge of #18399 - Manishearth:stylo-fuzzfix, r=emilio
stylo: Overflow fixes

r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1397363 , https://bugzilla.mozilla.org/show_bug.cgi?id=1397439

<!-- 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/18399)
<!-- Reviewable:end -->
2017-09-06 17:47:28 -05:00
Manish Goregaokar
e4de8d10a6 stylo: Use saturating subtraction for script level 2017-09-06 15:42:24 -07:00
Manish Goregaokar
c063ff88de stylo: Clamp Au on accumulation 2017-09-06 15:42:12 -07:00
bors-servo
094502e55f Auto merge of #18398 - canaltinova:at-page-rule, r=emilio
stylo: Pass the @page values to precomputed pseudo element declarations

We were parsing @page rules correctly and serializing for cssom when we
we need. But we weren't actually including them to the pseudo element
declarations when we need to print a page.

Reviewed by emilio on Bugzilla.

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

<!-- 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/18398)
<!-- Reviewable:end -->
2017-09-06 16:40:33 -05:00
Nazım Can Altınova
c533e23220 stylo: Pass the @page values to precomputed pseudo element declarations
We were parsing @page rules correctly and serializing for cssom when we
we need. But we weren't actually including them to the pseudo element
declarations when we need to print a page.
2017-09-06 14:04:18 -07:00
bors-servo
5e321cadf3 Auto merge of #18395 - jdm:selector-smallvec, r=SimonSapin
Use a 1-element smallvec for selector lists.

Profiling shows this reducing parsing time by a few milliseconds on the tp6 facebook case. The gtest benchmark with the same concatenated stylesheets also shows a significant improvement.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [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/18395)
<!-- Reviewable:end -->
2017-09-06 15:33:20 -05:00
Josh Matthews
3ae7781b5f Use a 1-element smallvec for selector lists. 2017-09-06 12:13:40 -07:00
bors-servo
af587e5f84 Auto merge of #18396 - jdm:codesize, r=emilio
Reduce duplication in generated ServoComputedData::to_declaration_block.

This reduces the size of the code in libXUL by 23.4k according to bloaty.

---
- [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/18396)
<!-- Reviewable:end -->
2017-09-06 13:44:30 -05:00
Josh Matthews
ca9b231173 Reduce duplication in generated ServoComputedData::to_declaration_block. 2017-09-06 11:02:53 -07:00
Josh Matthews
6827a10893 Report more specific error for invalid filter properties (bug 1386900). 2017-09-06 10:06:07 -07:00
bors-servo
4ada03febf Auto merge of #18382 - servo:jdm-patch-1, r=cbrewster
Add CEReactions to element creation APIs.

This addresses https://github.com/whatwg/dom/pull/506.

---
- [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 they will exist upstream in the future.

<!-- 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/18382)
<!-- Reviewable:end -->
2017-09-06 09:38:58 -05:00
Emilio Cobos Álvarez
ac2be54470
style: Make the skip-applying-damage stuff Gecko-only. 2017-09-06 14:54:20 +02:00
Emilio Cobos Álvarez
d8234fef82
style: update bindings. 2017-09-06 13:20:00 +02:00
Emilio Cobos Álvarez
7d2e2e25d6
style: Handle correctly display changes from ruby to non-ruby in some edge cases.
And add comments to the reset-property-dependent adjustments.

MozReview-Commit-ID: Li6Epx8k5x8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 12:56:34 +02:00
Emilio Cobos Álvarez
deefacc9de
style: Reindent some code.
MozReview-Commit-ID: H2qucldbBkc
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 12:56:33 +02:00
Emilio Cobos Álvarez
05371b56eb
style: Fix recascading when child blockification depends on our display value.
All other browsers get it right because they basically throw away all the styles
in a subtree after a display change. We do better, but need to do this check.

MozReview-Commit-ID: BODx0gnSzwI
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 12:56:32 +02:00
Emilio Cobos Álvarez
35504c1bb7
style: Fix the legacy value of justify-items propagation.
That property is pretty sad :(

MozReview-Commit-ID: GaKYvqR19M4
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 12:56:30 +02:00
Emilio Cobos Álvarez
825f623b3c
style: Stop the cascade when only reset structs change.
Bug: 1395227
Reviewed-by: heycam
MozReview-Commit-ID: JCZJl2fmtJ9
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-06 12:56:29 +02:00
Emilio Cobos Álvarez
6657f3dc19
style: Properly apply the display fixup for ::before and ::after.
Bug: 1393861
Reviewed-by: heycam
2017-09-06 10:27:30 +02:00
bors-servo
6051e5ed02 Auto merge of #18387 - nnethercote:measure-smallvec, r=heycam
Measure SmallVecs in SelectorMap and InvalidationMap.

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

This is another ~300 KiB on the Obama wikipedia page.

---
<!-- 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 testing is on the Gecko side.

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

r? @heycam

<!-- 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/18387)
<!-- Reviewable:end -->
2017-09-06 01:39:35 -05:00
Nicholas Nethercote
ae1216a717 Measure SmallVecs in SelectorMap and InvalidationMap. 2017-09-06 15:39:20 +10:00
bors-servo
f29fd77573 Auto merge of #18385 - Manishearth:clean-imports, r=mbrubeck
Clean imports in hashglobe

<!-- 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/18385)
<!-- Reviewable:end -->
2017-09-06 00:32:53 -05:00
bors-servo
e3568ba07a Auto merge of #18386 - bholley:unchecked_cssom_get, r=upsuper
Bypass the lock in get_property_value

This measurably improves performance - see https://bugzilla.mozilla.org/show_bug.cgi?id=1355599#c21

<!-- 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/18386)
<!-- Reviewable:end -->
2017-09-05 23:20:55 -05:00
bors-servo
1cf87a243a Auto merge of #18376 - kuoe0:set-fallbacktype-to-none-when-the-fallback-color-of-context-property-is-none, r=xidorn
Support None and NotSet for the fallback type of SVGPaint.

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

We didn't set None and NotSet for the fallback type of SVGPaint, and it caused the fallback color is wrong when fallback color is empty or keyword `none`. So, we add the None and NotSet support for it.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because of the test cases already 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/18376)
<!-- Reviewable:end -->
2017-09-05 21:43:02 -05:00
bors-servo
c6e774e69a Auto merge of #18383 - MortimerGoro:float_textures, r=emilio
Fix WebGL texture_float and texture_half_float detection on some GPUs

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

Fix WebGL texture_float and texture_half_float detection on some GPUs. Some of them use different extension names.

---
<!-- 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/18383)
<!-- Reviewable:end -->
2017-09-05 20:23:52 -05:00
Bobby Holley
48c95cdb6d Bypass the lock in get_property_value.
MozReview-Commit-ID: ECkLn5TPBDO
2017-09-05 17:50:03 -07:00
bors-servo
21c9ef3c6d Auto merge of #18373 - canaltinova:font-feature-vals, r=xidorn
Don't unnecessarily construct gfxFontFeatureValueSet

This is reviewed by xidorn in bugzilla.

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

<!-- 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/18373)
<!-- Reviewable:end -->
2017-09-05 18:35:55 -05:00
bors-servo
42de8e3d3f Auto merge of #18324 - ferjm:performance.workers, r=jdm
Make Performance Timeline API work in Workers

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18286 and #18308

This patch makes the Performance Timeline API work in workers, removes the exposure of `Performance.timing` in workers and sets the appropriate value of `Performance.now()` in workers.

<!-- 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/18324)
<!-- Reviewable:end -->
2017-09-05 17:00:26 -05:00
Manish Goregaokar
02fe616b86 Clean imports in hashglobe 2017-09-05 14:00:01 -07:00
bors-servo
f1fab036ab Auto merge of #18212 - mrobinson:position-sticky, r=emilio
Add support for position:sticky

This leverages the position:sticky support in WebRender to bring basic
support for position:sticky in Servo. There are still some issues with
nested sticky flows as well as a few other corner cases. Tests are
imported from WPT and can be removed once we update to the latest
version.

<!-- 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: -->
- [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/18212)
<!-- Reviewable:end -->
2017-09-05 15:36:47 -05:00
bors-servo
122e49d516 Auto merge of #18271 - legnaleurc:propagate_dirty_bits, r=emilio
Propagate dirty bits after invalidation if needed.

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

Follow up for [bug 1388298](https://bugzil.la/1388298).

---
<!-- 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
- [ ] 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/18271)
<!-- Reviewable:end -->
2017-09-05 14:18:52 -05:00
Emilio Cobos Álvarez
cdbb5b56aa
style: Convert the visited dependentness of a dependency in a binary enum. 2017-09-05 19:43:52 +02:00
Emilio Cobos Álvarez
cc31397a2e
style: Don't waste a whole selector map for each class / id in the document.
It's just useless.
2017-09-05 19:43:51 +02:00
Nicholas Nethercote
d880efcab3
Measure the stylist during memory reporting. 2017-09-05 19:43:50 +02:00
Imanol Fernandez
4f35e82cf5 Fix texture_float and texture_half_float detection on some GPUs 2017-09-05 18:24:59 +02:00
bors-servo
f648e12935 Auto merge of #18365 - chenpighead:stylo-keyframe-location, r=upsuper,emilio
stylo: Store location information for keyframe rules.

So far, we only store location info for the whole Keyframes block, not for each
of the keyframe rule. Without this info, the devtool can't present the rules
on the devtool panel properly.

In this patch, we collect the source location info while parsing keyframe selector.
The binding function, Servo_KeyframesRule_GetKeyframe, is also fixed (and renamed
to Servo_KeyframesRule_GetKeyframeAt to match the fix) to accept line and column
parameters from Gecko, so we can pass/set them with the source location from Servo.

This is the servo part of [Bug 1394994](https://bugzilla.mozilla.org/show_bug.cgi?id=1394994).

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

<!-- 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/18365)
<!-- Reviewable:end -->
2017-09-05 11:22:20 -05:00
Josh Matthews
90ff099b2d Add CEReactions to element creation APIs. 2017-09-05 08:51:31 -07:00
Fernando Jiménez Moreno
fb843c251a Make Performance Timeline API work in Workers 2017-09-05 17:07:15 +02:00
bors-servo
34e0805b12 Auto merge of #18363 - paulrouget:fix_style_build, r=SimonSapin
use cargo manifest path to find build.py

Without this, build.py can't be found when servo is built as a dependency.

---
<!-- 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
- [ ] 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/18363)
<!-- Reviewable:end -->
2017-09-05 09:22:28 -05:00
Paul Rouget
cd13888a1b use cargo manifest path to find build.py script 2017-09-05 09:31:37 +02:00
Daisuke Akatsuka
3ed71c4283 Make font-variation-settings animatable 2017-09-05 16:12:47 +09:00
Daisuke Akatsuka
653bced7a5 Implement Animate for FontSettings 2017-09-05 16:12:20 +09:00
Martin Robinson
bc455c8a1f Add support for position:sticky
This leverages the position:sticky support in WebRender to bring basic
support for position:sticky in Servo. There are still some issues with
nested sticky flows as well as a few other corner cases. Tests are
imported from WPT and can be removed once we update to the latest
version.
2017-09-05 09:10:55 +02:00
Daisuke Akatsuka
951662848f Implement clone_font_variation_settings method 2017-09-05 15:56:15 +09:00
KuoE0
2d84686113 Support None and NotSet for the fallback type of SVGPaint. 2017-09-05 13:06:09 +08:00
Nazım Can Altınova
dd8af182c1 Don't unnecessarily construct gfxFontFeatureValueSet
If there is no font feature values inside document we should avoid creating
unnecessary objects.
2017-09-04 15:48:39 -07:00
Nazım Can Altınova
9b63fedf59 Don't convert property declarations to lowercase
Property declarations are case-sensitive per spec and we should
preserve that behavior.
2017-09-04 15:41:16 -07:00
bors-servo
e97f28e2a6 Auto merge of #18367 - aethanyc:media-change-xbl-stylset, r=emilio
style: Expose stylist::set_device() for gecko

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

<!-- 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/18367)
<!-- Reviewable:end -->
2017-09-04 15:19:06 -05:00
bors-servo
c60dd53210 Auto merge of #18355 - servo:no-fmt, r=emilio
Reduce usage of fmt in serialization and error reporting

`format!` and `write!` create a somewhat-heavyweight `Formatting` struct and use dynamic dispatch to call into impls of `Dispaly` and related traits. The former also allocates an intermediate string that is sometimes unnecessary.

I started looking into this from https://bugzilla.mozilla.org/show_bug.cgi?id=1355599, but I expect the impact there will be small to insignificant. It might be a slightly less so on parsing (error reporting).

<!-- 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/18355)
<!-- Reviewable:end -->
2017-09-04 13:14:44 -05:00