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

Commits on May 1, 2021

  1. Add a new BaseStream.getString(...) method to replace manual `bytes…

    …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.
    Snuffleupagus committed May 1, 2021
    Configuration menu
    Copy the full SHA
    3624f9e View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary TypedArray re-initialization in `FontFaceObject.cr…

    …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 committed May 1, 2021
    Configuration menu
    Copy the full SHA
    90b5fcb View commit details
    Browse the repository at this point in the history