function adjustRectangle(rect, frameDimensions, columnFullWidth, isRtl, isVwm,
            shouldLookForFirstVisibleColumn) {

        // Rectangle adjustment is not needed in VWM since it does not deal with columns
        if (isVwm) {
            return;
        }

        if (isRtl) {
            columnFullWidth *= -1; // horizontal shifts are reverted in RTL mode
        }

        // first we go left/right (rebasing onto the very first column available)
        while (rect.top < 0) {
            offsetRectangle(rect, -columnFullWidth, frameDimensions.height);
        }

        // ... then, if necessary (for visibility offset checks),
        // each column is tried again (now in reverse order)
        // the loop will be stopped when the column is aligned with a viewport
        // (i.e., is the first visible one).
        if (shouldLookForFirstVisibleColumn) {
            while (rect.bottom >= frameDimensions.height) {
                if (isRectVisible(rect, frameDimensions, isVwm)) {
                    break;
                }
                offsetRectangle(rect, columnFullWidth, -frameDimensions.height);
            }
        }
    }
@private

When element is spilled over two or more columns,
most of the time Webkit-based browsers
still assign a single clientRectangle to it, setting its `top` property to negative value
(so it looks like it's rendered based on the second column)
Alas, sometimes they decide to continue the leftmost column - from _below_ its real height.
In this case, `bottom` property is actually greater than element's height and had to be adjusted accordingly.

Ugh.

@param {Object} rect
@param {Object} frameDimensions
@param {number} columnFullWidth
@param {boolean} isRtl
@param {boolean} isVwm               isVerticalWritingMode
@param {boolean} shouldLookForFirstVisibleColumn
     If set, there'll be two-phase adjustment
     (to align a rectangle with a viewport)