function resolveSizeMode (val) {
    if (val.constructor === String) {
        switch (val.toLowerCase()) {
            case 'relative':
            case 'default': return Size.RELATIVE;
            case 'absolute': return Size.ABSOLUTE;
            case 'render': return Size.RENDER;
            default: throw new Error('unknown size mode: ' + val);
        }
    }
    else if (val < 0 || val > Size.RENDER) throw new Error('unknown size mode: ' + val);
    return val;
}
Private method to allow for polymorphism in the size mode such that strings
or the numbers from the enumeration can be used.

@method

@param {String|Number} val The Size mode to resolve.

@return {Number} the resolved size mode from the enumeration.