Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate redundancy in CSS code #173

Closed
brson opened this issue Nov 6, 2012 · 2 comments
Closed

Eliminate redundancy in CSS code #173

brson opened this issue Nov 6, 2012 · 2 comments

Comments

@brson
Copy link
Contributor

@brson brson commented Nov 6, 2012

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:

  • Selector matching requires callbacks to query the DOM. There are multiple layers to this, the low-level unsafe vtable callbacks (netsurfcss::raw_handler), a second set of vtable-based callbacks that capture the high-level trait instance (netsurfcss::UntypedHandler), the high level netsurfcss::CssSelectHandler trait, and finally the css::select::SelectHandler trait that is the actual interface used by servo.
  • netsurfcss and css define their own versions of CSS property values that are very similar and converts between them. Some of these can probably be shared, but..
  • netsurfcss and css use different techniques for indicating inherited values. netsurfcss makes inherited values just another variant of each property, like CssBorderWidthInherit, while css defines a CSSValue<T> enum with Inherit and Specified variants.
  • The CSSValue type allows values to be refined to types that are guaranteed not to equal Inherit, which is nice from a type-safety perspective, but introduces yet another conversion where CSSValues must be 'unwrapped'. This conversion can probably be eliminated while maintaining the nice type properties using datasort refinements.
@burg
Copy link

@burg burg commented Nov 6, 2012

CSSValue was some of the first code I wrote, so it's ripe for ripping.

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Dec 9, 2013

This is obsolete now that #1109 and #1112 are landed.

@SimonSapin SimonSapin closed this Dec 9, 2013
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 jyc mentioned this issue Aug 21, 2017
3 of 5 tasks complete
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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.