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

Rewrite rust-css in Rust #243

Closed
brson opened this issue Jan 5, 2013 · 2 comments
Closed

Rewrite rust-css in Rust #243

brson opened this issue Jan 5, 2013 · 2 comments

Comments

@brson
Copy link
Contributor

@brson brson commented Jan 5, 2013

rust-css is our CSS parser and selector matching library. It is currently a thin wrapper around NetSurf's libcss library. Ideally we can rewrite this in two phases - first the parser, then the selector matcher, but they may be too intertwined for that to be a viable strategy.

The current CSS code uses its own string interner. Part of this task will be to unify our CSS string representation with our Rust and JS ones.

@sanxiyn
Copy link
Contributor

@sanxiyn sanxiyn commented Nov 5, 2013

This is basically done (although string interning is still missing). Let's close.

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Nov 5, 2013

This was done in several pull requests, but enabled in #1109 and #1112.

@SimonSapin SimonSapin closed this Nov 5, 2013
glennw pushed a commit to glennw/servo that referenced this issue Jan 16, 2017
Use signed arithmetic to avoid underflow when shrinking window.

fixes servo#236

The underflow occurs when the y co-ordinate of `viewport_size` in the last `render_api.set_root_stacking_context` call is bigger than the y co-ordinate of  `framebuffer_size` in a `renderer.render` call.

The problem is the calculated layer_origin y is negative, but we calculate it using unsigned ints, and then cast to signed just for the gl calls. The two places where this calculated value is used are `gl::scissor` and `gl::viewport`, both of these are perfectly happy with a negative origin point (as far as I know and can tell, but I don't have much experience with opengl), thus I've just changed it so we cast to signed integers early.

The other options would be to require the above doesn't happen, either by using an outdated bigger framebuffer size (which results in the contents of the window moving upwards as the window shrinks), or recalling `set_root_stacking_context` (which is less efficient).
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.