Commit graph

96 commits

Author SHA1 Message Date
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
Nazım Can Altınova
9618363e08
stylo: Add -moz-element support 2017-04-09 21:25:48 +03:00
Xidorn Quan
0a57dbc110 Provide @font-face rules for stylo backend. 2017-03-30 11:41:13 +11:00
Nazım Can Altınova
494238ab29
Add support for -moz-image-rect 2017-03-25 21:58:36 +03:00
cku
e8d8b9984f stylo: Update clip-path glue. 2017-03-17 19:55:31 +08:00
Manish Goregaokar
77d7490d59 stylo: Use ServoBundledURI everywhere else, fix from_ffi to handle the error case
MozReview-Commit-ID: DHNKLm3y5Gv
2017-03-14 09:16:30 -07:00
Xidorn Quan
0cac276891 Simplify defining arc ffi types 2017-02-23 10:22:39 +11:00
Cameron McCormack
5531e38c22 stylo: Don't leak nsStyleCoord::Calc objects when setting gradients. 2017-02-18 18:01:02 +08:00
Hiroyuki Ikezoe
a4cafe7106 Bug 1328787 - Part 6: Update build_gecko.rs and bindings. r=heycam
'RawServoDeclarationBlock' in structs_types in build_gecko.rs and the change in
conversion.rs are needed for using set_arc_leaky() for
PropertyValuePair.mServoDeclarationBlock. Without this change,
mServoDeclarationBlock.set_arc_leaky() is called against RawServoDeclarationBlockVoid.

MozReview-Commit-ID: FZkZ0OclXcP
2017-01-29 09:07:41 +09:00
Emilio Cobos Álvarez
ee48599d1b
style: Document Gecko conversions module. 2017-01-02 12:58:03 +01:00
Emilio Cobos Álvarez
7b4d3deae7
style: Ditch GeckoStyleCoordHelpers, and implement directly on nsStyleCoord. 2017-01-02 12:58:03 +01:00
Emilio Cobos Álvarez
a5f5e48c68
Bug 1304792: stylo: Implement @import. r=heycam
MozReview-Commit-ID: Hw1V66JxIBD
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2016-12-30 13:00:44 +01:00
Cameron McCormack
720942f792 Regenerate bindings. 2016-12-27 11:17:42 +08:00
Cameron McCormack
fc808d9030 Update bindings build script and glue for recent changes. 2016-12-27 10:30:24 +08:00
Xidorn Quan
09ce1320e9 stylo: handle unresolved url value gracefully 2016-12-21 10:14:44 +11:00
Nick Price
5d56946bc2 Maintain Corner type, add None type to AngleOrCorner 2016-12-16 17:49:15 -05:00
Xidorn Quan
bddd467c0e Add insertRule/deleteRule support for stylo 2016-12-01 16:20:02 +11:00
Xidorn Quan
599eb1c9f0 Move Arc<RwLock<_>> out from CssRules tuple 2016-11-29 22:15:13 +11:00
Xidorn Quan
a9296bc89c Add stylo FFI for CSSStyleRule 2016-11-24 10:28:38 +11:00
Xidorn Quan
9d4ab0d3e9 Add stylo FFI for CSSRuleList 2016-11-24 10:28:38 +11:00
Emilio Cobos Álvarez
6c3458767b
style: Refactor and add infrastructure for font metrics in style.
This commit itself only moves things around and adds an extra parameter to the
`apply_declarations` function to eventually handle #14079 correctly.

Probably needs a more granular API to query fonts, á la nsFontMetrics, but
that's trivial to do once this is landed.

Then we should make the font provider mandatory, and implement the missing stylo
bits.
2016-11-13 11:54:10 +01:00
Emilio Cobos Álvarez
5f2e7af864
style: Centralize specified url value handling, and refcount urls. 2016-11-10 13:15:21 +01:00
Nazım Can Altınova
9a2ef2e6ef Move set_image and set_gradient into nsStyleImage impl 2016-11-06 20:08:29 +03:00
Xidorn Quan
0b5c6fb701 Remove the extra level of GeckoDeclarationBlock. 2016-10-18 16:48:50 +11:00
Manish Goregaokar
b2e592b121 Move most of geckolib into style::gecko 2016-09-26 09:07:17 +02:00
Manish Goregaokar
bc9cbc87ba Move gecko_* into style::gecko
Prepping for the next stage where most of geckolib/ is popped in here
2016-09-24 19:25:59 +05:30
Renamed from components/style/gecko_conversions.rs (Browse further)