Commit graph

25052 commits

Author SHA1 Message Date
Martin McNickle
143184d807
style: Convert scroll-behavior #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D61164
2020-02-12 02:43:17 +01:00
Martin McNickle
c447395c66
style: Convert mask-type #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D60987
2020-02-12 02:43:16 +01:00
Emilio Cobos Álvarez
13d12d0d5f
style: Tweak background-color and color handling in ignored-colors mode.
We're resetting `color` to the default color when there's a declaration that
applies in order to make stuff like this:

<div style="color: transparent">
  <div style="color: red">
    Red
  </div>
</div>

To not show transparent. But the behavior we want is more like "override with
default color iff there's no other declaration that would set the color from an
user or UA sheet".

This implements that behavior, plus avoids it if we're not inheriting
from transparent, so that stuff like this preserves the behavior from before bug
844349:

<a href="foo">
  <span style="color: red">Should be the red color</span>
</a>

Differential Revision: https://phabricator.services.mozilla.com/D60391
2020-02-12 02:43:16 +01:00
Sakura Mochizuki
017d6f0416
style: Convert dominant-baseline #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D61046
2020-02-12 02:43:16 +01:00
Boris Chiou
9aed1de6a5
style: Make the empty svg path valid.
Per SVG2 spec, the EBNF allows the path data string to be empty.
An empty path data string disables rendering of the path.
Therefore, we should make path('') a valid path string.

The related spec issue: https://github.com/w3c/fxtf-drafts/issues/392.
Now we serialize `path("")` as `path("")` for offset-path and clip-path.

Differential Revision: https://phabricator.services.mozilla.com/D60771
2020-02-12 02:43:15 +01:00
Emilio Cobos Álvarez
3991ab9999
style: Make direction use an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D60857
2020-02-12 02:43:15 +01:00
Martin McNickle
55f76be5e2
style: Convert stroke-linejoin #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D60865
2020-02-12 02:43:15 +01:00
Emilio Cobos Álvarez
16e5331950
style: Simplify calc expressions earlier.
This simplifies a bit the code, and guarantees that all calc()s have percentages
and lengths.

I also wanted to remove unclamped_length() / specified_percentage() (for the
same reason as the above patch), but they're needed for animations for now. When
I implement min() / max() for <length-percentage> they'll be fixed.

Differential Revision: https://phabricator.services.mozilla.com/D60194
2020-02-12 02:43:15 +01:00
Emilio Cobos Álvarez
5237d4fac8
style: Forbid accessing the length and percentage parts of a LengthPercentage separately.
This is just not a thing you can do if you have min() / max() / etc, as the min
/ max value may depend on the percentage basis.

Differential Revision: https://phabricator.services.mozilla.com/D60168
2020-02-12 02:43:14 +01:00
Emilio Cobos Álvarez
e7e6e62ed3
style: Remove font-size calc() hack to propagate keyword information.
It does not make any sense with min() / max() / clamp. So just forget the
keyword info when calc() is used. This also removes a bit of complex / hacky
code.

Differential Revision: https://phabricator.services.mozilla.com/D60663
2020-02-12 02:43:14 +01:00
Boris Chiou
83daa7484d
style: Use Serde for OffsetRotate and PositionOrAuto.
Differential Revision: https://phabricator.services.mozilla.com/D60088
2020-02-12 02:43:14 +01:00
Boris Chiou
2b3ef3ff37
style: Use Serde for SVGOffsetPath.
Differential Revision: https://phabricator.services.mozilla.com/D60087
2020-02-12 02:43:14 +01:00
Boris Chiou
5ac08e4780
style: Use Serde for Transform.
Though this may make us use more space when serializing
StyleTransform, but we don't have to do extra conversion on the compostior
side, and this makes us easier to maintain the Rust type.

Differential Revision: https://phabricator.services.mozilla.com/D60045
2020-02-12 02:43:13 +01:00
Boris Chiou
238e9ca2fb
style: Use Serde for rotate, scale, and translate properties.
The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.

