Commit graph

408 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
c0f516f17d
style: Appease tidy. 2018-09-03 12:39:02 +02:00
Boris Chiou
a92f9c105a
style: Move SVGPathData and its parser into svg_path.rs.
SVGPathData will be used by clip-path and offset-path (and/or more on the
properties which support <basic-shape>). Therefore, let's move
SVGPathData out of motion.rs.

Differential Revision: https://phabricator.services.mozilla.com/D3631
2018-09-03 12:32:43 +02:00
Boris Chiou
dce2e2927f
style: Define offset-path and implement it in style system.
Define OffsetPath & SVGPathData on the servo-side, and StyleMotion &
StyleSVGPath on the gecko-side. We parse the SVG Path string into a
vector of PathCommand. To build the gfx::Path, we will convert it into
gfx::Path later in a different patch.

The basic flow is:
  - Parse SVG Path String into SVGPathData (in Rust).
  - Use cbindgen to make sure the layout of PathCommand and StylePathCommand, and then set the Box[PathCommand] into nsTArray<StylePathCommand>.
  - Try to convert nsTArray<StylePathCommand> into gfx::Path. (This part will be implemented in a different patch.)

Finally, we use the gfx::Path to create a motion path transform.
The layout implementation is in the later patch.

Depends on D2962

Differential Revision: https://phabricator.services.mozilla.com/D2963
2018-09-03 12:30:21 +02:00
Xidorn Quan
c77ecd6984
style: Implement flow-relative values for resize property.
Differential Revision: https://phabricator.services.mozilla.com/D2908
2018-08-18 17:47:51 +02:00
Emilio Cobos Álvarez
0cab212052
style: Autogenerate StyleAppearance.
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.

Really sorry for the size of the patch.

There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.

Differential Revision: https://phabricator.services.mozilla.com/D2361
2018-08-08 01:35:08 +02:00
Cameron McCormack
f526af7f01
style: Remove angle values from image-orientation.
Bug: 1473450
Reviewed-by: emilio
MozReview-Commit-ID: FB74ILJM6Fm
2018-07-16 19:42:12 +02:00
Philipp Klein
85af4145c3 style: Move clear CSS property outside mako
closes #21155
2018-07-10 09:18:33 +02:00
Philipp Klein
c7871811c8 style: Move float CSS property outside mako
closes #21130
2018-07-09 12:47:07 +02:00
Emilio Cobos Álvarez
90ef5607e4
style: Move TransitionProperty where it belongs.
Bug: 1419695
Reviewed-by: xidorn
MozReview-Commit-ID: 9PN6VfbDbLA
2018-06-12 12:15:05 -07:00
Xidorn Quan
1b236bf620
style: Rename CaretColor to ColorOrAuto for reusing.
Bug: 1460456
Reviewed-by: heycam
MozReview-Commit-ID: LD6PlNI60GC
2018-05-28 15:36:55 +02:00
Emilio Cobos Álvarez
2f18b67ce1
style: Make resolutions more like the rest of the CSS values.
Bug: 1460655
Reviewed-by: xidorn
MozReview-Commit-ID: 3Gt8VX1KhjC
2018-05-19 10:15:17 +02:00
Xidorn Quan
db0134e697
style: Rename pointing to inherited_ui.
And also merge values::*::pointing into values::*::ui.

Bug: 1460192
Reviewed-by: heycam
MozReview-Commit-ID: FM4gWEszahB
2018-05-19 10:15:17 +02:00
Xidorn Quan
0f7f9eebc0
style: Add some attributes for SpecifiedValueInfo to help deriving more from types.
Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: IyohSTbUO31
2018-04-29 03:28:48 +02:00
Xidorn Quan
7fe7b2ffb1
style: Add a ValueInfo trait for exposing types needed by devtools.
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.

In my current plan, this new trait will be used in bug 1434130 to expose
values as well.

