Commit graph

75 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2ac1327e4b
style: Make border-spacing serialization consistent, and move it to precomputed_type. 2017-09-17 21:33:17 +02:00
Boris Chiou
b89286e8e7 Use CSSPixelLength in LengthOrPercentage{*}.
Replace Au with CSSPixelLength in LengthOrPercentage,
LengthOrPercentageOrAuto, and LengthOrPercentageOrNone.
2017-09-13 18:10:46 +08:00
Boris Chiou
535c1e3c6f Replace Au with CSSPixelLength in CalcLengthOrPercentage.
We replace Au with CSSPixelLength for the length part of
computed::CalcLengthOrPercentage. Therefore, it would be easier to use
CSSPixelLength for all other LengthOrPercentage{*} types.
2017-09-13 18:10:39 +08:00
Boris Chiou
a949e2a057 Introduce CSSPixelLength and update NonNegativeLength.
First, we define computed::CSSPixelLength which contains a CSSFloat, a
pixel value, and then we replace computed::Length with CSSPixelLength.
Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength,
FontRelativeLength, ViewportPercentageLength, CharacterWidth, and
PhysicalLength is CSSPixelLength.

Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength
with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
2017-09-13 18:05:14 +08:00
Emilio Cobos Álvarez
64ab73eabd
style: Properly use integers on grid properties, and derive ToComputedValue. 2017-09-11 11:29:27 +02:00
bors-servo
8129cf5563 Auto merge of #18206 - ferjm:bug1382369.grid.repeat.function, r=wafflespeanut
stylo: store specified value of grid layout repeat() function

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

<!-- 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/18206)
<!-- Reviewable:end -->
2017-09-11 02:32:38 -05:00
Boris Zbarsky
26b39241f9 Box gradients and rects in Image. r=xidorn
Gradients and rects are rare, and large.  Image is much smaller with them boxed.

This is part of of the fix for Gecko bug 1397614
<https://bugzilla.mozilla.org/show_bug.cgi?id=1397614>
2017-09-09 10:55:58 -04:00
Fernando Jiménez Moreno
8306946e7f stylo: store specified value of grid layout repeat() function 2017-09-06 12:53:07 +02:00
Anthony Ramine
542a9337a4 Use generics for the vertical-align property 2017-08-30 23:01:12 +02:00
Simon Sapin
35282042bc geckolib: Fix some warnings (treated as error) new in Rust Nigthly 2017-08-17 15:59:33 +02:00
Daisuke Akatsuka
c05baa2327 Implement clone_content method 2017-08-15 15:25:05 +09:00
Anthony Ramine
c4e33d9dca Animate basic shapes 2017-08-11 10:25:03 +02:00
Xidorn Quan
f749aaee5e Always set mBgPos for LineDirection::Vertical. 2017-08-04 19:29:01 +10:00
Fernando Jiménez Moreno
7fc3d59c0b stylo: serialize radial gradients computed value using modern unprefixed style 2017-08-03 09:33:28 +02:00
Daisuke Akatsuka
2250e79976 Support calc for fit-content() 2017-08-01 17:13:01 +09:00
Emilio Cobos Álvarez
23369aee6d
style: Don't unconditionally generate Calc values when converting background-size from Gecko.
Bug: 1385140
MozReview-Commit-ID: ERwq50WSvLV
2017-07-28 14:50:01 +02:00
Emilio Cobos Álvarez
75a844cd32
Revert "Auto merge of #17868 - ferjm:bug1380259.radial.gradients, r=xidorn"
This reverts commit ef233381cc, reversing
changes made to f61528d297.

This broke a bunch of tests in m-c, like:

  https://treeherder.mozilla.org/logviewer.html#?job_id=118007409&repo=autoland