Differential Revision: https://phabricator.services.mozilla.com/D60044
2020-02-12 02:43:13 +01:00
Ting-Yu Lin
5043695c78
style: Remove moz-prefixed aliases for column-gap and CSS multi-column properties.
Introduce a new pref "layout.css.prefixes.columns" to guard the prefixed
aliases.

The modification to `properties-db.js` was generated by
`./mach devtools-css-db`.

Differential Revision: https://phabricator.services.mozilla.com/D59564
2020-02-12 02:43:13 +01:00
Emilio Cobos Álvarez
9817ca386c
style: Remove lazy_static usage from custom_properties.rs.
Differential Revision: https://phabricator.services.mozilla.com/D60039
2020-02-12 02:43:13 +01:00
Emilio Cobos Álvarez
6fa03e1d04
style: Implement min() / max() / clamp() for simple css types behind a pref.
So for everything but <length> and <length-percentage>, which have more complex
mechanics.

The pref is off for now of course.

Differential Revision: https://phabricator.services.mozilla.com/D60012
2020-02-12 02:43:12 +01:00
Emilio Cobos Álvarez
d74f90e3a7
style: Centralize calc function parsing.
So that extending it to support other math functions like min / max / etc is
simpler.

There should be no behavior change with this patch, though I added a comment to
some places where we don't do calc() clamping correctly (though other browsers
don't either so...).

Differential Revision: https://phabricator.services.mozilla.com/D59939
2020-02-12 02:43:12 +01:00
Emilio Cobos Álvarez
9026720f04
style: Rewrite <input type=number> to avoid an anonymous input.
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

Differential Revision: https://phabricator.services.mozilla.com/D57193
2020-02-12 02:43:12 +01:00
Emilio Cobos Álvarez
c569d314a5
style: Do not ignore color: transparent in high contrast mode.
PDFJS uses it, for example to allow text selection. It's not great if it shows
on top of the actual PDF :-)

Differential Revision: https://phabricator.services.mozilla.com/D58703
2020-02-12 02:43:11 +01:00
Makoto Kato
e9c14bb9fc
style: Don't use hardcoded value for safearea.
To implement safe area support on Gecko, we should get safe area from Device.

Differential Revision: https://phabricator.services.mozilla.com/D52504
2020-02-12 02:43:11 +01:00
Makoto Kato
80a1b64384
style: Part 2. Use Device for parameter instead of CssEnvironment.
CssEnvironment always is in Device, so use Device as parameter instead of CssEnvironment.

Differential Revision: https://phabricator.services.mozilla.com/D52507
2020-02-12 02:43:11 +01:00
Makoto Kato
c5bd98354d
style: Always use CssEnvironment from media query's device.
Although CssEnvironment is in Device of media query implementation, some code
creates CssEnvironment instance without Device. So I would like always to use it from Device of media query.

Differential Revision: https://phabricator.services.mozilla.com/D52506
2020-02-12 02:43:11 +01:00
Emilio Cobos Álvarez
88fe64d845
style: Pack LengthPercentage better.
So that it takes one pointer instead of two, and doesn't make nsStylePosition's
size blow up.

This is not as ugly as I was fearing, thankfully, though it requires a bit of
boilerplate. I think it's acceptable.

Differential Revision: https://phabricator.services.mozilla.com/D58702
2020-02-12 02:43:10 +01:00
Emilio Cobos Álvarez
4d5bd94a2b
style: Move LengthPercentage to its own file.
I'm (sadly) about to make it a bit more complicated to pack it better. So we
may as well do this so it is easier to reason about navigate.

I also reordered things a bit, and removed some From<> implementations and
such.

