Apply the GRAYSCALE_1BPP optimization when `needsDecode` is set.

The scanned, black-and-white document at
https://bugzilla.mozilla.org/show_bug.cgi?id=835380 doesn't benefit from
the critical GRAYSCALE_1BPP optimization because the optimization is
skipped if `needsDecode` is set.

This change addresses that, and reduces both rendering time and memory
usage for that document by almost 10x.
Fix ensureByte() function name (copy-and-paste error)
Merge pull request #5212 from fkaelberer/fixFunctionName

Fix ensureByte() function name (copy-and-paste error)
Merge pull request #5204 from nnethercote/needsDecode

Apply the GRAYSCALE_1BPP optimization when `needsDecode` is set.
Set transformOrigin for text layer in css.

transformOrigin is set to 0% 0% in all cases. This adds extra memory
impact into the dom tree. It also involves the CustomStyles workaround
to determine the correct css rule for the browser.
By setting all vendor and standard variants in css, the rule is applied
without the dom memory overhead and without the minor computation
overhead to set the value.
no need to set textlayer properties which are overwritten in individual styles.
Merge pull request #5209 from CodingFabian/text-layer-transform-origin

Set transformOrigin for text layer in css.
Avoid creating intermediate strings in sanitizeMetrics

This patch avoids creating many intermediate strings, when adding dummy width/lsb entries for glyphs where those are missing.
For the relevant PDF files in our test suite, the average number of intermediate strings are well over 1000.
Merge pull request #5219 from Snuffleupagus/sanitizeMetrics-avoid-intermediate-strings

Avoid creating intermediate strings in sanitizeMetrics
Merge remote-tracking branch 'upstream/master'