-
Notifications
You must be signed in to change notification settings - Fork 165
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
Detect line endings when wrapping occurs between elements #774
Conversation
Build succeeded. |
Build succeeded. |
@@ -549,6 +549,37 @@ gui.SelectionControllerTests = function SelectionControllerTests(runner) { | |||
t.newPosition = getCursorPosition().position; | |||
r.shouldBe(t, "t.newPosition", "3"); | |||
} | |||
function testCountStepsToLineBoundary_Forward_NonTextWrapPoint() { | |||
// spans actually display as blocks to force the browser to put each text block on it's own line | |||
createOdtDocument("<text:p>ABC<text:span display='block'>DEF</text:span></text:p>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the display='block'
attribute a thing? Should this not be CSS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer lies waiting at line 798 in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah of course. Sneaky :P
419d6d6
to
4cee761
Compare
Build succeeded. |
This is a working nice fix. Please rebase and ship it! |
Line ending detection was relying on wrapping occurring near or in a block of collapsed whitespace. When wrapping occurs between two elements, both previous and next rectangles may be defined, though the vertical overlap will be absent.
Line ending detection is still not stable when the wrap point doesn't span a cursor position (as happens when the wrap occurs over whitespace). Fixing this issue is not easy, so these tests demonstrate the current bad behaviour so at least it is somewhat documented.
4cee761
to
d0e3e9c
Compare
Build succeeded. |
Thanks for reviewing this! |
Detect line endings when wrapping occurs between elements
Line ending detection was relying on wrapping occurring near or in a block of collapsed whitespace. When wrapping occurs between two elements, both previous and next rectangles may be defined, though the vertical overlap will be absent.
Line ending detection is still not stable when the wrap point doesn't span a cursor position (as happens when the wrap occurs over whitespace). Fixing this issue is not easy, so these tests demonstrate the current bad behaviour so at least it is somewhat documented.
Demonstrating line detection problem