Differential Revision: https://phabricator.services.mozilla.com/D58701
2020-02-12 02:43:10 +01:00
Emilio Cobos Álvarez
61f3ff1de3
style: Split LengthPercentage again.
This is needed to support min() / max() / clamp(), etc, as those need to be a
tree of values and thus need heap storage.

This unfortunately grows LengthPercentage to be two pointers, which is bad as
it blows up the size of nsStylePosition enough to trigger the size assertions.

This patch comments out the assertion for now, the follow-up patches will
uncomment them.

Differential Revision: https://phabricator.services.mozilla.com/D58700
2020-02-12 02:43:10 +01:00
Xidorn Quan
ec37e7a5b8
style: Ensure nested ruby level container don't escape from line break suppression.
Differential Revision: https://phabricator.services.mozilla.com/D58351
2020-02-12 02:43:10 +01:00
Emilio Cobos Álvarez
25fda147f3
style: Minor comment fix.
Differential Revision: https://phabricator.services.mozilla.com/D59310
2020-02-12 02:43:09 +01:00
Emilio Cobos Álvarez
d459e3453a
style: Make an assertion a release assert in nightly.
If this can happen legitimately, this will help fuzzers to catch it.

Differential Revision: https://phabricator.services.mozilla.com/D59066
2020-02-12 02:43:09 +01:00
Emilio Cobos Álvarez
718a9b1f05
style: Make display: -moz-box more similar to other display types for block layout.
It is unexpected (see bug) that a -moz-box is affected by baseline alignment.
Make -moz-box be block-outside, and -moz-inline-box be inline-outside, instead
of the bespoke thing we have now.

This is more similar to everything else, and fixes the bug.

Differential Revision: https://phabricator.services.mozilla.com/D58726
2020-02-12 02:43:09 +01:00
Emilio Cobos Álvarez
219c0f6328
style: Use cbindgen for content property.
This cleans up and also allows us to keep the distinction between content: none
and content: normal, which allows us to fix the computed style we return from
getComputedStyle().

Do this last bit from the resolved value instead of StyleAdjuster, because
otherwise we need to tweak every initial struct for ::before / ::after.

Differential Revision: https://phabricator.services.mozilla.com/D58276
2020-02-12 02:43:08 +01:00
Ting-Yu Lin
07d0eea5fb
style:- Remove column-span pref in column.mako.rs.
Differential Revision: https://phabricator.services.mozilla.com/D58399
2020-02-12 02:43:08 +01:00
Emilio Cobos Álvarez
4f4d480326
style: Do not incorrectly share style across elements with different part names.
Do the same we do for classes for now. We could be more precise and achieve a
bit more sharing with some more effort (left a comment there), but it seems
unlikely to matter in practice (and if we did that, we'd probably want to do the
same for classes).

Differential Revision: https://phabricator.services.mozilla.com/D58453
2020-02-12 02:43:08 +01:00
Emilio Cobos Álvarez
69bf0e40a6
style: Remove unused FFI function to refcount nsIReferrerInfo.
We don't use RefPtr<nsIReferrerInfo> in rust.

Differential Revision: https://phabricator.services.mozilla.com/D58274
2020-02-12 02:43:08 +01:00
Emilio Cobos Álvarez
d3e65000be
style: Workaround LLVM ABI bug.
All the gory details in https://bugzilla.mozilla.org/show_bug.cgi?id=1600735 and
related LLVM / GCC bugs. Avoid the issue by forcing the relevant enum to be
32-bit wide, so as to not trigger the LLVM bug.

Differential Revision: https://phabricator.services.mozilla.com/D57868
2020-02-12 02:43:07 +01:00
Emilio Cobos Álvarez
2b499e4850
style: Do not use synthetic display-inside values.
This matches the new servo layout engine too, and thus removes some #[cfg]
gunk.  Just use `flow` since it doesn't simplify the layout code as much.

