Attach (recommended) or Link to PDF file here:
[shading_pattern.pdf](https://github.com/mozilla/pdf.js/files/1532598/shading_pattern.pdf)

Configuration:
- Web browser and its version: Firefox 57.0
- Operating system and its version: Debian GNU/Linux 9 64-bit
- PDF.js version: tried with Firefox's 1.9.583 and with online viewer 2.0.185
- Is a browser extension: no

Steps to reproduce the problem:
1. Open the attached file with the online viewer https://mozilla.github.io/pdf.js/web/viewer.html

What is the expected behavior? (add screenshot)
![image](https://user-images.githubusercontent.com/11061462/33626267-d9a57dee-d9d8-11e7-8712-cfa17c038259.png)
(Image captured from Adobe Reader CS.) The shading needs to be inside the letters.

What went wrong? (add screenshot)
![image](https://user-images.githubusercontent.com/11061462/33626285-eaabd462-d9d8-11e7-94e2-96480b57750d.png)
The shading seems to be displaced and upside-down, for it does not cover all the characters of the word.

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

Util,
  warn,
} from "../shared/util.js";
import { getShadingPattern, TilingPattern } from "./pattern_helper.js";
import { PixelsPerInch } from "./display_utils.js";
const MIN_FONT_SIZE = 16;
const MAX_FONT_SIZE = 100;
const MAX_GROUP_SIZE = 4096;
const MAX_CACHED_CANVAS_PATTERNS = 2;
const EXECUTION_TIME = 15; 
const EXECUTION_STEPS = 10;
const COMPILE_TYPE3_GLYPHS = true;
const MAX_SIZE_TO_COMPILE = 1000;
const FULL_CHUNK_HEIGHT = 16;
const LINEWIDTH_SCALE_FACTOR = 1.000001;
/**
 * Overrides certain methods on a 2d ctx so that when they are called they
 * will also call the same method on the destCtx. The methods that are
 * overridden are all the transformation state modifiers, path creation, and
 * save/restore. We only forward these specific methods because they are the
 * only state modifiers that we cannot copy over when we switch contexts.
 *
 * To remove mirroring call `ctx._removeMirroring()`.
 *
 * @param {Object} ctx - The 2d canvas context that will duplicate its calls on
 *   the destCtx.
 * @param {Object} destCtx - The 2d canvas context that will receive the
 *   forwarded calls.
 */
function mirrorContextOperations(ctx, destCtx) {