Bug: 1455576
Reviewed-by: emilio
MozReview-Commit-ID: LI7fy45VkRw
2018-04-29 03:28:34 +02:00
Emilio Cobos Álvarez
32d4da8a99
style: Update font-style to css-fonts-4.
Bug: 1455358
Reviewed-by: xidorn
MozReview-Commit-ID: 1Nq5DyCjaZe
2018-04-28 10:26:05 +02:00
Emilio Cobos Álvarez
f7636e6662
style: Update font-stretch to css-fonts-4.
These won't "just work", pending changes from bug 1436048 to use a floating
point representation for those.

Bug: 1454883
Reviewed-by: xidorn
MozReview-Commit-ID: Bi5iTdFreMA
2018-04-28 10:26:04 +02:00
Emilio Cobos Álvarez
bc1126ee8c
style: Update font-weight property and descriptor to css-fonts-4.
Bug: 1454596
Reviewed-by: xidorn
MozReview-Commit-ID: 27aS2UrgXjs
2018-04-28 10:25:59 +02:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Bobby Holley
f7ae1a37e3 Manual fixups so that the rustfmt output won't trigger tidy. 2018-04-10 17:33:25 -07:00
Bobby Holley
9b5354f953 Stop using Gecko namespace ids in servo.
MozReview-Commit-ID: 2532dHCGPXW
2018-04-06 11:32:00 -07:00
Fausto Núñez Alberro
cc838f54e5
Implement a URL-generic type for list-style-image
This should fix the following two "expected to fail" tests:

- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
  and elem.style uses the original URL

- getComputedStyle(elem) for url() listStyle uses the resolved URL
  and elem.style uses the original URL
2018-04-03 22:01:26 +02:00
Emilio Cobos Álvarez
744809a8b2
style: Add support for 'flex-basis:content' in the style system.
Bug: 1105111
Reviewed-by: xidorn
MozReview-Commit-ID: 5WhgHJJ0mDB
2018-04-02 03:17:56 +02:00
Li Hao Tan
8d5a2a9aeb Refactor text-emphasis-position to use ${helpers.predefined_type(..)} 2018-04-01 21:12:01 +08:00
Igor Gutorov
217c4be2bf style: Fix a typo in Integer struct docs 2018-03-13 02:02:38 +02:00
bors-servo
aa8fb3a204
Auto merge of #20252 - NeverHappened:extract_text_emphasis_style, r=upsuper
Extract text emphasis style

<!-- Please describe your changes on the following line: -->
Extracted the text-emphasis-style property out of the inherited_text.mako.rs.
This is a part of #19015

---
<!-- 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] `./mach cargo-geckolib check` does not report any errors
- [X] These changes fix #19940 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because it's a refactoring

<!-- 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/20252)
<!-- Reviewable:end -->
2018-03-09 19:20:10 -05:00
Anthony Ramine
afaa00a344 Remove some uses of trivial_to_computed_value 2018-03-09 11:57:22 +01:00
Dmitry
73113e28dd Move text-emphasis-style variables out of mako templates 2018-03-09 00:04:32 +03:00
Xidorn Quan
0090fbb3c8 Move ComputedUrl into their impl mods. 2018-03-08 23:34:33 +11:00
Xidorn Quan
d001fd9a0a Move Parse impl of SpecifiedUrl into corresponding files. 2018-03-08 23:34:33 +11:00
Xidorn Quan
a99ca543cd Add SpecifiedImageUrl for <url> used as images. 2018-03-08 23:34:32 +11:00
Emilio Cobos Álvarez
39a3d93b4f
style: remove unused AsciiExt imports.
eq_ignore_ascii_case is not in AsciiExt since rustc 1.23.
2018-03-04 15:31:06 +01:00
Anthony Ramine
c4efbb4d51 Replace ColorOrAuto by CaretColor
This is its only use.
2018-02-28 10:25:59 +01:00
Anthony Ramine
27732c7dbb Replace NonNegativeLengthOrNumber by a specific type for -moz-tab-size
This is the only use of this type.
2018-02-27 11:26:52 +01:00
bors-servo
6df0dc5b27
Auto merge of #20124 - servo:perspective, r=emilio
Replace LengthOrNone by a specific type for the perspective property

