Commit graph

22415 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
33d39d37a2 style: Rustfmt recent changes. 2019-10-09 13:21:35 +02:00
Brendan Dahl
112a68723e style: Add way to disable XBL in servo.
Adds a feature "moz_xbl" that when disabled causes the XBL code in servo to
be stubbed out.

Differential Revision: https://phabricator.services.mozilla.com/D45614
2019-10-09 13:21:35 +02:00
Brian Birtles
f6b587051d style: Don't make visibility additive.
As per discussion here: https://github.com/web-platform-tests/wpt/pull/19160

This property type does not have a procedure for addition defined so it should
not be additive.

Differential Revision: https://phabricator.services.mozilla.com/D48454
2019-10-09 13:21:35 +02:00
Savo
38e5897353 style: Replace #define NS_STYLE_FLEX_WRAP with enum class.
Differential Revision: https://phabricator.services.mozilla.com/D48166
2019-10-09 13:21:35 +02:00
Morgan Reschenberg
1c1437df59 style: Add readability backplate for all elements containing text when HCM or a11y theme is active.
Differential Revision: https://phabricator.services.mozilla.com/D42979
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
d43632c9f8 style: Don't allow negative radii in radial gradients.
Mostly renaming for clarity, as the gradient parsing code is a bit hairy.

This also changes -webkit- gradients, which is, I think, the right thing to do
(otherwise I need to give up on the type system and sprinkle parse_non_negatives
around, which would be unfortunate).

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1008112 on
Chromium still accepting negative radii for those, so will wait to submit the
patch for review until they reply there with their intentions.

Differential Revision: https://phabricator.services.mozilla.com/D47141
2019-10-09 13:21:35 +02:00
Boris Chiou
19ddfd57d5 style: Set WillChangeBits::TRANSFORM for individual transform.
We always check StyleWillChangeBits_TRANSFORM bit together with a
transform-like property set, so using WillChangeBits::TRANSFORM bit to
represent all transform-like properties is ok.

However, it seems the new test case works well even if we don't have this
patch. I still add it for individual transform properties to make sure
the test coverage is enough anyway.

Differential Revision: https://phabricator.services.mozilla.com/D47509
2019-10-09 13:21:35 +02:00
Mats Palmgren
4a97d6f4a0 style: Implement 'repeat(auto-fill, <line-names>)' in subgridded axis.
Differential Revision: https://phabricator.services.mozilla.com/D46895
2019-10-09 13:21:35 +02:00
Boris Chiou
4a23556c4b style: Add offset shorthand.
Also, update the serialization by the shorter perference because this is
a new feature and using older syntax doesn't make sense.

Besides, use `cssOffset` for web animation IDL attribute name.

Differential Revision: https://phabricator.services.mozilla.com/D45607
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
3cb18071a2 style: Use fallible allocation for stylesheet invalidation.
If the sets get too big we cannot allocate anything else, we'll just empty them
and invalidate the whole document.

Differential Revision: https://phabricator.services.mozilla.com/D46828
2019-10-09 13:21:35 +02:00
Brian Birtles
c349dbbaa9 style: Make various border-image-* properties interpolable.
Differential Revision: https://phabricator.services.mozilla.com/D46724
2019-10-09 13:21:35 +02:00
Brian Birtles
877c6ac821 style: Parse '0' as a number for border-image-width.
As per CSS Values & Units:

"However, if a 0 could be parsed as either a <number> or a <length> in a
property (such as line-height), it must parse as a <number>."

