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

Handle multiple paragraphs in input text. #12

Merged
merged 1 commit into from Jul 21, 2015

Conversation

@mbrubeck
Copy link
Contributor

mbrubeck commented Jul 19, 2015

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.

Review on Reviewable

@mbrubeck
Copy link
Contributor Author

mbrubeck commented Jul 19, 2015

@SimonSapin
Copy link
Member

SimonSapin commented Jul 21, 2015

Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


src/lib.rs, line 82 [r1] (raw file):
Is the level of the first paragraph always 0 if you give a Some(_) value for the level parameter of process_text?


Comments from the review on Reviewable.io

@SimonSapin
Copy link
Member

SimonSapin commented Jul 21, 2015

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2015

📌 Commit deb6696 has been approved by SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2015

Testing commit deb6696 with merge 4dbc442...

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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2015

☀️ Test successful - travis

@bors-servo bors-servo merged commit deb6696 into servo:master Jul 21, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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

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