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

Skip explicit level computation when possible. #5

Closed
wants to merge 1 commit into from

Conversation

@mbrubeck
Copy link
Contributor

mbrubeck commented Jun 10, 2015

If the text is all one direction or contains no explicit formatting characters, just set everything to the same level. This is based on optimizations using the flags variable in Gecko's nsBidi class. r? @SimonSapin

Review on Reviewable

@mbrubeck mbrubeck force-pushed the mbrubeck:direction branch from bc4078e to 7445001 Jun 11, 2015
If the text is all one direction or contains no explicit formatting
characters, just set everything to the same level.  This is based on the
`flags` variable in Gecko's nsBidi class.
@bors-servo
Copy link
Contributor

bors-servo commented Jul 15, 2015

The latest upstream changes (presumably #10) made this pull request unmergeable. Please resolve the merge conflicts.

bors-servo pushed a commit that referenced this pull request Jul 21, 2015
Handle multiple paragraphs in input text.

I thought this wasn't needed for Servo, since paragraphs in HTML are (normally) based on markup, so Servo can usually just process one paragraph at a time.  However, for preformatted text, the bidi algorithm must handle multiple paragraphs in a single inline flow.

The important changes here are in `process_text` and `initial_scan`.  Most of the other changes are just renaming variables and functions to make sense in a multi-paragraph world.

`process_text` no longer returns the max embedding level.  This was intended for optimizations, but wasn't actually useful in Servo.  An approach like #5 can provide a replacement for this optimization.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/unicode-bidi/12)
<!-- Reviewable:end -->
@mbrubeck
Copy link
Contributor Author

mbrubeck commented Sep 18, 2015

This needs a rewrite. Closing the PR for now.

@mbrubeck mbrubeck closed this Sep 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.