(https://drafts.csswg.org/css-values-4/#lengths)

Differential Revision: https://phabricator.services.mozilla.com/D46723
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
a0e2aeb51c style: Let the CSS use counter prefs be independent.
* Let layout.css.use-counters.enabled be independent from the unimplemented
   property counters.

 * Always count in the style system (that is, always create
   Document::mStyleUseCounters), so that the warning from bug 1582374 works
   irrespective of these prefs.

 * Add a pref check to the SVGElement code path so that the prefs properly
   reflect whether the histograms end up being recorded or not.

 * Make the pref checks consistent (check both when reporting telemetry, not
   earlier).

Differential Revision: https://phabricator.services.mozilla.com/D46633
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
7d23cfb91e style: Always serialize aspect-ratio and font shorthand with spaces around the slash.
Differential Revision: https://phabricator.services.mozilla.com/D46568
2019-10-09 13:21:35 +02:00
Daniel Holbert
fee0f2cd23 style: In css 'display' blockification codepath, leave -moz-box alone and promote -moz-inline-box to -moz-box (if a new pref is set).
This is in the interests of allowing the frontend team to experiment with
switching from XUL grid to CSS grid, without inadvertently changing the
display values for the grid items via css-grid-item blockification.

This patch's new pref is not expected to remain in the codebase for long.
We're just adding it so that the behavior remains the same by default, because
we do currently have some XUL code that inadvertently depends on -moz-box
display values being blockified to 'block'.  The plan is for folks to remove
that dependency e.g. by adding explicit 'display:block' styling to frontend
code as-needed. After we've done that, we can tentatively flip the pref to true
by default, and then remove the pref entirely.

Differential Revision: https://phabricator.services.mozilla.com/D45258
2019-10-09 13:21:35 +02:00
Ting-Yu Lin
0138fc3707 style: Split SIDEWAYS bit in WritingMode.
Currently, there's no way to tell whether the SIDEWAYS bit is set from
`writing-mode:sideways-*` or `writing-mode:vertical-*; text-orientation:sideways;`.
To be able to tell them apart, split SIDEWAYS bits into VERTICAL_SIDEWAYS
and TEXT_SIDEWAYS. This is needed by my proposed solution in bug 1102175.

Also, provide convenience methods related to sideways writing-mode, and replace
obscure checks in the codebase.

Note that we don't have the use cases to distinguish vertical-rl from
sideways-rl in layout, but for the completeness, IsSidewaysLR() is still
defined.

Differential Revision: https://phabricator.services.mozilla.com/D46321
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
c92d1f6b9c style: Report counted unknown properties as well.
Differential Revision: https://phabricator.services.mozilla.com/D44717
2019-10-09 13:21:35 +02:00
Boris Chiou
5e77ba9bf4 style: Support ray() in offset-path and make it animatable.
1. Add `generics::motion::OffsetPath`, and use specified `Angle` and
   computed `Angle` to define specified `OffsetPath` and computed `OffsetPath`.
2. Add `ray` function into `OffsetPath`.

We also tweak the degree from 150deg to 135deg in wpt (e.g.
offset-path-ray-001.html and others) to avoid floating point precision issues.
For example:
```
// offset-path: ray(150deg ...);
// offset-distance: 20px;
matrix:
{
  {0.500000 0.866025 0.000000 0.000000},
  {-0.866025 0.500000 0.000000 0.000000},
  {0.000000 0.000000 1.000000 0.000000},
  {10.000000 17.320509 0.000000 1.000000}
}

// rotate(60deg) translate(20px)
matrix:
{
  {0.500000 0.866025 0.000000 0.000000},
  {-0.866025 0.500000 0.000000 0.000000},
  {0.000000 0.000000 1.000000 0.000000},
  {10.000000 17.320507 0.000000 1.000000}
}
```
Their translate parts, 17.320509 vs 17.320507, are almost the same (only
tiny difference), which may cause the reftest failed.

Differential Revision: https://phabricator.services.mozilla.com/D42721
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
35a98af0ed style: Add a comment quoting the spec. 2019-10-09 13:21:35 +02:00
fantasai
8798549beb style: 'text-orientation: upright' forces used 'direction' to LTR. r=jfkthame
Bug: 1315892
Reviewed-by: jfkthame
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
c78f1b62de style: Remove LengthPercentage::was_calc.
There should not be any behavior change between specifying a percentage using %
or calc(%) per the resolution of https://github.com/w3c/csswg-drafts/issues/3482.

Differential Revision: https://phabricator.services.mozilla.com/D43747
2019-10-09 13:21:35 +02:00
bors-servo
ec408e9a57
Auto merge of #24397 - Manishearth:inputarray, r=jdm
Support new way of doing input source arrays

Fixes https://github.com/servo/servo/issues/24395

r? @jdm

<!-- 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/24397)
<!-- Reviewable:end -->
2019-10-08 21:16:10 -04:00
Manish Goregaokar
8ae1c2e0ad Hook XRInputSourceArray into XRSession 2019-10-08 15:34:20 -07:00
Manish Goregaokar
868e5cbd62 Add methods to XRInputSourceArray 2019-10-08 15:34:20 -07:00
Manish Goregaokar
0777233412 Store inputs array in XRInputSourceArray 2019-10-08 15:34:20 -07:00
Manish Goregaokar
b5b852be75 Add empty XRInputSourceArray interface 2019-10-08 15:34:20 -07:00
bors-servo
a7d48dca80
Auto merge of #24333 - mmatyas:webgl_fns_samplers, r=jdm
Add WebGLSampler support

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13

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

cc @jdm @zakorgy

---
<!-- 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/24333)
<!-- Reviewable:end -->
2019-10-08 11:56:11 -04:00
Mátyás Mustoha
26df1962c3 Add WebGLSampler support
Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.13
2019-10-08 16:21:43 +02:00
bors-servo
26e5281bfc
Auto merge of #24393 - servo:layout-2020, r=SimonSapin
Remove a wrong assertion