Differential Revision: https://phabricator.services.mozilla.com/D45973
2020-02-12 02:43:07 +01:00
Sean Voisen
0dfbd38532
style: Add support for logical versions of overscroll-behavior.
Differential Revision: https://phabricator.services.mozilla.com/D57363
2020-02-12 02:43:07 +01:00
Jan Andre Ikenmeyer
21112a1b84
Configure OpenSSL SECLEVEL=2 2020-02-12 01:40:07 +01:00
Jan Andre Ikenmeyer
21b2479dc2
Add build check for OpenSSL 1.1.1 requirement 2020-02-12 01:39:57 +01:00
bors-servo
e89e78d401
Auto merge of #25700 - szeged:wgpu_compute_pipeline, r=jdm
Initial implementation of GPUComputePipeline

<!-- Please describe your changes on the following line: -->
Added WebIDL bindings for `GPUComputePipeline`.
Implemented the `createComputePipeline` function of `GPUDevice`.
This pull request is based on: #25677

---
<!-- 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 addresses a part of #24706

cc @kvark @jdm @zakorgy
<!-- 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. -->
2020-02-11 14:56:09 -05:00
bors-servo
6b2079e5b3
Auto merge of #25690 - mrobinson:queries, r=SimonSapin
Add support for some basic queries to layout_2020

These queries will make it easier to track progressions in the layout_2020 code.

---
<!-- 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. -->
2020-02-11 13:43:26 -05:00
bors-servo
ba23c5afee
Auto merge of #25687 - pshaughn:taintfile, r=jdm
Filter file: and about: responses opaquely

<!-- Please describe your changes on the following line: -->
file: and about: schemes were being treated like data: for cors purposes, when in fact they should have been subject to opaque response filtering. A comment indicated that this was necessary for some CSS tests, but I think the comment was out of date; the only tests depending on the unfiltered responses are unit tests that do not test any CSS functionality. I've updated those tests to now test for the opaque-filtering 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 #25686

<!-- Either: -->
- [X] There are tests for these changes, but also some loss of unit test coverage (#25693) and a newly failing test case (#25692)

<!-- 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. -->
2020-02-11 13:27:14 -05:00
bors-servo
419954474b
Auto merge of #25677 - szeged:wgpu_shader_module, r=jdm
Initial implementation of GPUShaderModule

Added WebIDL bindings for `GPUShaderModule`.
Implemented the `createShaderModule` function of `GPUDevice`.

<!-- 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 addresses a part of #24706

<!-- Either: -->

cc @kvark @jdm @zakorgy
<!-- 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. -->
2020-02-11 11:23:59 -05:00
Patrick Shaughnessy
41d896c201 file: and about: are now opaque-filtered responses 2020-02-11 10:19:43 -05:00
bors-servo
55058b2875
Auto merge of #25710 - pylbrecht:pattern.incomplete, r=jdm
Make CanvasRenderingContext2D.createPattern() return null for incomplete images

<!-- Please describe your changes on the following line: -->
`createPattern()` should return `null` if the passed `image` argument is not usable.

References:
- https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern
- https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument
---
<!-- 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 part of #25331

<!-- 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. -->
2020-02-11 08:11:40 -05:00
Simon Sapin
53d5e29c7b Replace iterate_through_fragments with a callback returning bool with find / Option<T> 2020-02-11 14:02:22 +01:00
Simon Sapin
d353e08529 Deduplicate the loop in iterate_through_fragments 2020-02-11 14:02:22 +01:00
Simon Sapin
ef8c51c4b1 Exit iterate_through_fragments through all recursion levels when the callback says so 2020-02-11 14:02:22 +01:00
Martin Robinson
fa7839270d Add layout_2020 support for NodeGeometryQuery and ContentBoxQuery 2020-02-11 14:02:19 +01:00
bors-servo
f3dbe7d388
Auto merge of #25715 - mrobinson:position-fixed, r=SimonSapin
Improve position:fixed support in layout_2020

<!-- 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. -->
2020-02-11 06:21:39 -05:00