-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Use span
instead of div
in the text layer
#10197
Conversation
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/e2ac2c1d78b0882/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/3b9b3895a21e26f/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/3b9b3895a21e26f/output.txt Total script time: 19.21 mins
Image differences available at: http://54.67.70.0:8877/3b9b3895a21e26f/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/e2ac2c1d78b0882/output.txt Total script time: 25.07 mins
Image differences available at: http://54.215.176.217:8877/e2ac2c1d78b0882/reftest-analyzer.html#web=eq.log |
It looks like the CSS for the |
Ah, I think you also need to change https://github.com/mozilla/pdf.js/blob/master/test/text_layer_test.css#L25 for the tests. |
Thanks for pointing that out! It looks like there's some other CSS rules that depend on the items being divs as well, I think I've fixed them all in 45279d2. |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 1 Live output at: http://54.215.176.217:8877/779528733d58856/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/219385726c29ce4/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/219385726c29ce4/output.txt Total script time: 19.11 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/779528733d58856/output.txt Total script time: 24.56 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/7daa5ccb06f81eb/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/7daa5ccb06f81eb/output.txt Total script time: 2.84 mins Published |
Thank you for your contribution; I think this is a good improvement! I copy/pasted the following paragraph of the Tracemonkey paper with and without your patch applied. Before applying your patch the result was:
In contrast, after applying your patch the result was:
Obviously there is enough room for improvement, but at least the unnecessary newlines are now gone. Unrelated note: this is also the first time I used GitHub's squash-and-commit feature and it worked really well since it also allows you to choose the new commit message for the squashed commits. |
span
instead of div
in the text layer
@timvandermeij Thanks for merging this! Any thoughs on what to do with #10172? If you think the complexity of that isn't worth it (which I completely understand), one alternative I've been thinking about is whether it would be possible to unconditionally insert a space before every text layer item, which would fix things like your example above; if that sounds OK to you, I can spend some time investigating that further. |
@PalmerAL Yes, I think that one is still a bit too complex, at least in its current form. Perhaps we can do it in smaller steps, i.e., first try to get the spaces right and after that perhaps the newlines. If you can find a solution where the spaces are correct and no double ones are inserted, feel free to create a PR for that and we'll review. I'll close the current PR for you. Thank you for looking into this; if we take small steps here I'm sure we can make more improvements. |
This improves copy/pasting text content since it reduces the amount of unnecessary newlines.