-
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
[api-minor] Re-factor the basic textLayer-functionality #18104
Conversation
39108ff
to
5f420d6
Compare
434fc90
to
4bf0c98
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/6f5dff3be3cfc49/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/c19c5296ae9d6d4/output.txt |
This is very old code, and predates e.g. the introduction of JavaScript classes, which creates unnecessarily unwieldy code in the viewer. By introducing a new `TextLayer` class in the API, similar to how e.g. the `AnnotationLayer` looks, we're able to keep most parameters on the class-instance itself. This removes the need to manually track them in the viewer, and simplifies the call-sites. This also removes the `numTextDivs` parameter from the "textlayerrendered" event, since that's only added to support default-viewer functionality that no longer exists. Finally we try, as far as possible, to polyfill the old `renderTextLayer` and `updateTextLayer` functions since they are exposed in the library API. For *simple* invocations of `renderTextLayer` the behaviour should thus be the same, with only a warning printed in the console.
4bf0c98
to
15b5808
Compare
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/6f5dff3be3cfc49/output.txt Total script time: 27.72 mins
Image differences available at: http://54.241.84.105:8877/6f5dff3be3cfc49/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c19c5296ae9d6d4/output.txt Total script time: 43.31 mins
Image differences available at: http://54.193.163.58:8877/c19c5296ae9d6d4/reftest-analyzer.html#web=eq.log |
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/addb4a9f667b2f3/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/71b8377b4bd7745/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/addb4a9f667b2f3/output.txt Total script time: 7.31 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/71b8377b4bd7745/output.txt Total script time: 21.36 mins
|
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.
I don't see anything obviously wrong.
Thank you for doing that.
If everything is fine for you, please merge it asap, I'll make a release in m-c after in order to test it irl in nightly.
This is very old code, and predates e.g. the introduction of JavaScript classes, which creates unnecessarily unwieldy code in the viewer.
By introducing a new
TextLayer
class in the API, similar to how e.g. theAnnotationLayer
looks, we're able to keep most parameters on the class-instance itself. This removes the need to manually track them in the viewer, and simplifies the call-sites.This also removes the
numTextDivs
parameter from the "textlayerrendered" event, since that's only added to support default-viewer functionality that no longer exists.Finally we try, as far as possible, to polyfill the old
renderTextLayer
andupdateTextLayer
functions since they are exposed in the library API.For simple invocations of
renderTextLayer
the behaviour should thus be the same, with only a warning printed in the console.