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

Add a new BaseStream.getString(...) method to replace manual bytesToString(BaseStream.getBytes(...)) calls #13320

Merged
merged 2 commits into from May 2, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Given that the bytesToString(BaseStream.getBytes(...)) pattern is somewhat common throughout the src/core/ code, it cannot hurt to add a new BaseStream-method which handles that case internally.

@Snuffleupagus Snuffleupagus changed the title Add a new BaseStream.getString(...) method to replace manual bytesToString(BaseStream.getBytes(...)) calls Add a new BaseStream.getString(...) method to replace manual bytesToString(BaseStream.getBytes(...)) calls May 1, 2021
…ToString(BaseStream.getBytes(...))` calls

Given that the `bytesToString(BaseStream.getBytes(...))` pattern is somewhat common throughout the `src/core/` code, it cannot hurt to add a new `BaseStream`-method which handles that case internally.
…eateFontFaceRule`

The `this.data` property is, when defined, sent from the worker-thread as a `Uint8Array` and there's thus no reason to re-initialize the TypedArray here.
Note also the `FontFaceObject.createNativeFontFace` method just above, where we simply use `this.data` as-is.

The explanation for this code looking like it does is, as is often the case, for historical reasons. Originally we only supported `@font-face`, before the Font Loading API existed, and back then we also polyfilled TypedArrays (using regular Arrays) which should explain this particular line of code.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented May 1, 2021

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/9d85254fc5c2168/output.txt

@pdfjsbot
Copy link

pdfjsbot commented May 1, 2021

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/171fe34438791ac/output.txt

@pdfjsbot
Copy link

pdfjsbot commented May 1, 2021

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/9d85254fc5c2168/output.txt

Total script time: 25.70 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/9d85254fc5c2168/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented May 1, 2021

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/171fe34438791ac/output.txt

Total script time: 29.66 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/171fe34438791ac/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus marked this pull request as ready for review May 2, 2021 08:07
@timvandermeij timvandermeij merged commit 404c2b0 into mozilla:master May 2, 2021
@timvandermeij
Copy link
Contributor

Looks good!

@Snuffleupagus Snuffleupagus deleted the BaseStream-getString branch May 2, 2021 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants