function initDocument(targetDocument) {
        // Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.
        // The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).
        injectScrollStyle(targetDocument, styleId, detectionContainerClass);
    }
Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.
Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js