<!-- 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/24393)
<!-- Reviewable:end -->
2019-10-08 10:20:59 -04:00
Anthony Ramine
e90fae52e5 Remove a wrong assertion 2019-10-08 13:42:41 +02:00
Gregory Terzian
4f3ba70704 http-cache: wait on pending stores
and various small improvements
2019-10-08 17:58:20 +08:00
bors-servo
e05f0b41ba
Auto merge of #24387 - servo:jdm-patch-31, r=jdm
macos: Remove font size attribute from font descriptor.

This attribute isn't present in font-kit, and maybe this will help with #23290?

<!-- 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/24387)
<!-- Reviewable:end -->
2019-10-08 00:46:53 -04:00
bors-servo
75548f40c6
Auto merge of #24340 - jdm:image-cache-cors, r=Manishearth
Allow using CORS filtered image responses as WebGL textures

More specifically, this makes the "is this image same origin?" check consider the CORS status of the original response, rather than relying on an overly-strict "is this image's response's URL same-origin with a particular global?" check. To do this, we make the image cache double keyed based on the requested URL as well as the requesting origin, and store the CORS status of the eventual response with the final image that eventually gets sent to the HTMLImageElement consumer.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24330 and fix #24368
- [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/24340)
<!-- Reviewable:end -->
2019-10-07 18:39:36 -04:00
bors-servo
95f65cdd31
Auto merge of #24383 - emilio:style-nit, r=nox
style: Use consistent naming and shared code for out-of-flow stuff.

There was already code to check abspos / floats. No need to duplicate code with
different names as ee17eedf3a did.

<!-- 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/24383)
<!-- Reviewable:end -->
2019-10-07 16:04:17 -04:00
Josh Matthews
35f1910297
rustfmt 2019-10-07 15:05:48 -04:00
bors-servo
c60d4f46a0
Auto merge of #24378 - otaviopace:fix/responses-status-code-text, r=jdm
response: remove text from default statusCode

According to the [specification](https://fetch.spec.whatwg.org/#concept-response-status-message) the text of the default statusCode text should be empty.

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

<!-- Either: -->
- [x] These changes do not require tests because it is a simple string change that having tests would just be useless

<!-- 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/24378)
<!-- Reviewable:end -->
2019-10-07 13:46:56 -04:00
Josh Matthews
b94615b3eb
macos: Remove font size attribute from font descriptor. 2019-10-07 12:04:53 -04:00
bors-servo
37ab273c82
Auto merge of #24370 - jdm:cache-crossorigin-test, r=gterzian
Cache crossorigin test

This adds a test for #24356 to ensure that we don't regress our cache behaviour.

---
- [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/24370)
<!-- Reviewable:end -->
2019-10-07 11:28:53 -04:00
Emilio Cobos Álvarez
6b674a670b
style: Use consistent naming and shared code for out-of-flow stuff.
Use the functions introduced in ee17eedf3a.
2019-10-07 16:57:18 +02:00
Otávio Pace
a1acd29339 response: remove text from default statusCode
According to the specification the text of the
default statusCode should be empty.

Reference: https://fetch.spec.whatwg.org/#concept-response-status-message
2019-10-07 08:23:44 -03:00
Tugdual JULLIEN
85e6418271 Pass argument by reference to CacheKey constructor
Argument now passed by reference, and clone() removed when calling
constructor.
2019-10-05 11:18:51 +02:00
bors-servo
36f70f5ab1
Auto merge of #24360 - servo:build-box-tree, r=SimonSapin
Call BoxTreeRoot::construct from layout_thread_2020

<!-- 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/24360)
<!-- Reviewable:end -->
2019-10-04 20:37:28 -04:00
Josh Matthews
b347cf877c Add some useful HTTP cache debug output. 2019-10-04 15:26:03 -04:00
Josh Matthews
a241232c2b Add useful debug output for HTTP response and image cache. 2019-10-04 15:08:40 -04:00
Josh Matthews
1df8d57dc6 Support CORS attributes for image elements. 2019-10-04 15:08:40 -04:00
Víctor Manuel Jáquez Leal
b75d454162 implement get_image_pixels() for video element 2019-10-04 18:08:06 +02:00
Víctor Manuel Jáquez Leal
bc07154e05 Always hold current frame
Regardless if it contains raw data or a gl texture.

It is required to hold current frame because it can be used for
webgl's get_image_pixels
2019-10-04 18:08:06 +02:00
Simon Sapin
1bb85ed05b Make some of layout_2020 private 2019-10-04 17:51:05 +02:00
Josh Matthews
583536c940 Use the paint worklet's base URL for the 2d canvas' origin checks. 2019-10-04 09:22:21 -04:00
Josh Matthews
81a67aed9e Double key image cache by requesting origin, and store CORS status with cached images. 2019-10-04 09:22:21 -04:00