2017-07-26 14:25:22 +02:00
Fernando Jiménez Moreno
c50e892a04 stylo: serialize radial gradients using modern unprefixed style 2017-07-26 12:00:15 +02:00
Emilio Cobos Álvarez
e374a54050
style: Cleanup the cascade a good bit. 2017-07-20 11:20:37 +02:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
Fernando Jiménez Moreno
6ae4bf6ee8 Implement serialization of linear-gradient the same ways as in Gecko 2017-07-13 12:20:30 +02:00
Anthony Ramine
7bc9a95b46 Rename MinMax to Minmax 2017-07-12 11:45:17 +02:00
Anthony Ramine
907d629ca4 Rename ImageRect to MozImageRect 2017-07-12 11:45:15 +02:00
Daisuke Akatsuka
d885747a18 implements nsStyleImage type properties animatable 2017-07-05 13:10:58 +09:00
Daisuke Akatsuka
a155a6341d implements nsStyleSides type properties animatable 2017-07-05 12:57:30 +09:00
Daisuke Akatsuka
34980689a7 implements nsStyleGridLine type properties animatable 2017-07-05 12:55:51 +09:00
Nazım Can Altınova
d589645ee9 stylo: Implement -moz-prefixed radial gradients 2017-06-30 17:54:01 -07:00
Nazım Can Altınova
3e42684d3c stylo: Implement -moz-prefixed linear gradients 2017-06-30 17:53:01 -07:00
Anthony Ramine
608e7f71a2 Make computed types hold Percentage instead of bare CSSFloat 2017-06-15 16:59:03 +02:00
Xidorn Quan
bf77f81ed6 Create RGBAColor for colors compute to RGBA. 2017-06-08 10:42:26 +10:00
Anthony Ramine
862fc4f88d Rename BorderRadiusSize to BorderCornerSize 2017-05-29 00:58:53 +02:00
Anthony Ramine
af3ede418b Refactor BorderRadius and move it to the border modules
BorderRadius now parses itself reusing Rect<T>.
2017-05-28 14:36:37 +02:00
Anthony Ramine
150c9df246 Use Rect in InsetRect 2017-05-25 17:27:19 +02:00
Anthony Ramine
a65c874ec8 Refactor basic shapes 2017-05-22 14:03:12 +02:00
Anthony Ramine
307dd74ecf Introduce CalcLengthOrPercentage::unclamped_length
This is necessary for some operations, notably converting this to something
suitable for gecko.
2017-05-18 19:27:31 +02:00
Anthony Ramine
d0b9bd9c64 Refactor how calc() clamping is done on computed values (fixes #15296) 2017-05-18 10:14:59 +02:00
cku
f7e3c534e3 Stylo: Pass LayerImage's image_value to gecko. 2017-05-16 01:42:31 +08:00
Anthony Ramine
dd38bba1be Pass the gradient compatibility mode to gecko 2017-05-15 15:36:28 +02:00
Anthony Ramine
abef5da9d8 Refactor Gradient
In a similar way to Position, now specified and computed gradients share
a common Gradient type defined in style::values::generics::image.

This allows us to reuse most code for many style traits like ToCss,
HasViewportPercentage and ToComputedValue.

The test changes are the fallout of the disappearance of AngleOrCorner::None,
which align our code to the spec for serialisation, where components that can
be omitted should be omitted.
2017-05-15 15:36:15 +02:00
Anthony Ramine
f2aaba685b Kill side keywords from style::values::specified::image 2017-05-15 15:35:31 +02:00
Anthony Ramine
1c54758ad6 Introduce style::values::generics::image 2017-05-15 15:35:26 +02:00
Anthony Ramine
70ec61cf01 Refactor Position
A specified position is now a struct made of two values of different types,
the first one being PositionComponent<X>, and the second one PositionComponent<Y>.

A position component is represented by the new enum PositionComponent<Side>,
with the three values Center, Length(LengthOrPercentage), and
Side(Side, Option<LengthOrPercentage>).

Side keywords are represented by the X and Y enums, which don't include a value
for the center keyword anymore. They are accompanied by the Side trait, which
allows us to determine whether a side keyword is "left" or "top".

This refactor simplified the parsing and serialisation code and exposed bugs in it,
where it would reject valid <position> values followed by arbitrary tokens,
and where it would fail to prefer "left" to "right" when serialising positions
in basic shapes.
2017-05-10 16:56:01 +02:00
Nazım Can Altınova
f8710bc189
stylo: Support other unit types in computed angle 2017-05-01 16:25:18 +03:00
Anthony Ramine
ae82cdab34 Parse interpolation hints (fixes #15166) 2017-04-27 15:04:36 +02:00
cku
2f91276280 Stylo: Remove the second parameter(with_url) of nsStyleImage::set. 2017-04-27 00:07:38 +08:00
Ravi Shankar
61a17993eb Cleanup position and make use of generic Position for its users 2017-04-25 17:32:45 +05:30
Ravi Shankar
f4b18643c2 Cleanup Polygon and make it generic 2017-04-25 17:13:45 +05:30
Ravi Shankar
0249270f61 Create a module for generics and make BorderRadiusSize generic 2017-04-25 17:13:41 +05:30
Anthony Ramine
d5cd34dec8 Implement -webkit-radial-gradient() (fixes #15441) 2017-04-20 11:26:47 +02:00
Nazım Can Altınova
d0619a7c5c
stylo: Implement shape-outside property 2017-04-12 16:06:03 +03:00