Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEliminate redundancy in CSS code #173
Closed
Comments
|
CSSValue was some of the first code I wrote, so it's ripe for ripping. |
glennw
added a commit
to glennw/servo
that referenced
this issue
Jan 16, 2017
Add support for GPU generated raster ops to have texture atlas border edges.
jyc
added a commit
to jyc/servo
that referenced
this issue
Aug 21, 2017
Some disabled tests: - We don't implement <transform-list> serialization. - We don't serialize colors according to spec & as Gecko does. - We don't round floats correctly (see rust-cssparser/servo#173). - We don't implement <resolution>. It's not clear whether or not we actually need initialValue (see css-houdini-drafts/servo#286). Part 13 of a series of patches to implement the CSS Properties & Values API.
jyc
added a commit
to jyc/servo
that referenced
this issue
Aug 23, 2017
Some disabled tests: - We don't implement <transform-list> serialization. - We don't serialize colors according to spec & as Gecko does. - We don't round floats correctly (see rust-cssparser/servo#173). - We don't implement <resolution>. It's not clear whether or not we actually need initialValue (see css-houdini-drafts/servo#286). Part 13 of a series of patches to implement the CSS Properties & Values API.
jyc
added a commit
to jyc/servo
that referenced
this issue
Aug 23, 2017
Some disabled tests: - We don't implement <transform-list> serialization. - We don't serialize colors according to spec & as Gecko does. - We don't round floats correctly (see rust-cssparser/servo#173). - We don't implement <resolution>. It's not clear whether or not we actually need initialValue (see css-houdini-drafts/servo#286). Part 13 of a series of patches to implement the CSS Properties & Values API.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The CSS code has many layers of abstraction, dedicated to converting unsafe libcss bindings to Servo's own CSS interface. Adding new features involves modifying a pretty deep stack and takes time.
Some things:
netsurfcss::raw_handler), a second set of vtable-based callbacks that capture the high-level trait instance (netsurfcss::UntypedHandler), the high levelnetsurfcss::CssSelectHandlertrait, and finally thecss::select::SelectHandlertrait that is the actual interface used by servo.netsurfcssandcssdefine their own versions of CSS property values that are very similar and converts between them. Some of these can probably be shared, but..netsurfcssandcssuse different techniques for indicating inherited values.netsurfcssmakes inherited values just another variant of each property, likeCssBorderWidthInherit, whilecssdefines aCSSValue<T>enum withInheritandSpecifiedvariants.CSSValuetype allows values to be refined to types that are guaranteed not to equalInherit, which is nice from a type-safety perspective, but introduces yet another conversion whereCSSValues must be 'unwrapped'. This conversion can probably be eliminated while maintaining the nice type properties using datasort refinements.