<!-- 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/20124)
<!-- Reviewable:end -->
2018-02-26 16:35:32 -05:00
Anthony Ramine
260e05320c Replace LengthOrNone by a specific type for the perspective property
This was its only use, and it was bugged: AFAIK this didn't properly
clamp animated values below 0.
2018-02-26 22:32:06 +01:00
Anthony Ramine
f10e485740 Remove 2 unused type aliases 2018-02-26 16:40:19 +01:00
Anthony Ramine
761689f32d Replace PositiveIntegerOrAuto by ColumnCount
It was its only use.
2018-02-22 10:16:46 +01:00
Anthony Ramine
b44ffcf498 Replace IntegerOrAuto with ZIndex
It's its only use.
2018-02-20 15:18:22 +01:00
Emilio Cobos Álvarez
f4c9c598a3
style: Optimize serialization of identifiers of length <= 16 🐉🐲
Much like we optimize to_ascii_lowercase.

This also fixes a bug in Servo where attr() rules with an unknown namespace
prefix are parsed, which is wrong.
2018-02-07 17:34:22 +01:00
Igor Gutorov
7a00066477 style: Move content property out of mako. 2018-02-07 00:11:57 +02:00
bors-servo
38ef515463
Auto merge of #19529 - DonatJR:counter-reset-out-of-mako, r=emilio
style: moved css longhand counter-reset out of mako

<!-- Please describe your changes on the following line: -->
This is a sub-PR of #19015
Code does not yet compile with `build-geckolib`.
r? emilio

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

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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/19529)
<!-- Reviewable:end -->
2018-02-01 09:42:40 -06:00
Jonas Reinwald
d24301b7a0
moved css longhand counter-reset out of mako 2018-02-01 15:43:40 +01:00
bors-servo
d222c9501b
Auto merge of #19924 - emilio:bim, r=emilio
style: Move border-image-repeat outside of mako.

This is a rebased / nitpick-addressed / bug-fixed version of #19021, and with a commit from #19668 renaming the two `RepeatKeyword`s to different names.

<!-- 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/19924)
<!-- Reviewable:end -->
2018-02-01 08:24:12 -06:00
chansuke
50b517d0db
style: Move border-image-repeat outside of mako. 2018-02-01 13:59:10 +01:00
bors-servo
dcd13b857c
Auto merge of #19918 - emilio:font-stuff-is-a-mess, r=nox
style: Refactor font-feature-settings and font-variation-settings.

This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1434692
  https://bugzilla.mozilla.org/show_bug.cgi?id=1434724

Also does a fair amount of cleanup and all that, which was needed, this code
was a mess.

There are further cleanups that can be done, like renaming the
font-variation-settings animation stuff.

<!-- 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/19918)
<!-- Reviewable:end -->
2018-02-01 06:45:20 -06:00
Emilio Cobos Álvarez
3b34d734e6
style: Refactor font-feature-settings and font-variation-settings.
This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1434692
  https://bugzilla.mozilla.org/show_bug.cgi?id=1434724

Also does a fair amount of cleanup and all that, which was needed.
2018-02-01 12:54:45 +01:00
Anthony Ramine
bac8781cc7 Kill define_numbered_css_keyword_enum 2018-02-01 12:43:28 +01:00
Anthony Ramine
1f8777bb0b Move TransformStyle out of Mako files 2018-02-01 12:40:36 +01:00
CJ Ku
174f5f7128 Implement scale property styling 2018-01-31 22:12:34 +00:00
CJ Ku
de3e8c9a8b Implement translate property styling 2018-01-31 22:12:33 +00:00