/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof _yuitest_coverage == "undefined"){
    _yuitest_coverage = {};
    _yuitest_coverline = function(src, line){
        var coverage = _yuitest_coverage[src];
        if (!coverage.lines[line]){
            coverage.calledLines++;
        }
        coverage.lines[line]++;
    };
    _yuitest_coverfunc = function(src, name, line){
        var coverage = _yuitest_coverage[src],
            funcId = name + ":" + line;
        if (!coverage.functions[funcId]){
            coverage.calledFunctions++;
        }
        coverage.functions[funcId]++;
    };
}
_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"] = {
    lines: {},
    functions: {},
    coveredLines: 0,
    calledLines: 0,
    coveredFunctions: 0,
    calledFunctions: 0,
    path: "build/datatable-scroll/datatable-scroll.js",
    code: []
};
_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].code=["YUI.add('datatable-scroll', function (Y, NAME) {","","/**","Adds the ability to make the table rows scrollable while preserving the header","placement.","","@module datatable-scroll","@for DataTable","@since 3.5.0","**/","var YLang = Y.Lang,","    isString = YLang.isString,","    isNumber = YLang.isNumber,","    isArray  = YLang.isArray,","","    Scrollable;","","// Returns the numeric value portion of the computed style, defaulting to 0","function styleDim(node, style) {","    return parseInt(node.getComputedStyle(style), 10) | 0;","}","","/**","_API docs for this extension are included in the DataTable class._","","Adds the ability to make the table rows scrollable while preserving the header","placement.","","There are two types of scrolling, horizontal (x) and vertical (y).  Horizontal","scrolling is achieved by wrapping the entire table in a scrollable container.","Vertical scrolling is achieved by splitting the table headers and data into two","separate tables, the latter of which is wrapped in a vertically scrolling","container.  In this case, column widths of header cells and data cells are kept","in sync programmatically.","","Since the split table synchronization can be costly at runtime, the split is only done if the data in the table stretches beyond the configured `height` value.","","To activate or deactivate scrolling, set the `scrollable` attribute to one of","the following values:",""," * `false` - (default) Scrolling is disabled."," * `true` or 'xy' - If `height` is set, vertical scrolling will be activated, if","            `width` is set, horizontal scrolling will be activated."," * 'x' - Activate horizontal scrolling only. Requires the `width` attribute is","         also set."," * 'y' - Activate vertical scrolling only. Requires the `height` attribute is","         also set.","","@class DataTable.Scrollable","@for DataTable","@since 3.5.0","**/","Y.DataTable.Scrollable = Scrollable = function () {};","","Scrollable.ATTRS = {","    /**","    Activates or deactivates scrolling in the table.  Acceptable values are:","","     * `false` - (default) Scrolling is disabled.","     * `true` or 'xy' - If `height` is set, vertical scrolling will be","       activated, if `width` is set, horizontal scrolling will be activated.","     * 'x' - Activate horizontal scrolling only. Requires the `width` attribute","       is also set.","     * 'y' - Activate vertical scrolling only. Requires the `height` attribute","       is also set.","","    @attribute scrollable","    @type {String|Boolean}","    @value false","    @since 3.5.0","    **/","    scrollable: {","        value: false,","        setter: '_setScrollable'","    }","};","","Y.mix(Scrollable.prototype, {","","    /**","    Scrolls a given row or cell into view if the table is scrolling.  Pass the","    `clientId` of a Model from the DataTable's `data` ModelList or its row","    index to scroll to a row or a [row index, column index] array to scroll to","    a cell.  Alternately, to scroll to any element contained within the table's","    scrolling areas, pass its ID, or the Node itself (though you could just as","    well call `node.scrollIntoView()` yourself, but hey, whatever).","","    @method scrollTo","    @param {String|Number|Number[]|Node} id A row clientId, row index, cell","            coordinate array, id string, or Node","    @return {DataTable}","    @chainable","    @since 3.5.0","    **/","    scrollTo: function (id) {","        var target;","","        if (id && this._tbodyNode && (this._yScrollNode || this._xScrollNode)) {","            if (isArray(id)) {","                target = this.getCell(id);","            } else if (isNumber(id)) { ","                target = this.getRow(id);","            } else if (isString(id)) {","                target = this._tbodyNode.one('#' + id);","            } else if (id instanceof Y.Node &&","                    // TODO: ancestor(yScrollNode, xScrollNode)","                    id.ancestor('.yui3-datatable') === this.get('boundingBox')) {","                target = id;","            }","","            target && target.scrollIntoView();","        }","","        return this;","    },","","    //--------------------------------------------------------------------------","    // Protected properties and methods","    //--------------------------------------------------------------------------","","    /**","    Template for the `<table>` that is used to fix the caption in place when","    the table is horizontally scrolling.","","    @property _CAPTION_TABLE_TEMPLATE","    @type {HTML}","    @value '<table class=\"{className}\" role=\"presentation\"></table>'","    @protected","    @since 3.5.0","    **/","    _CAPTION_TABLE_TEMPLATE: '<table class=\"{className}\" role=\"presentation\"></table>',","","    /**","    Template used to create sizable element liners around header content to","    synchronize fixed header column widths.","","    @property _SCROLL_LINER_TEMPLATE","    @type {HTML}","    @value '<div class=\"{className}\"></div>'","    @protected","    @since 3.5.0","    **/","    _SCROLL_LINER_TEMPLATE: '<div class=\"{className}\"></div>',","","    /**","    Template for the virtual scrollbar needed in \"y\" and \"xy\" scrolling setups.","","    @property _SCROLLBAR_TEMPLATE","    @type {HTML}","    @value '<div class=\"{className}\"><div></div></div>'","    @protected","    @since 3.5.0","    **/","    _SCROLLBAR_TEMPLATE: '<div class=\"{className}\"><div></div></div>',","","    /**","    Template for the `<div>` that is used to contain the table when the table is","    horizontally scrolling.","","    @property _X_SCROLLER_TEMPLATE","    @type {HTML}","    @value '<div class=\"{className}\"></div>'","    @protected","    @since 3.5.0","    **/","    _X_SCROLLER_TEMPLATE: '<div class=\"{className}\"></div>',","","    /**","    Template for the `<table>` used to contain the fixed column headers for","    vertically scrolling tables.","","    @property _Y_SCROLL_HEADER_TEMPLATE","    @type {HTML}","    @value '<table cellspacing=\"0\" role=\"presentation\" aria-hidden=\"true\" class=\"{className}\"></table>'","    @protected","    @since 3.5.0","    **/","    _Y_SCROLL_HEADER_TEMPLATE: '<table cellspacing=\"0\" aria-hidden=\"true\" class=\"{className}\"></table>',","","    /**","    Template for the `<div>` that is used to contain the rows when the table is","    vertically scrolling.","","    @property _Y_SCROLLER_TEMPLATE","    @type {HTML}","    @value '<div class=\"{className}\"><div class=\"{scrollerClassName}\"></div></div>'","    @protected","    @since 3.5.0","    **/","    _Y_SCROLLER_TEMPLATE: '<div class=\"{className}\"><div class=\"{scrollerClassName}\"></div></div>',","","    /**","    Adds padding to the last cells in the fixed header for vertically scrolling","    tables.  This padding is equal in width to the scrollbar, so can't be","    relegated to a stylesheet.","","    @method _addScrollbarPadding","    @protected","    @since 3.5.0","    **/","    _addScrollbarPadding: function () {","        var fixedHeader = this._yScrollHeader,","            headerClass = '.' + this.getClassName('header'),","            scrollbarWidth, rows, header, i, len;","","        if (fixedHeader) {","            scrollbarWidth = Y.DOM.getScrollbarWidth() + 'px';","            rows = fixedHeader.all('tr');","","            for (i = 0, len = rows.size(); i < len; i += +header.get('rowSpan')) {","                header = rows.item(i).all(headerClass).pop();","                header.setStyle('paddingRight', scrollbarWidth);","            }","        }","    },","","    /**","    Reacts to changes in the `scrollable` attribute by updating the `_xScroll`","    and `_yScroll` properties and syncing the scrolling structure accordingly.","","    @method _afterScrollableChange","    @param {EventFacade} e The relevant change event (ignored)","    @protected","    @since 3.5.0","    **/","    _afterScrollableChange: function (e) {","        var scroller = this._xScrollNode;","","        if (this._xScroll && scroller) {","            if (this._yScroll && !this._yScrollNode) {","                scroller.setStyle('paddingRight',","                    Y.DOM.getScrollbarWidth() + 'px');","            } else if (!this._yScroll && this._yScrollNode) {","                scroller.setStyle('paddingRight', '');","            }","        }","","        this._syncScrollUI();","    },","","    /**","    Reacts to changes in the `caption` attribute by adding, removing, or","    syncing the caption table when the table is set to scroll.","","    @method _afterScrollCaptionChange","    @param {EventFacade} e The relevant change event (ignored)","    @protected","    @since 3.5.0","    **/","    _afterScrollCaptionChange: function (e) {","        if (this._xScroll || this._yScroll) {","            this._syncScrollUI();","        }","    },","","    /**","    Reacts to changes in the `columns` attribute of vertically scrolling tables","    by refreshing the fixed headers, scroll container, and virtual scrollbar","    position.","","    @method _afterScrollColumnsChange","    @param {EventFacade} e The relevant change event (ignored)","    @protected","    @since 3.5.0","    **/","    _afterScrollColumnsChange: function (e) {","        if (this._xScroll || this._yScroll) {","            if (this._yScroll && this._yScrollHeader) {","                this._syncScrollHeaders();","            }","","            this._syncScrollUI();","        }","    },","","    /**","    Reacts to changes in vertically scrolling table's `data` ModelList by","    synchronizing the fixed column header widths and virtual scrollbar height.","","    @method _afterScrollDataChange","    @param {EventFacade} e The relevant change event (ignored)","    @protected","    @since 3.5.0","    **/","    _afterScrollDataChange: function (e) {","        if (this._xScroll || this._yScroll) {","            this._syncScrollUI();","        }","    },","","    /**","    Reacts to changes in the `height` attribute of vertically scrolling tables","    by updating the height of the `<div>` wrapping the data table and the","    virtual scrollbar.  If `scrollable` was set to \"y\" or \"xy\" but lacking a","    declared `height` until the received change, `_syncScrollUI` is called to","    create the fixed headers etc.","","    @method _afterScrollHeightChange","    @param {EventFacade} e The relevant change event (ignored)","    @protected","    @since 3.5.0","    **/","    _afterScrollHeightChange: function (e) {","        if (this._yScroll) {","            this._syncScrollUI();","        }","    },","","    /* (not an API doc comment on purpose)","    Reacts to the sort event (if the table is also sortable) by updating the","    fixed header classes to match the data table's headers.","","    THIS IS A HACK that will be removed immediately after the 3.5.0 release.","    If you're reading this and the current version is greater than 3.5.0, I","    should be publicly scolded.","    */","    _afterScrollSort: function (e) {","        var headers, headerClass;","","        if (this._yScroll && this._yScrollHeader) {","            headerClass = '.' + this.getClassName('header');","            headers = this._theadNode.all(headerClass);","","            this._yScrollHeader.all(headerClass).each(function (header, i) {","                header.set('className', headers.item(i).get('className'));","            });","        }","    },","","    /**","    Reacts to changes in the width of scrolling tables by expanding the width of","    the `<div>` wrapping the data table for horizontally scrolling tables or","    upding the position of the virtual scrollbar for vertically scrolling","    tables.","","    @method _afterScrollWidthChange","    @param {EventFacade} e The relevant change event (ignored)","    @protected","    @since 3.5.0","    **/","    _afterScrollWidthChange: function (e) {","        if (this._xScroll || this._yScroll) {","            this._syncScrollUI();","        }","    },","","    /**","    Binds virtual scrollbar interaction to the `_yScrollNode`'s `scrollTop` and","    vice versa.","","    @method _bindScrollbar","    @protected","    @since 3.5.0","    **/","    _bindScrollbar: function () {","        var scrollbar = this._scrollbarNode,","            scroller  = this._yScrollNode;","","        if (scrollbar && scroller && !this._scrollbarEventHandle) {","            this._scrollbarEventHandle = new Y.Event.Handle([","                scrollbar.on('scroll', this._syncScrollPosition, this),","                scroller.on('scroll', this._syncScrollPosition, this)","            ]);","        }","    },","","    /**","    Binds to the window resize event to update the vertical scrolling table","    headers and wrapper `<div>` dimensions.","","    @method _bindScrollResize","    @protected","    @since 3.5.0","    **/","    _bindScrollResize: function () {","        if (!this._scrollResizeHandle) {","            // TODO: sync header widths and scrollbar position.  If the height","            // of the headers has changed, update the scrollbar dims as well.","            this._scrollResizeHandle = Y.on('resize',","                this._syncScrollUI, null, this);","        }","    },","","    /**","    Attaches internal subscriptions to keep the scrolling structure up to date","    with changes in the table's `data`, `columns`, `caption`, or `height`.  The","    `width` is taken care of already.","","    This executes after the table's native `bindUI` method.","","    @method _bindScrollUI","    @protected","    @since 3.5.0","    **/","    _bindScrollUI: function () {","        this.after({","            columnsChange: Y.bind('_afterScrollColumnsChange', this),","            heightChange : Y.bind('_afterScrollHeightChange', this),","            widthChange  : Y.bind('_afterScrollWidthChange', this),","            captionChange: Y.bind('_afterScrollCaptionChange', this),","            scrollableChange: Y.bind('_afterScrollableChange', this),","            // FIXME: this is a last minute hack to work around the fact that","            // DT doesn't use a tableView to render table content that can be","            // replaced with a scrolling table view.  This must be removed asap!","            sort         : Y.bind('_afterScrollSort', this)","        });","","        this.after(['dataChange', '*:add', '*:remove', '*:reset', '*:change'],","            Y.bind('_afterScrollDataChange', this));","    },","","    /**","    Clears the lock and timer used to manage synchronizing the scroll position","    between the vertical scroll container and the virtual scrollbar.","","    @method _clearScrollLock","    @protected","    @since 3.5.0","    **/","    _clearScrollLock: function () {","        if (this._scrollLock) {","            this._scrollLock.cancel();","            delete this._scrollLock;","        }","    },","","    /**","    Creates a virtual scrollbar from the `_SCROLLBAR_TEMPLATE`, assigning it to","    the `_scrollbarNode` property.","","    @method _createScrollbar","    @return {Node} The created Node","    @protected","    @since 3.5.0","    **/","    _createScrollbar: function () {","        var scrollbar = this._scrollbarNode;","","        if (!scrollbar) {","            scrollbar = this._scrollbarNode = Y.Node.create(","                Y.Lang.sub(this._SCROLLBAR_TEMPLATE, {","                    className: this.getClassName('scrollbar')","                }));","","            // IE 6-10 require the scrolled area to be visible (at least 1px)","            // or they don't respond to clicking on the scrollbar rail or arrows","            scrollbar.setStyle('width', (Y.DOM.getScrollbarWidth() + 1) + 'px');","        }","","        return scrollbar;","    },","","    /**","    Creates a separate table to contain the caption when the table is","    configured to scroll vertically or horizontally.","","    @method _createScrollCaptionTable","    @return {Node} The created Node","    @protected","    @since 3.5.0","    **/","    _createScrollCaptionTable: function () {","        if (!this._captionTable) {","            this._captionTable = Y.Node.create(","                Y.Lang.sub(this._CAPTION_TABLE_TEMPLATE, {","                    className: this.getClassName('caption', 'table')","                }));","","            this._captionTable.empty();","        }","","        return this._captionTable;","    },","","    /**","    Populates the `_xScrollNode` property by creating the `<div>` Node described","    by the `_X_SCROLLER_TEMPLATE`.","","    @method _createXScrollNode","    @return {Node} The created Node","    @protected","    @since 3.5.0","    **/","    _createXScrollNode: function () {","        if (!this._xScrollNode) {","            this._xScrollNode = Y.Node.create(","                Y.Lang.sub(this._X_SCROLLER_TEMPLATE, {","                    className: this.getClassName('x','scroller')","                }));","        }","","        return this._xScrollNode;","    },","","    /**","    Populates the `_yScrollHeader` property by creating the `<table>` Node","    described by the `_Y_SCROLL_HEADER_TEMPLATE`.","","    @method _createYScrollHeader","    @return {Node} The created Node","    @protected","    @since 3.5.0","    **/","    _createYScrollHeader: function () {","        var fixedHeader = this._yScrollHeader;","","        if (!fixedHeader) {","            fixedHeader = this._yScrollHeader = Y.Node.create(","                Y.Lang.sub(this._Y_SCROLL_HEADER_TEMPLATE, {","                    className: this.getClassName('scroll','columns')","                }));","        }","","        return fixedHeader;","    },","","    /**","    Populates the `_yScrollNode` property by creating the `<div>` Node described","    by the `_Y_SCROLLER_TEMPLATE`.","","    @method _createYScrollNode","    @return {Node} The created Node","    @protected","    @since 3.5.0","    **/","    _createYScrollNode: function () {","        var scrollerClass;","","        if (!this._yScrollNode) {","            scrollerClass = this.getClassName('y', 'scroller');","","            this._yScrollContainer = Y.Node.create(","                Y.Lang.sub(this._Y_SCROLLER_TEMPLATE, {","                    className: this.getClassName('y','scroller','container'),","                    scrollerClassName: scrollerClass","                }));","","            this._yScrollNode = this._yScrollContainer","                .one('.' + scrollerClass);","        }","","        return this._yScrollContainer;","    },","","    /**","    Removes the nodes used to create horizontal and vertical scrolling and","    rejoins the caption to the main table if needed.","","    @method _disableScrolling","    @protected","    @since 3.5.0","    **/","    _disableScrolling: function () {","        this._removeScrollCaptionTable();","        this._disableXScrolling();","        this._disableYScrolling();","        this._unbindScrollResize();","","        this._uiSetWidth(this.get('width'));","    },","","    /**","    Removes the nodes used to allow horizontal scrolling.","","    @method _disableXScrolling","    @protected","    @since 3.5.0","    **/","    _disableXScrolling: function () {","        this._removeXScrollNode();","    },","","    /**","    Removes the nodes used to allow vertical scrolling.","","    @method _disableYScrolling","    @protected","    @since 3.5.0","    **/","    _disableYScrolling: function () {","        this._removeYScrollHeader();","        this._removeYScrollNode();","        this._removeYScrollContainer();","        this._removeScrollbar();","    },","","    /**","    Cleans up external event subscriptions.","","    @method destructor","    @protected","    @since 3.5.0","    **/","    destructor: function () {","        this._unbindScrollbar();","        this._unbindScrollResize();","        this._clearScrollLock();","    },","","    /**","    Sets up event handlers and AOP advice methods to bind the DataTable's natural","    behaviors with the scrolling APIs and state.","","    @method initializer","    @param {Object} config The config object passed to the constructor (ignored)","    @protected","    @since 3.5.0","    **/","    initializer: function () {","        this._setScrollProperties();","","        this.after(['scrollableChange', 'heightChange', 'widthChange'],","            this._setScrollProperties);","","        this.after('renderView', Y.bind('_syncScrollUI', this));","","        Y.Do.after(this._bindScrollUI, this, 'bindUI');","    },","","    /**","    Removes the table used to house the caption when the table is scrolling.","","    @method _removeScrollCaptionTable","    @protected","    @since 3.5.0","    **/","    _removeScrollCaptionTable: function () {","        if (this._captionTable) {","            if (this._captionNode) {","                this._tableNode.prepend(this._captionNode);","            }","","            this._captionTable.remove().destroy(true);","","            delete this._captionTable;","        }","    },","","    /**","    Removes the `<div>` wrapper used to contain the data table when the table","    is horizontally scrolling.","","    @method _removeXScrollNode","    @protected","    @since 3.5.0","    **/","    _removeXScrollNode: function () {","        var scroller = this._xScrollNode;","","        if (scroller) {","            scroller.replace(scroller.get('childNodes').toFrag());","            scroller.remove().destroy(true);","","            delete this._xScrollNode;","        }","    },","","    /**","    Removes the `<div>` wrapper used to contain the data table and fixed header","    when the table is vertically scrolling.","","    @method _removeYScrollContainer","    @protected","    @since 3.5.0","    **/","    _removeYScrollContainer: function () {","        var scroller = this._yScrollContainer;","","        if (scroller) {","            scroller.replace(scroller.get('childNodes').toFrag());","            scroller.remove().destroy(true);","","            delete this._yScrollContainer;","        }","    },","","    /**","    Removes the `<table>` used to contain the fixed column headers when the","    table is vertically scrolling.","","    @method _removeYScrollHeader","    @protected","    @since 3.5.0","    **/","    _removeYScrollHeader: function () {","        if (this._yScrollHeader) {","            this._yScrollHeader.remove().destroy(true);","","            delete this._yScrollHeader;","        }","    },","","    /**","    Removes the `<div>` wrapper used to contain the data table when the table","    is vertically scrolling.","","    @method _removeYScrollNode","    @protected","    @since 3.5.0","    **/","    _removeYScrollNode: function () {","        var scroller = this._yScrollNode;","","        if (scroller) {","            scroller.replace(scroller.get('childNodes').toFrag());","            scroller.remove().destroy(true);","","            delete this._yScrollNode;","        }","    },","","    /**","    Removes the virtual scrollbar used by scrolling tables.","","    @method _removeScrollbar","    @protected","    @since 3.5.0","    **/","    _removeScrollbar: function () {","        if (this._scrollbarNode) {","            this._scrollbarNode.remove().destroy(true);","","            delete this._scrollbarNode;","        }","        if (this._scrollbarEventHandle) {","            this._scrollbarEventHandle.detach();","","            delete this._scrollbarEventHandle;","        }","    },","","    /**","    Accepts (case insensitive) values \"x\", \"y\", \"xy\", `true`, and `false`.","    `true` is translated to \"xy\" and upper case values are converted to lower","    case.  All other values are invalid.","","    @method _setScrollable","    @param {String|Boolea} val Incoming value for the `scrollable` attribute","    @return {String}","    @protected","    @since 3.5.0","    **/","    _setScrollable: function (val) {","        if (val === true) {","            val = 'xy';","        }","","        if (isString(val)) {","            val = val.toLowerCase();","        }","","        return (val === false || val === 'y' || val === 'x' || val === 'xy') ?","            val :","            Y.Attribute.INVALID_VALUE;","    },","","    /**","    Assigns the `_xScroll` and `_yScroll` properties to true if an","    appropriate value is set in the `scrollable` attribute and the `height`","    and/or `width` is set.","","    @method _setScrollProperties","    @protected","    @since 3.5.0","    **/","    _setScrollProperties: function () {","        var scrollable = this.get('scrollable') || '',","            width      = this.get('width'),","            height     = this.get('height');","","        this._xScroll = width  && scrollable.indexOf('x') > -1;","        this._yScroll = height && scrollable.indexOf('y') > -1;","    },","","    /**","    Keeps the virtual scrollbar and the scrolling `<div>` wrapper around the","    data table in vertically scrolling tables in sync.","","    @method _syncScrollPosition","    @param {DOMEventFacade} e The scroll event","    @protected","    @since 3.5.0","    **/","    _syncScrollPosition: function (e) {","        var scrollbar = this._scrollbarNode,","            scroller  = this._yScrollNode,","            source    = e.currentTarget,","            other;","","        if (scrollbar && scroller) {","            if (this._scrollLock && this._scrollLock.source !== source) {","                return;","            }","","            this._clearScrollLock();","            this._scrollLock = Y.later(300, this, this._clearScrollLock);","            this._scrollLock.source = source;","","            other = (source === scrollbar) ? scroller : scrollbar;","            other.set('scrollTop', source.get('scrollTop'));","        }","    },","","    /**","    Splits the caption from the data `<table>` if the table is configured to","    scroll.  If not, rejoins the caption to the data `<table>` if it needs to","    be.","","    @method _syncScrollCaptionUI","    @protected","    @since 3.5.0","    **/","    _syncScrollCaptionUI: function () {","        var caption      = this._captionNode,","            table        = this._tableNode,","            captionTable = this._captionTable,","            id;","","        if (caption) {","            id = caption.getAttribute('id');","","            if (!captionTable) {","                captionTable = this._createScrollCaptionTable();","","                this.get('contentBox').prepend(captionTable);","            }","","            if (!caption.get('parentNode').compareTo(captionTable)) {","                captionTable.empty().insert(caption);","","                if (!id) {","                    id = Y.stamp(caption);","                    caption.setAttribute('id', id);","                }","","                table.setAttribute('aria-describedby', id);","            }","        } else if (captionTable) {","            this._removeScrollCaptionTable();","        }","    },","","    /**","    Assigns widths to the fixed header columns to match the columns in the data","    table.","","    @method _syncScrollColumnWidths","    @protected","    @since 3.5.0","    **/","    _syncScrollColumnWidths: function () {","        var widths = [];","","        if (this._theadNode && this._yScrollHeader) {","            // Capture dims and assign widths in two passes to avoid reflows for","            // each access of clientWidth/getComputedStyle","            this._theadNode.all('.' + this.getClassName('header'))","                .each(function (header) {","                    widths.push(","                        // FIXME: IE returns the col.style.width from","                        // getComputedStyle even if the column has been","                        // compressed below that width, so it must use","                        // clientWidth. FF requires getComputedStyle because it","                        // uses fractional widths that round up to an overall","                        // cell/table width 1px greater than the data table's","                        // cell/table width, resulting in misaligned columns or","                        // fixed header bleed through. I can't think of a","                        // *reasonable* way to capture the correct width without","                        // a sniff.  Math.min(cW - p, getCS(w)) was imperfect","                        // and punished all browsers, anyway.","                        (Y.UA.ie && Y.UA.ie < 8) ?","                            (header.get('clientWidth') -","                             styleDim(header, 'paddingLeft') -","                             styleDim(header, 'paddingRight')) + 'px' :","                            header.getComputedStyle('width'));","            });","","            this._yScrollHeader.all('.' + this.getClassName('scroll', 'liner'))","                .each(function (liner, i) {","                    liner.setStyle('width', widths[i]);","                });","        }","    },","","    /**","    Creates matching headers in the fixed header table for vertically scrolling","    tables and synchronizes the column widths.","","    @method _syncScrollHeaders","    @protected","    @since 3.5.0","    **/","    _syncScrollHeaders: function () {","        var fixedHeader   = this._yScrollHeader,","            linerTemplate = this._SCROLL_LINER_TEMPLATE,","            linerClass    = this.getClassName('scroll', 'liner'),","            headerClass   = this.getClassName('header'),","            headers       = this._theadNode.all('.' + headerClass);","","        if (this._theadNode && fixedHeader) {","            fixedHeader.empty().appendChild(","                this._theadNode.cloneNode(true));","","            // Prevent duplicate IDs and assign ARIA attributes to hide","            // from screen readers","            fixedHeader.all('[id]').removeAttribute('id');","","            fixedHeader.all('.' + headerClass).each(function (header, i) {","                var liner = Y.Node.create(Y.Lang.sub(linerTemplate, {","                            className: linerClass","                        })),","                    refHeader = headers.item(i);","","                // Can't assign via skin css because sort (and potentially","                // others) might override the padding values.","                liner.setStyle('padding',","                    refHeader.getComputedStyle('paddingTop') + ' ' +","                    refHeader.getComputedStyle('paddingRight') + ' ' +","                    refHeader.getComputedStyle('paddingBottom') + ' ' +","                    refHeader.getComputedStyle('paddingLeft'));","","                liner.appendChild(header.get('childNodes').toFrag());","","                header.appendChild(liner);","            }, this);","","            this._syncScrollColumnWidths();","","            this._addScrollbarPadding();","        }","    },","","    /**","    Wraps the table for X and Y scrolling, if necessary, if the `scrollable`","    attribute is set.  Synchronizes dimensions and DOM placement of all","    scrolling related nodes.","","    @method _syncScrollUI","    @protected","    @since 3.5.0","    **/","    _syncScrollUI: function () {","        var x = this._xScroll,","            y = this._yScroll,","            xScroller  = this._xScrollNode,","            yScroller  = this._yScrollNode,","            scrollLeft = xScroller && xScroller.get('scrollLeft'),","            scrollTop  = yScroller && yScroller.get('scrollTop');","","        this._uiSetScrollable();","","        // TODO: Probably should split this up into syncX, syncY, and syncXY","        if (x || y) {","            if ((this.get('width') || '').slice(-1) === '%') {","                this._bindScrollResize();","            } else {","                this._unbindScrollResize();","            }","","            this._syncScrollCaptionUI();","        } else {","            this._disableScrolling();","        }","","        if (this._yScrollHeader) {","            this._yScrollHeader.setStyle('display', 'none');","        }","","        if (x) {","            if (!y) {","                this._disableYScrolling();","            }","","            this._syncXScrollUI(y);","        }","","        if (y) {","            if (!x) {","                this._disableXScrolling();","            }","","            this._syncYScrollUI(x);","        }","","        // Restore scroll position","        if (scrollLeft && this._xScrollNode) {","            this._xScrollNode.set('scrollLeft', scrollLeft);","        }","        if (scrollTop && this._yScrollNode) {","            this._yScrollNode.set('scrollTop', scrollTop);","        }","    },","","    /**","    Wraps the table in a scrolling `<div>` of the configured width for \"x\"","    scrolling.","","    @method _syncXScrollUI","    @param {Boolean} xy True if the table is configured with scrollable =\"xy\"","    @protected","    @since 3.5.0","    **/","    _syncXScrollUI: function (xy) {","        var scroller     = this._xScrollNode,","            yScroller    = this._yScrollContainer,","            table        = this._tableNode,","            width        = this.get('width'),","            bbWidth      = this.get('boundingBox').get('offsetWidth'),","            scrollbarWidth = Y.DOM.getScrollbarWidth(),","            borderWidth, tableWidth;","","        if (!scroller) {","            scroller = this._createXScrollNode();","","            // Not using table.wrap() because IE went all crazy, wrapping the","            // table in the last td in the table itself.","            (yScroller || table).replace(scroller).appendTo(scroller);","        }","","        // Can't use offsetHeight - clientHeight because IE6 returns","        // clientHeight of 0 intially.","        borderWidth = styleDim(scroller, 'borderLeftWidth') +","                      styleDim(scroller, 'borderRightWidth');","","        scroller.setStyle('width', '');","        this._uiSetDim('width', '');","        if (xy && this._yScrollContainer) {","            this._yScrollContainer.setStyle('width', '');","        }","","        // Lock the table's unconstrained width to avoid configured column","        // widths being ignored","        if (Y.UA.ie && Y.UA.ie < 8) {","            // Have to assign a style and trigger a reflow to allow the","            // subsequent clearing of width + reflow to expand the table to","            // natural width in IE 6","            table.setStyle('width', width);","            table.get('offsetWidth');","        }","        table.setStyle('width', '');","        tableWidth = table.get('offsetWidth');","        table.setStyle('width', tableWidth + 'px');","","        this._uiSetDim('width', width);","","        // Can't use 100% width because the borders add additional width","        // TODO: Cache the border widths, though it won't prevent a reflow","        scroller.setStyle('width', (bbWidth - borderWidth) + 'px');","","        // expand the table to fill the assigned width if it doesn't","        // already overflow the configured width","        if ((scroller.get('offsetWidth') - borderWidth) > tableWidth) {","            // Assumes the wrapped table doesn't have borders","            if (xy) {","                table.setStyle('width', (scroller.get('offsetWidth') -","                     borderWidth - scrollbarWidth) + 'px');","            } else {","                table.setStyle('width', '100%');","            }","        }","    },","","    /**","    Wraps the table in a scrolling `<div>` of the configured height (accounting","    for the caption if there is one) if \"y\" scrolling is enabled.  Otherwise,","    unwraps the table if necessary.","","    @method _syncYScrollUI","    @param {Boolean} xy True if the table is configured with scrollable = \"xy\"","    @protected","    @since 3.5.0","    **/","    _syncYScrollUI: function (xy) {","        var yScroller    = this._yScrollContainer,","            yScrollNode  = this._yScrollNode,","            xScroller    = this._xScrollNode,","            fixedHeader  = this._yScrollHeader,","            scrollbar    = this._scrollbarNode,","            table        = this._tableNode,","            thead        = this._theadNode,","            captionTable = this._captionTable,","            boundingBox  = this.get('boundingBox'),","            contentBox   = this.get('contentBox'),","            width        = this.get('width'),","            height       = boundingBox.get('offsetHeight'),","            scrollbarWidth = Y.DOM.getScrollbarWidth(),","            outerScroller;","","        if (captionTable && !xy) {","            captionTable.setStyle('width', width || '100%');","        }","","        if (!yScroller) {","            yScroller = this._createYScrollNode();","","            yScrollNode = this._yScrollNode;","","            table.replace(yScroller).appendTo(yScrollNode);","        }","","        outerScroller = xy ? xScroller : yScroller;","","        if (!xy) {","            table.setStyle('width', '');","        }","","        // Set the scroller height","        if (xy) {","            // Account for the horizontal scrollbar in the overall height","            height -= scrollbarWidth;","        }","","        yScrollNode.setStyle('height',","            (height - outerScroller.get('offsetTop') -","            // because IE6 is returning clientHeight 0 initially","            styleDim(outerScroller, 'borderTopWidth') -","            styleDim(outerScroller, 'borderBottomWidth')) + 'px');","","        // Set the scroller width","        if (xy) {","            // For xy scrolling tables, the table should expand freely within","            // the x scroller","            yScroller.setStyle('width',","                (table.get('offsetWidth') + scrollbarWidth) + 'px');","        } else {","            this._uiSetYScrollWidth(width);","        }","","        if (captionTable && !xy) {","            captionTable.setStyle('width', yScroller.get('offsetWidth') + 'px');","        }","","        // Allow headerless scrolling","        if (thead && !fixedHeader) {","            fixedHeader = this._createYScrollHeader();","","            yScroller.prepend(fixedHeader);","","            this._syncScrollHeaders();","        }","","        if (fixedHeader) {","            this._syncScrollColumnWidths();","","            fixedHeader.setStyle('display', '');","            // This might need to come back if FF has issues","            //fixedHeader.setStyle('width', '100%');","                //(yScroller.get('clientWidth') + scrollbarWidth) + 'px');","","            if (!scrollbar) {","                scrollbar = this._createScrollbar();","","                this._bindScrollbar();","","                contentBox.prepend(scrollbar);","            }","","            this._uiSetScrollbarHeight();","            this._uiSetScrollbarPosition(outerScroller);","        }","    },","","    /**","    Assigns the appropriate class to the `boundingBox` to identify the DataTable","    as horizontally scrolling, vertically scrolling, or both (adds both classes).","","    Classes added are \"yui3-datatable-scrollable-x\" or \"...-y\"","","    @method _uiSetScrollable","    @protected","    @since 3.5.0","    **/","    _uiSetScrollable: function () {","        this.get('boundingBox')","            .toggleClass(this.getClassName('scrollable','x'), this._xScroll)","            .toggleClass(this.getClassName('scrollable','y'), this._yScroll);","    },","","    /**","    Updates the virtual scrollbar's height to avoid overlapping with the fixed","    headers.","","    @method _uiSetScrollbarHeight","    @protected","    @since 3.5.0","    **/","    _uiSetScrollbarHeight: function () {","        var scrollbar   = this._scrollbarNode,","            scroller    = this._yScrollNode,","            fixedHeader = this._yScrollHeader;","","        if (scrollbar && scroller && fixedHeader) {","            scrollbar.get('firstChild').setStyle('height',","                this._tbodyNode.get('scrollHeight') + 'px');","","            scrollbar.setStyle('height', ","                (parseFloat(scroller.getComputedStyle('height')) -","                 parseFloat(fixedHeader.getComputedStyle('height'))) + 'px');","        }","    },","","    /**","    Updates the virtual scrollbar's placement to avoid overlapping the fixed","    headers or the data table.","","    @method _uiSetScrollbarPosition","    @param {Node} scroller Reference node to position the scrollbar over","    @protected","    @since 3.5.0","    **/","    _uiSetScrollbarPosition: function (scroller) {","        var scrollbar     = this._scrollbarNode,","            fixedHeader   = this._yScrollHeader;","","        if (scrollbar && scroller && fixedHeader) {","            scrollbar.setStyles({","                // Using getCS instead of offsetHeight because FF uses","                // fractional values, but reports ints to offsetHeight, so","                // offsetHeight is unreliable.  It is probably fine to use","                // offsetHeight in this case but this was left in place after","                // fixing an off-by-1px issue in FF 10- by fixing the caption","                // font style so FF picked it up.","                top: (parseFloat(fixedHeader.getComputedStyle('height')) +","                      styleDim(scroller, 'borderTopWidth') +","                      scroller.get('offsetTop')) + 'px',","","                // Minus 1 because IE 6-10 require the scrolled area to be","                // visible by at least 1px or it won't respond to clicks on the","                // scrollbar rail or endcap arrows.","                left: (scroller.get('offsetWidth') -","                       Y.DOM.getScrollbarWidth() - 1 -","                       styleDim(scroller, 'borderRightWidth')) + 'px'","            });","        }","    },","","    /**","    Assigns the width of the `<div>` wrapping the data table in vertically","    scrolling tables.","","    If the table can't compress to the specified width, the container is","    expanded accordingly.","","    @method _uiSetYScrollWidth","    @param {String} width The CSS width to attempt to set","    @protected","    @since 3.5.0","    **/","    _uiSetYScrollWidth: function (width) {","        var scroller = this._yScrollContainer,","            table    = this._tableNode,","            tableWidth, borderWidth, scrollerWidth, scrollbarWidth;","","        if (scroller && table) {","            scrollbarWidth = Y.DOM.getScrollbarWidth();","","            if (width) {","                // Assumes no table border","                borderWidth = scroller.get('offsetWidth') -","                              scroller.get('clientWidth') +","                              scrollbarWidth; // added back at the end","","                // The table's rendered width might be greater than the","                // configured width","                scroller.setStyle('width', width);","","                // Have to subtract the border width from the configured width","                // because the scroller's width will need to be reduced by the","                // border width as well during the width reassignment below.","                scrollerWidth = scroller.get('clientWidth') - borderWidth;","","                // Assumes no table borders","                table.setStyle('width', scrollerWidth + 'px');","","                tableWidth = table.get('offsetWidth');","","                // Expand the scroll node width if the table can't fit.","                // Otherwise, reassign the scroller a pixel width that","                // accounts for the borders.","                scroller.setStyle('width',","                    (tableWidth + scrollbarWidth) + 'px');","            } else {","                // Allow the table to expand naturally","                table.setStyle('width', '');","                scroller.setStyle('width', '');","","                scroller.setStyle('width',","                    (table.get('offsetWidth') + scrollbarWidth) + 'px');","            }","        }","    },","","    /**","    Detaches the scroll event subscriptions used to maintain scroll position","    parity between the scrollable `<div>` wrapper around the data table and the","    virtual scrollbar for vertically scrolling tables.","","    @method _unbindScrollbar","    @protected","    @since 3.5.0","    **/","    _unbindScrollbar: function () {","        if (this._scrollbarEventHandle) {","            this._scrollbarEventHandle.detach();","        }","    },","","    /**","    Detaches the resize event subscription used to maintain column parity for","    vertically scrolling tables with percentage widths.","","    @method _unbindScrollResize","    @protected","    @since 3.5.0","    **/","    _unbindScrollResize: function () {","        if (this._scrollResizeHandle) {","            this._scrollResizeHandle.detach();","            delete this._scrollResizeHandle;","        }","    }","","    /**","    Indicates horizontal table scrolling is enabled.","","    @property _xScroll","    @type {Boolean}","    @default undefined (not initially set)","    @private","    @since 3.5.0","    **/","    //_xScroll: null,","","    /**","    Indicates vertical table scrolling is enabled.","","    @property _yScroll","    @type {Boolean}","    @default undefined (not initially set)","    @private","    @since 3.5.0","    **/","    //_yScroll: null,","","    /**","    Fixed column header `<table>` Node for vertical scrolling tables.","","    @property _yScrollHeader","    @type {Node}","    @default undefined (not initially set)","    @protected","    @since 3.5.0","    **/","    //_yScrollHeader: null,","","    /**","    Overflow Node used to contain the data rows in a vertically scrolling table.","","    @property _yScrollNode","    @type {Node}","    @default undefined (not initially set)","    @protected","    @since 3.5.0","    **/","    //_yScrollNode: null,","","    /**","    Overflow Node used to contain the table headers and data in a horizontally","    scrolling table.","","    @property _xScrollNode","    @type {Node}","    @default undefined (not initially set)","    @protected","    @since 3.5.0","    **/","    //_xScrollNode: null","}, true);","","Y.Base.mix(Y.DataTable, [Scrollable]);","","","}, '3.7.3', {\"requires\": [\"datatable-base\", \"datatable-column-widths\", \"dom-screen\"], \"skinnable\": true});"];
_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].lines = {"1":0,"11":0,"19":0,"20":0,"53":0,"55":0,"78":0,"96":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"108":0,"111":0,"114":0,"202":0,"206":0,"207":0,"208":0,"210":0,"211":0,"212":0,"227":0,"229":0,"230":0,"231":0,"233":0,"234":0,"238":0,"251":0,"252":0,"267":0,"268":0,"269":0,"272":0,"286":0,"287":0,"304":0,"305":0,"318":0,"320":0,"321":0,"322":0,"324":0,"325":0,"342":0,"343":0,"356":0,"359":0,"360":0,"376":0,"379":0,"396":0,"408":0,"421":0,"422":0,"423":0,"437":0,"439":0,"440":0,"447":0,"450":0,"463":0,"464":0,"469":0,"472":0,"485":0,"486":0,"492":0,"505":0,"507":0,"508":0,"514":0,"527":0,"529":0,"530":0,"532":0,"538":0,"542":0,"554":0,"555":0,"556":0,"557":0,"559":0,"570":0,"581":0,"582":0,"583":0,"584":0,"595":0,"596":0,"597":0,"610":0,"612":0,"615":0,"617":0,"628":0,"629":0,"630":0,"633":0,"635":0,"648":0,"650":0,"651":0,"652":0,"654":0,"667":0,"669":0,"670":0,"671":0,"673":0,"686":0,"687":0,"689":0,"702":0,"704":0,"705":0,"706":0,"708":0,"720":0,"721":0,"723":0,"725":0,"726":0,"728":0,"744":0,"745":0,"748":0,"749":0,"752":0,"767":0,"771":0,"772":0,"785":0,"790":0,"791":0,"792":0,"795":0,"796":0,"797":0,"799":0,"800":0,"814":0,"819":0,"820":0,"822":0,"823":0,"825":0,"828":0,"829":0,"831":0,"832":0,"833":0,"836":0,"838":0,"839":0,"852":0,"854":0,"857":0,"859":0,"878":0,"880":0,"894":0,"900":0,"901":0,"906":0,"908":0,"909":0,"916":0,"922":0,"924":0,"927":0,"929":0,"943":0,"950":0,"953":0,"954":0,"955":0,"957":0,"960":0,"962":0,"965":0,"966":0,"969":0,"970":0,"971":0,"974":0,"977":0,"978":0,"979":0,"982":0,"986":0,"987":0,"989":0,"990":0,"1004":0,"1012":0,"1013":0,"1017":0,"1022":0,"1025":0,"1026":0,"1027":0,"1028":0,"1033":0,"1037":0,"1038":0,"1040":0,"1041":0,"1042":0,"1044":0,"1048":0,"1052":0,"1054":0,"1055":0,"1058":0,"1074":0,"1089":0,"1090":0,"1093":0,"1094":0,"1096":0,"1098":0,"1101":0,"1103":0,"1104":0,"1108":0,"1110":0,"1113":0,"1120":0,"1123":0,"1126":0,"1129":0,"1130":0,"1134":0,"1135":0,"1137":0,"1139":0,"1142":0,"1143":0,"1145":0,"1150":0,"1151":0,"1153":0,"1155":0,"1158":0,"1159":0,"1174":0,"1188":0,"1192":0,"1193":0,"1196":0,"1212":0,"1215":0,"1216":0,"1250":0,"1254":0,"1255":0,"1257":0,"1259":0,"1265":0,"1270":0,"1273":0,"1275":0,"1280":0,"1284":0,"1285":0,"1287":0,"1303":0,"1304":0,"1317":0,"1318":0,"1319":0,"1380":0};
_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].functions = {"styleDim:19":0,"scrollTo:95":0,"_addScrollbarPadding:201":0,"_afterScrollableChange:226":0,"_afterScrollCaptionChange:250":0,"_afterScrollColumnsChange:266":0,"_afterScrollDataChange:285":0,"_afterScrollHeightChange:303":0,"(anonymous 2):324":0,"_afterScrollSort:317":0,"_afterScrollWidthChange:341":0,"_bindScrollbar:355":0,"_bindScrollResize:375":0,"_bindScrollUI:395":0,"_clearScrollLock:420":0,"_createScrollbar:436":0,"_createScrollCaptionTable:462":0,"_createXScrollNode:484":0,"_createYScrollHeader:504":0,"_createYScrollNode:526":0,"_disableScrolling:553":0,"_disableXScrolling:569":0,"_disableYScrolling:580":0,"destructor:594":0,"initializer:609":0,"_removeScrollCaptionTable:627":0,"_removeXScrollNode:647":0,"_removeYScrollContainer:666":0,"_removeYScrollHeader:685":0,"_removeYScrollNode:701":0,"_removeScrollbar:719":0,"_setScrollable:743":0,"_setScrollProperties:766":0,"_syncScrollPosition:784":0,"_syncScrollCaptionUI:813":0,"(anonymous 3):858":0,"(anonymous 4):879":0,"_syncScrollColumnWidths:851":0,"(anonymous 5):908":0,"_syncScrollHeaders:893":0,"_syncScrollUI:942":0,"_syncXScrollUI:1003":0,"_syncYScrollUI:1073":0,"_uiSetScrollable:1173":0,"_uiSetScrollbarHeight:1187":0,"_uiSetScrollbarPosition:1211":0,"_uiSetYScrollWidth:1249":0,"_unbindScrollbar:1302":0,"_unbindScrollResize:1316":0,"(anonymous 1):1":0};
_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].coveredLines = 278;
_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].coveredFunctions = 50;
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1);
YUI.add('datatable-scroll', function (Y, NAME) {

/**
Adds the ability to make the table rows scrollable while preserving the header
placement.

@module datatable-scroll
@for DataTable
@since 3.5.0
**/
_yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "(anonymous 1)", 1);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 11);
var YLang = Y.Lang,
    isString = YLang.isString,
    isNumber = YLang.isNumber,
    isArray  = YLang.isArray,

    Scrollable;

// Returns the numeric value portion of the computed style, defaulting to 0
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 19);
function styleDim(node, style) {
    _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "styleDim", 19);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 20);
return parseInt(node.getComputedStyle(style), 10) | 0;
}

/**
_API docs for this extension are included in the DataTable class._

Adds the ability to make the table rows scrollable while preserving the header
placement.

There are two types of scrolling, horizontal (x) and vertical (y).  Horizontal
scrolling is achieved by wrapping the entire table in a scrollable container.
Vertical scrolling is achieved by splitting the table headers and data into two
separate tables, the latter of which is wrapped in a vertically scrolling
container.  In this case, column widths of header cells and data cells are kept
in sync programmatically.

Since the split table synchronization can be costly at runtime, the split is only done if the data in the table stretches beyond the configured `height` value.

To activate or deactivate scrolling, set the `scrollable` attribute to one of
the following values:

 * `false` - (default) Scrolling is disabled.
 * `true` or 'xy' - If `height` is set, vertical scrolling will be activated, if
            `width` is set, horizontal scrolling will be activated.
 * 'x' - Activate horizontal scrolling only. Requires the `width` attribute is
         also set.
 * 'y' - Activate vertical scrolling only. Requires the `height` attribute is
         also set.

@class DataTable.Scrollable
@for DataTable
@since 3.5.0
**/
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 53);
Y.DataTable.Scrollable = Scrollable = function () {};

_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 55);
Scrollable.ATTRS = {
    /**
    Activates or deactivates scrolling in the table.  Acceptable values are:

     * `false` - (default) Scrolling is disabled.
     * `true` or 'xy' - If `height` is set, vertical scrolling will be
       activated, if `width` is set, horizontal scrolling will be activated.
     * 'x' - Activate horizontal scrolling only. Requires the `width` attribute
       is also set.
     * 'y' - Activate vertical scrolling only. Requires the `height` attribute
       is also set.

    @attribute scrollable
    @type {String|Boolean}
    @value false
    @since 3.5.0
    **/
    scrollable: {
        value: false,
        setter: '_setScrollable'
    }
};

_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 78);
Y.mix(Scrollable.prototype, {

    /**
    Scrolls a given row or cell into view if the table is scrolling.  Pass the
    `clientId` of a Model from the DataTable's `data` ModelList or its row
    index to scroll to a row or a [row index, column index] array to scroll to
    a cell.  Alternately, to scroll to any element contained within the table's
    scrolling areas, pass its ID, or the Node itself (though you could just as
    well call `node.scrollIntoView()` yourself, but hey, whatever).

    @method scrollTo
    @param {String|Number|Number[]|Node} id A row clientId, row index, cell
            coordinate array, id string, or Node
    @return {DataTable}
    @chainable
    @since 3.5.0
    **/
    scrollTo: function (id) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "scrollTo", 95);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 96);
var target;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 98);
if (id && this._tbodyNode && (this._yScrollNode || this._xScrollNode)) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 99);
if (isArray(id)) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 100);
target = this.getCell(id);
            } else {_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 101);
if (isNumber(id)) { 
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 102);
target = this.getRow(id);
            } else {_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 103);
if (isString(id)) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 104);
target = this._tbodyNode.one('#' + id);
            } else {_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 105);
if (id instanceof Y.Node &&
                    // TODO: ancestor(yScrollNode, xScrollNode)
                    id.ancestor('.yui3-datatable') === this.get('boundingBox')) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 108);
target = id;
            }}}}

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 111);
target && target.scrollIntoView();
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 114);
return this;
    },

    //--------------------------------------------------------------------------
    // Protected properties and methods
    //--------------------------------------------------------------------------

    /**
    Template for the `<table>` that is used to fix the caption in place when
    the table is horizontally scrolling.

    @property _CAPTION_TABLE_TEMPLATE
    @type {HTML}
    @value '<table class="{className}" role="presentation"></table>'
    @protected
    @since 3.5.0
    **/
    _CAPTION_TABLE_TEMPLATE: '<table class="{className}" role="presentation"></table>',

    /**
    Template used to create sizable element liners around header content to
    synchronize fixed header column widths.

    @property _SCROLL_LINER_TEMPLATE
    @type {HTML}
    @value '<div class="{className}"></div>'
    @protected
    @since 3.5.0
    **/
    _SCROLL_LINER_TEMPLATE: '<div class="{className}"></div>',

    /**
    Template for the virtual scrollbar needed in "y" and "xy" scrolling setups.

    @property _SCROLLBAR_TEMPLATE
    @type {HTML}
    @value '<div class="{className}"><div></div></div>'
    @protected
    @since 3.5.0
    **/
    _SCROLLBAR_TEMPLATE: '<div class="{className}"><div></div></div>',

    /**
    Template for the `<div>` that is used to contain the table when the table is
    horizontally scrolling.

    @property _X_SCROLLER_TEMPLATE
    @type {HTML}
    @value '<div class="{className}"></div>'
    @protected
    @since 3.5.0
    **/
    _X_SCROLLER_TEMPLATE: '<div class="{className}"></div>',

    /**
    Template for the `<table>` used to contain the fixed column headers for
    vertically scrolling tables.

    @property _Y_SCROLL_HEADER_TEMPLATE
    @type {HTML}
    @value '<table cellspacing="0" role="presentation" aria-hidden="true" class="{className}"></table>'
    @protected
    @since 3.5.0
    **/
    _Y_SCROLL_HEADER_TEMPLATE: '<table cellspacing="0" aria-hidden="true" class="{className}"></table>',

    /**
    Template for the `<div>` that is used to contain the rows when the table is
    vertically scrolling.

    @property _Y_SCROLLER_TEMPLATE
    @type {HTML}
    @value '<div class="{className}"><div class="{scrollerClassName}"></div></div>'
    @protected
    @since 3.5.0
    **/
    _Y_SCROLLER_TEMPLATE: '<div class="{className}"><div class="{scrollerClassName}"></div></div>',

    /**
    Adds padding to the last cells in the fixed header for vertically scrolling
    tables.  This padding is equal in width to the scrollbar, so can't be
    relegated to a stylesheet.

    @method _addScrollbarPadding
    @protected
    @since 3.5.0
    **/
    _addScrollbarPadding: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_addScrollbarPadding", 201);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 202);
var fixedHeader = this._yScrollHeader,
            headerClass = '.' + this.getClassName('header'),
            scrollbarWidth, rows, header, i, len;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 206);
if (fixedHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 207);
scrollbarWidth = Y.DOM.getScrollbarWidth() + 'px';
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 208);
rows = fixedHeader.all('tr');

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 210);
for (i = 0, len = rows.size(); i < len; i += +header.get('rowSpan')) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 211);
header = rows.item(i).all(headerClass).pop();
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 212);
header.setStyle('paddingRight', scrollbarWidth);
            }
        }
    },

    /**
    Reacts to changes in the `scrollable` attribute by updating the `_xScroll`
    and `_yScroll` properties and syncing the scrolling structure accordingly.

    @method _afterScrollableChange
    @param {EventFacade} e The relevant change event (ignored)
    @protected
    @since 3.5.0
    **/
    _afterScrollableChange: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_afterScrollableChange", 226);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 227);
var scroller = this._xScrollNode;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 229);
if (this._xScroll && scroller) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 230);
if (this._yScroll && !this._yScrollNode) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 231);
scroller.setStyle('paddingRight',
                    Y.DOM.getScrollbarWidth() + 'px');
            } else {_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 233);
if (!this._yScroll && this._yScrollNode) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 234);
scroller.setStyle('paddingRight', '');
            }}
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 238);
this._syncScrollUI();
    },

    /**
    Reacts to changes in the `caption` attribute by adding, removing, or
    syncing the caption table when the table is set to scroll.

    @method _afterScrollCaptionChange
    @param {EventFacade} e The relevant change event (ignored)
    @protected
    @since 3.5.0
    **/
    _afterScrollCaptionChange: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_afterScrollCaptionChange", 250);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 251);
if (this._xScroll || this._yScroll) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 252);
this._syncScrollUI();
        }
    },

    /**
    Reacts to changes in the `columns` attribute of vertically scrolling tables
    by refreshing the fixed headers, scroll container, and virtual scrollbar
    position.

    @method _afterScrollColumnsChange
    @param {EventFacade} e The relevant change event (ignored)
    @protected
    @since 3.5.0
    **/
    _afterScrollColumnsChange: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_afterScrollColumnsChange", 266);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 267);
if (this._xScroll || this._yScroll) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 268);
if (this._yScroll && this._yScrollHeader) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 269);
this._syncScrollHeaders();
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 272);
this._syncScrollUI();
        }
    },

    /**
    Reacts to changes in vertically scrolling table's `data` ModelList by
    synchronizing the fixed column header widths and virtual scrollbar height.

    @method _afterScrollDataChange
    @param {EventFacade} e The relevant change event (ignored)
    @protected
    @since 3.5.0
    **/
    _afterScrollDataChange: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_afterScrollDataChange", 285);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 286);
if (this._xScroll || this._yScroll) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 287);
this._syncScrollUI();
        }
    },

    /**
    Reacts to changes in the `height` attribute of vertically scrolling tables
    by updating the height of the `<div>` wrapping the data table and the
    virtual scrollbar.  If `scrollable` was set to "y" or "xy" but lacking a
    declared `height` until the received change, `_syncScrollUI` is called to
    create the fixed headers etc.

    @method _afterScrollHeightChange
    @param {EventFacade} e The relevant change event (ignored)
    @protected
    @since 3.5.0
    **/
    _afterScrollHeightChange: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_afterScrollHeightChange", 303);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 304);
if (this._yScroll) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 305);
this._syncScrollUI();
        }
    },

    /* (not an API doc comment on purpose)
    Reacts to the sort event (if the table is also sortable) by updating the
    fixed header classes to match the data table's headers.

    THIS IS A HACK that will be removed immediately after the 3.5.0 release.
    If you're reading this and the current version is greater than 3.5.0, I
    should be publicly scolded.
    */
    _afterScrollSort: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_afterScrollSort", 317);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 318);
var headers, headerClass;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 320);
if (this._yScroll && this._yScrollHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 321);
headerClass = '.' + this.getClassName('header');
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 322);
headers = this._theadNode.all(headerClass);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 324);
this._yScrollHeader.all(headerClass).each(function (header, i) {
                _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "(anonymous 2)", 324);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 325);
header.set('className', headers.item(i).get('className'));
            });
        }
    },

    /**
    Reacts to changes in the width of scrolling tables by expanding the width of
    the `<div>` wrapping the data table for horizontally scrolling tables or
    upding the position of the virtual scrollbar for vertically scrolling
    tables.

    @method _afterScrollWidthChange
    @param {EventFacade} e The relevant change event (ignored)
    @protected
    @since 3.5.0
    **/
    _afterScrollWidthChange: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_afterScrollWidthChange", 341);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 342);
if (this._xScroll || this._yScroll) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 343);
this._syncScrollUI();
        }
    },

    /**
    Binds virtual scrollbar interaction to the `_yScrollNode`'s `scrollTop` and
    vice versa.

    @method _bindScrollbar
    @protected
    @since 3.5.0
    **/
    _bindScrollbar: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_bindScrollbar", 355);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 356);
var scrollbar = this._scrollbarNode,
            scroller  = this._yScrollNode;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 359);
if (scrollbar && scroller && !this._scrollbarEventHandle) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 360);
this._scrollbarEventHandle = new Y.Event.Handle([
                scrollbar.on('scroll', this._syncScrollPosition, this),
                scroller.on('scroll', this._syncScrollPosition, this)
            ]);
        }
    },

    /**
    Binds to the window resize event to update the vertical scrolling table
    headers and wrapper `<div>` dimensions.

    @method _bindScrollResize
    @protected
    @since 3.5.0
    **/
    _bindScrollResize: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_bindScrollResize", 375);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 376);
if (!this._scrollResizeHandle) {
            // TODO: sync header widths and scrollbar position.  If the height
            // of the headers has changed, update the scrollbar dims as well.
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 379);
this._scrollResizeHandle = Y.on('resize',
                this._syncScrollUI, null, this);
        }
    },

    /**
    Attaches internal subscriptions to keep the scrolling structure up to date
    with changes in the table's `data`, `columns`, `caption`, or `height`.  The
    `width` is taken care of already.

    This executes after the table's native `bindUI` method.

    @method _bindScrollUI
    @protected
    @since 3.5.0
    **/
    _bindScrollUI: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_bindScrollUI", 395);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 396);
this.after({
            columnsChange: Y.bind('_afterScrollColumnsChange', this),
            heightChange : Y.bind('_afterScrollHeightChange', this),
            widthChange  : Y.bind('_afterScrollWidthChange', this),
            captionChange: Y.bind('_afterScrollCaptionChange', this),
            scrollableChange: Y.bind('_afterScrollableChange', this),
            // FIXME: this is a last minute hack to work around the fact that
            // DT doesn't use a tableView to render table content that can be
            // replaced with a scrolling table view.  This must be removed asap!
            sort         : Y.bind('_afterScrollSort', this)
        });

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 408);
this.after(['dataChange', '*:add', '*:remove', '*:reset', '*:change'],
            Y.bind('_afterScrollDataChange', this));
    },

    /**
    Clears the lock and timer used to manage synchronizing the scroll position
    between the vertical scroll container and the virtual scrollbar.

    @method _clearScrollLock
    @protected
    @since 3.5.0
    **/
    _clearScrollLock: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_clearScrollLock", 420);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 421);
if (this._scrollLock) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 422);
this._scrollLock.cancel();
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 423);
delete this._scrollLock;
        }
    },

    /**
    Creates a virtual scrollbar from the `_SCROLLBAR_TEMPLATE`, assigning it to
    the `_scrollbarNode` property.

    @method _createScrollbar
    @return {Node} The created Node
    @protected
    @since 3.5.0
    **/
    _createScrollbar: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_createScrollbar", 436);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 437);
var scrollbar = this._scrollbarNode;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 439);
if (!scrollbar) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 440);
scrollbar = this._scrollbarNode = Y.Node.create(
                Y.Lang.sub(this._SCROLLBAR_TEMPLATE, {
                    className: this.getClassName('scrollbar')
                }));

            // IE 6-10 require the scrolled area to be visible (at least 1px)
            // or they don't respond to clicking on the scrollbar rail or arrows
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 447);
scrollbar.setStyle('width', (Y.DOM.getScrollbarWidth() + 1) + 'px');
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 450);
return scrollbar;
    },

    /**
    Creates a separate table to contain the caption when the table is
    configured to scroll vertically or horizontally.

    @method _createScrollCaptionTable
    @return {Node} The created Node
    @protected
    @since 3.5.0
    **/
    _createScrollCaptionTable: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_createScrollCaptionTable", 462);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 463);
if (!this._captionTable) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 464);
this._captionTable = Y.Node.create(
                Y.Lang.sub(this._CAPTION_TABLE_TEMPLATE, {
                    className: this.getClassName('caption', 'table')
                }));

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 469);
this._captionTable.empty();
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 472);
return this._captionTable;
    },

    /**
    Populates the `_xScrollNode` property by creating the `<div>` Node described
    by the `_X_SCROLLER_TEMPLATE`.

    @method _createXScrollNode
    @return {Node} The created Node
    @protected
    @since 3.5.0
    **/
    _createXScrollNode: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_createXScrollNode", 484);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 485);
if (!this._xScrollNode) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 486);
this._xScrollNode = Y.Node.create(
                Y.Lang.sub(this._X_SCROLLER_TEMPLATE, {
                    className: this.getClassName('x','scroller')
                }));
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 492);
return this._xScrollNode;
    },

    /**
    Populates the `_yScrollHeader` property by creating the `<table>` Node
    described by the `_Y_SCROLL_HEADER_TEMPLATE`.

    @method _createYScrollHeader
    @return {Node} The created Node
    @protected
    @since 3.5.0
    **/
    _createYScrollHeader: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_createYScrollHeader", 504);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 505);
var fixedHeader = this._yScrollHeader;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 507);
if (!fixedHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 508);
fixedHeader = this._yScrollHeader = Y.Node.create(
                Y.Lang.sub(this._Y_SCROLL_HEADER_TEMPLATE, {
                    className: this.getClassName('scroll','columns')
                }));
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 514);
return fixedHeader;
    },

    /**
    Populates the `_yScrollNode` property by creating the `<div>` Node described
    by the `_Y_SCROLLER_TEMPLATE`.

    @method _createYScrollNode
    @return {Node} The created Node
    @protected
    @since 3.5.0
    **/
    _createYScrollNode: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_createYScrollNode", 526);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 527);
var scrollerClass;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 529);
if (!this._yScrollNode) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 530);
scrollerClass = this.getClassName('y', 'scroller');

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 532);
this._yScrollContainer = Y.Node.create(
                Y.Lang.sub(this._Y_SCROLLER_TEMPLATE, {
                    className: this.getClassName('y','scroller','container'),
                    scrollerClassName: scrollerClass
                }));

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 538);
this._yScrollNode = this._yScrollContainer
                .one('.' + scrollerClass);
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 542);
return this._yScrollContainer;
    },

    /**
    Removes the nodes used to create horizontal and vertical scrolling and
    rejoins the caption to the main table if needed.

    @method _disableScrolling
    @protected
    @since 3.5.0
    **/
    _disableScrolling: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_disableScrolling", 553);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 554);
this._removeScrollCaptionTable();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 555);
this._disableXScrolling();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 556);
this._disableYScrolling();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 557);
this._unbindScrollResize();

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 559);
this._uiSetWidth(this.get('width'));
    },

    /**
    Removes the nodes used to allow horizontal scrolling.

    @method _disableXScrolling
    @protected
    @since 3.5.0
    **/
    _disableXScrolling: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_disableXScrolling", 569);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 570);
this._removeXScrollNode();
    },

    /**
    Removes the nodes used to allow vertical scrolling.

    @method _disableYScrolling
    @protected
    @since 3.5.0
    **/
    _disableYScrolling: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_disableYScrolling", 580);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 581);
this._removeYScrollHeader();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 582);
this._removeYScrollNode();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 583);
this._removeYScrollContainer();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 584);
this._removeScrollbar();
    },

    /**
    Cleans up external event subscriptions.

    @method destructor
    @protected
    @since 3.5.0
    **/
    destructor: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "destructor", 594);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 595);
this._unbindScrollbar();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 596);
this._unbindScrollResize();
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 597);
this._clearScrollLock();
    },

    /**
    Sets up event handlers and AOP advice methods to bind the DataTable's natural
    behaviors with the scrolling APIs and state.

    @method initializer
    @param {Object} config The config object passed to the constructor (ignored)
    @protected
    @since 3.5.0
    **/
    initializer: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "initializer", 609);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 610);
this._setScrollProperties();

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 612);
this.after(['scrollableChange', 'heightChange', 'widthChange'],
            this._setScrollProperties);

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 615);
this.after('renderView', Y.bind('_syncScrollUI', this));

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 617);
Y.Do.after(this._bindScrollUI, this, 'bindUI');
    },

    /**
    Removes the table used to house the caption when the table is scrolling.

    @method _removeScrollCaptionTable
    @protected
    @since 3.5.0
    **/
    _removeScrollCaptionTable: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_removeScrollCaptionTable", 627);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 628);
if (this._captionTable) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 629);
if (this._captionNode) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 630);
this._tableNode.prepend(this._captionNode);
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 633);
this._captionTable.remove().destroy(true);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 635);
delete this._captionTable;
        }
    },

    /**
    Removes the `<div>` wrapper used to contain the data table when the table
    is horizontally scrolling.

    @method _removeXScrollNode
    @protected
    @since 3.5.0
    **/
    _removeXScrollNode: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_removeXScrollNode", 647);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 648);
var scroller = this._xScrollNode;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 650);
if (scroller) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 651);
scroller.replace(scroller.get('childNodes').toFrag());
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 652);
scroller.remove().destroy(true);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 654);
delete this._xScrollNode;
        }
    },

    /**
    Removes the `<div>` wrapper used to contain the data table and fixed header
    when the table is vertically scrolling.

    @method _removeYScrollContainer
    @protected
    @since 3.5.0
    **/
    _removeYScrollContainer: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_removeYScrollContainer", 666);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 667);
var scroller = this._yScrollContainer;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 669);
if (scroller) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 670);
scroller.replace(scroller.get('childNodes').toFrag());
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 671);
scroller.remove().destroy(true);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 673);
delete this._yScrollContainer;
        }
    },

    /**
    Removes the `<table>` used to contain the fixed column headers when the
    table is vertically scrolling.

    @method _removeYScrollHeader
    @protected
    @since 3.5.0
    **/
    _removeYScrollHeader: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_removeYScrollHeader", 685);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 686);
if (this._yScrollHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 687);
this._yScrollHeader.remove().destroy(true);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 689);
delete this._yScrollHeader;
        }
    },

    /**
    Removes the `<div>` wrapper used to contain the data table when the table
    is vertically scrolling.

    @method _removeYScrollNode
    @protected
    @since 3.5.0
    **/
    _removeYScrollNode: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_removeYScrollNode", 701);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 702);
var scroller = this._yScrollNode;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 704);
if (scroller) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 705);
scroller.replace(scroller.get('childNodes').toFrag());
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 706);
scroller.remove().destroy(true);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 708);
delete this._yScrollNode;
        }
    },

    /**
    Removes the virtual scrollbar used by scrolling tables.

    @method _removeScrollbar
    @protected
    @since 3.5.0
    **/
    _removeScrollbar: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_removeScrollbar", 719);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 720);
if (this._scrollbarNode) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 721);
this._scrollbarNode.remove().destroy(true);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 723);
delete this._scrollbarNode;
        }
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 725);
if (this._scrollbarEventHandle) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 726);
this._scrollbarEventHandle.detach();

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 728);
delete this._scrollbarEventHandle;
        }
    },

    /**
    Accepts (case insensitive) values "x", "y", "xy", `true`, and `false`.
    `true` is translated to "xy" and upper case values are converted to lower
    case.  All other values are invalid.

    @method _setScrollable
    @param {String|Boolea} val Incoming value for the `scrollable` attribute
    @return {String}
    @protected
    @since 3.5.0
    **/
    _setScrollable: function (val) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_setScrollable", 743);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 744);
if (val === true) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 745);
val = 'xy';
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 748);
if (isString(val)) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 749);
val = val.toLowerCase();
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 752);
return (val === false || val === 'y' || val === 'x' || val === 'xy') ?
            val :
            Y.Attribute.INVALID_VALUE;
    },

    /**
    Assigns the `_xScroll` and `_yScroll` properties to true if an
    appropriate value is set in the `scrollable` attribute and the `height`
    and/or `width` is set.

    @method _setScrollProperties
    @protected
    @since 3.5.0
    **/
    _setScrollProperties: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_setScrollProperties", 766);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 767);
var scrollable = this.get('scrollable') || '',
            width      = this.get('width'),
            height     = this.get('height');

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 771);
this._xScroll = width  && scrollable.indexOf('x') > -1;
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 772);
this._yScroll = height && scrollable.indexOf('y') > -1;
    },

    /**
    Keeps the virtual scrollbar and the scrolling `<div>` wrapper around the
    data table in vertically scrolling tables in sync.

    @method _syncScrollPosition
    @param {DOMEventFacade} e The scroll event
    @protected
    @since 3.5.0
    **/
    _syncScrollPosition: function (e) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_syncScrollPosition", 784);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 785);
var scrollbar = this._scrollbarNode,
            scroller  = this._yScrollNode,
            source    = e.currentTarget,
            other;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 790);
if (scrollbar && scroller) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 791);
if (this._scrollLock && this._scrollLock.source !== source) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 792);
return;
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 795);
this._clearScrollLock();
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 796);
this._scrollLock = Y.later(300, this, this._clearScrollLock);
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 797);
this._scrollLock.source = source;

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 799);
other = (source === scrollbar) ? scroller : scrollbar;
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 800);
other.set('scrollTop', source.get('scrollTop'));
        }
    },

    /**
    Splits the caption from the data `<table>` if the table is configured to
    scroll.  If not, rejoins the caption to the data `<table>` if it needs to
    be.

    @method _syncScrollCaptionUI
    @protected
    @since 3.5.0
    **/
    _syncScrollCaptionUI: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_syncScrollCaptionUI", 813);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 814);
var caption      = this._captionNode,
            table        = this._tableNode,
            captionTable = this._captionTable,
            id;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 819);
if (caption) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 820);
id = caption.getAttribute('id');

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 822);
if (!captionTable) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 823);
captionTable = this._createScrollCaptionTable();

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 825);
this.get('contentBox').prepend(captionTable);
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 828);
if (!caption.get('parentNode').compareTo(captionTable)) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 829);
captionTable.empty().insert(caption);

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 831);
if (!id) {
                    _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 832);
id = Y.stamp(caption);
                    _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 833);
caption.setAttribute('id', id);
                }

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 836);
table.setAttribute('aria-describedby', id);
            }
        } else {_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 838);
if (captionTable) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 839);
this._removeScrollCaptionTable();
        }}
    },

    /**
    Assigns widths to the fixed header columns to match the columns in the data
    table.

    @method _syncScrollColumnWidths
    @protected
    @since 3.5.0
    **/
    _syncScrollColumnWidths: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_syncScrollColumnWidths", 851);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 852);
var widths = [];

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 854);
if (this._theadNode && this._yScrollHeader) {
            // Capture dims and assign widths in two passes to avoid reflows for
            // each access of clientWidth/getComputedStyle
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 857);
this._theadNode.all('.' + this.getClassName('header'))
                .each(function (header) {
                    _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "(anonymous 3)", 858);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 859);
widths.push(
                        // FIXME: IE returns the col.style.width from
                        // getComputedStyle even if the column has been
                        // compressed below that width, so it must use
                        // clientWidth. FF requires getComputedStyle because it
                        // uses fractional widths that round up to an overall
                        // cell/table width 1px greater than the data table's
                        // cell/table width, resulting in misaligned columns or
                        // fixed header bleed through. I can't think of a
                        // *reasonable* way to capture the correct width without
                        // a sniff.  Math.min(cW - p, getCS(w)) was imperfect
                        // and punished all browsers, anyway.
                        (Y.UA.ie && Y.UA.ie < 8) ?
                            (header.get('clientWidth') -
                             styleDim(header, 'paddingLeft') -
                             styleDim(header, 'paddingRight')) + 'px' :
                            header.getComputedStyle('width'));
            });

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 878);
this._yScrollHeader.all('.' + this.getClassName('scroll', 'liner'))
                .each(function (liner, i) {
                    _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "(anonymous 4)", 879);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 880);
liner.setStyle('width', widths[i]);
                });
        }
    },

    /**
    Creates matching headers in the fixed header table for vertically scrolling
    tables and synchronizes the column widths.

    @method _syncScrollHeaders
    @protected
    @since 3.5.0
    **/
    _syncScrollHeaders: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_syncScrollHeaders", 893);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 894);
var fixedHeader   = this._yScrollHeader,
            linerTemplate = this._SCROLL_LINER_TEMPLATE,
            linerClass    = this.getClassName('scroll', 'liner'),
            headerClass   = this.getClassName('header'),
            headers       = this._theadNode.all('.' + headerClass);

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 900);
if (this._theadNode && fixedHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 901);
fixedHeader.empty().appendChild(
                this._theadNode.cloneNode(true));

            // Prevent duplicate IDs and assign ARIA attributes to hide
            // from screen readers
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 906);
fixedHeader.all('[id]').removeAttribute('id');

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 908);
fixedHeader.all('.' + headerClass).each(function (header, i) {
                _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "(anonymous 5)", 908);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 909);
var liner = Y.Node.create(Y.Lang.sub(linerTemplate, {
                            className: linerClass
                        })),
                    refHeader = headers.item(i);

                // Can't assign via skin css because sort (and potentially
                // others) might override the padding values.
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 916);
liner.setStyle('padding',
                    refHeader.getComputedStyle('paddingTop') + ' ' +
                    refHeader.getComputedStyle('paddingRight') + ' ' +
                    refHeader.getComputedStyle('paddingBottom') + ' ' +
                    refHeader.getComputedStyle('paddingLeft'));

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 922);
liner.appendChild(header.get('childNodes').toFrag());

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 924);
header.appendChild(liner);
            }, this);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 927);
this._syncScrollColumnWidths();

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 929);
this._addScrollbarPadding();
        }
    },

    /**
    Wraps the table for X and Y scrolling, if necessary, if the `scrollable`
    attribute is set.  Synchronizes dimensions and DOM placement of all
    scrolling related nodes.

    @method _syncScrollUI
    @protected
    @since 3.5.0
    **/
    _syncScrollUI: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_syncScrollUI", 942);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 943);
var x = this._xScroll,
            y = this._yScroll,
            xScroller  = this._xScrollNode,
            yScroller  = this._yScrollNode,
            scrollLeft = xScroller && xScroller.get('scrollLeft'),
            scrollTop  = yScroller && yScroller.get('scrollTop');

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 950);
this._uiSetScrollable();

        // TODO: Probably should split this up into syncX, syncY, and syncXY
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 953);
if (x || y) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 954);
if ((this.get('width') || '').slice(-1) === '%') {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 955);
this._bindScrollResize();
            } else {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 957);
this._unbindScrollResize();
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 960);
this._syncScrollCaptionUI();
        } else {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 962);
this._disableScrolling();
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 965);
if (this._yScrollHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 966);
this._yScrollHeader.setStyle('display', 'none');
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 969);
if (x) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 970);
if (!y) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 971);
this._disableYScrolling();
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 974);
this._syncXScrollUI(y);
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 977);
if (y) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 978);
if (!x) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 979);
this._disableXScrolling();
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 982);
this._syncYScrollUI(x);
        }

        // Restore scroll position
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 986);
if (scrollLeft && this._xScrollNode) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 987);
this._xScrollNode.set('scrollLeft', scrollLeft);
        }
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 989);
if (scrollTop && this._yScrollNode) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 990);
this._yScrollNode.set('scrollTop', scrollTop);
        }
    },

    /**
    Wraps the table in a scrolling `<div>` of the configured width for "x"
    scrolling.

    @method _syncXScrollUI
    @param {Boolean} xy True if the table is configured with scrollable ="xy"
    @protected
    @since 3.5.0
    **/
    _syncXScrollUI: function (xy) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_syncXScrollUI", 1003);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1004);
var scroller     = this._xScrollNode,
            yScroller    = this._yScrollContainer,
            table        = this._tableNode,
            width        = this.get('width'),
            bbWidth      = this.get('boundingBox').get('offsetWidth'),
            scrollbarWidth = Y.DOM.getScrollbarWidth(),
            borderWidth, tableWidth;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1012);
if (!scroller) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1013);
scroller = this._createXScrollNode();

            // Not using table.wrap() because IE went all crazy, wrapping the
            // table in the last td in the table itself.
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1017);
(yScroller || table).replace(scroller).appendTo(scroller);
        }

        // Can't use offsetHeight - clientHeight because IE6 returns
        // clientHeight of 0 intially.
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1022);
borderWidth = styleDim(scroller, 'borderLeftWidth') +
                      styleDim(scroller, 'borderRightWidth');

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1025);
scroller.setStyle('width', '');
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1026);
this._uiSetDim('width', '');
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1027);
if (xy && this._yScrollContainer) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1028);
this._yScrollContainer.setStyle('width', '');
        }

        // Lock the table's unconstrained width to avoid configured column
        // widths being ignored
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1033);
if (Y.UA.ie && Y.UA.ie < 8) {
            // Have to assign a style and trigger a reflow to allow the
            // subsequent clearing of width + reflow to expand the table to
            // natural width in IE 6
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1037);
table.setStyle('width', width);
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1038);
table.get('offsetWidth');
        }
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1040);
table.setStyle('width', '');
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1041);
tableWidth = table.get('offsetWidth');
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1042);
table.setStyle('width', tableWidth + 'px');

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1044);
this._uiSetDim('width', width);

        // Can't use 100% width because the borders add additional width
        // TODO: Cache the border widths, though it won't prevent a reflow
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1048);
scroller.setStyle('width', (bbWidth - borderWidth) + 'px');

        // expand the table to fill the assigned width if it doesn't
        // already overflow the configured width
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1052);
if ((scroller.get('offsetWidth') - borderWidth) > tableWidth) {
            // Assumes the wrapped table doesn't have borders
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1054);
if (xy) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1055);
table.setStyle('width', (scroller.get('offsetWidth') -
                     borderWidth - scrollbarWidth) + 'px');
            } else {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1058);
table.setStyle('width', '100%');
            }
        }
    },

    /**
    Wraps the table in a scrolling `<div>` of the configured height (accounting
    for the caption if there is one) if "y" scrolling is enabled.  Otherwise,
    unwraps the table if necessary.

    @method _syncYScrollUI
    @param {Boolean} xy True if the table is configured with scrollable = "xy"
    @protected
    @since 3.5.0
    **/
    _syncYScrollUI: function (xy) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_syncYScrollUI", 1073);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1074);
var yScroller    = this._yScrollContainer,
            yScrollNode  = this._yScrollNode,
            xScroller    = this._xScrollNode,
            fixedHeader  = this._yScrollHeader,
            scrollbar    = this._scrollbarNode,
            table        = this._tableNode,
            thead        = this._theadNode,
            captionTable = this._captionTable,
            boundingBox  = this.get('boundingBox'),
            contentBox   = this.get('contentBox'),
            width        = this.get('width'),
            height       = boundingBox.get('offsetHeight'),
            scrollbarWidth = Y.DOM.getScrollbarWidth(),
            outerScroller;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1089);
if (captionTable && !xy) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1090);
captionTable.setStyle('width', width || '100%');
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1093);
if (!yScroller) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1094);
yScroller = this._createYScrollNode();

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1096);
yScrollNode = this._yScrollNode;

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1098);
table.replace(yScroller).appendTo(yScrollNode);
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1101);
outerScroller = xy ? xScroller : yScroller;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1103);
if (!xy) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1104);
table.setStyle('width', '');
        }

        // Set the scroller height
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1108);
if (xy) {
            // Account for the horizontal scrollbar in the overall height
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1110);
height -= scrollbarWidth;
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1113);
yScrollNode.setStyle('height',
            (height - outerScroller.get('offsetTop') -
            // because IE6 is returning clientHeight 0 initially
            styleDim(outerScroller, 'borderTopWidth') -
            styleDim(outerScroller, 'borderBottomWidth')) + 'px');

        // Set the scroller width
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1120);
if (xy) {
            // For xy scrolling tables, the table should expand freely within
            // the x scroller
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1123);
yScroller.setStyle('width',
                (table.get('offsetWidth') + scrollbarWidth) + 'px');
        } else {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1126);
this._uiSetYScrollWidth(width);
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1129);
if (captionTable && !xy) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1130);
captionTable.setStyle('width', yScroller.get('offsetWidth') + 'px');
        }

        // Allow headerless scrolling
        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1134);
if (thead && !fixedHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1135);
fixedHeader = this._createYScrollHeader();

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1137);
yScroller.prepend(fixedHeader);

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1139);
this._syncScrollHeaders();
        }

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1142);
if (fixedHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1143);
this._syncScrollColumnWidths();

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1145);
fixedHeader.setStyle('display', '');
            // This might need to come back if FF has issues
            //fixedHeader.setStyle('width', '100%');
                //(yScroller.get('clientWidth') + scrollbarWidth) + 'px');

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1150);
if (!scrollbar) {
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1151);
scrollbar = this._createScrollbar();

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1153);
this._bindScrollbar();

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1155);
contentBox.prepend(scrollbar);
            }

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1158);
this._uiSetScrollbarHeight();
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1159);
this._uiSetScrollbarPosition(outerScroller);
        }
    },

    /**
    Assigns the appropriate class to the `boundingBox` to identify the DataTable
    as horizontally scrolling, vertically scrolling, or both (adds both classes).

    Classes added are "yui3-datatable-scrollable-x" or "...-y"

    @method _uiSetScrollable
    @protected
    @since 3.5.0
    **/
    _uiSetScrollable: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_uiSetScrollable", 1173);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1174);
this.get('boundingBox')
            .toggleClass(this.getClassName('scrollable','x'), this._xScroll)
            .toggleClass(this.getClassName('scrollable','y'), this._yScroll);
    },

    /**
    Updates the virtual scrollbar's height to avoid overlapping with the fixed
    headers.

    @method _uiSetScrollbarHeight
    @protected
    @since 3.5.0
    **/
    _uiSetScrollbarHeight: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_uiSetScrollbarHeight", 1187);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1188);
var scrollbar   = this._scrollbarNode,
            scroller    = this._yScrollNode,
            fixedHeader = this._yScrollHeader;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1192);
if (scrollbar && scroller && fixedHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1193);
scrollbar.get('firstChild').setStyle('height',
                this._tbodyNode.get('scrollHeight') + 'px');

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1196);
scrollbar.setStyle('height', 
                (parseFloat(scroller.getComputedStyle('height')) -
                 parseFloat(fixedHeader.getComputedStyle('height'))) + 'px');
        }
    },

    /**
    Updates the virtual scrollbar's placement to avoid overlapping the fixed
    headers or the data table.

    @method _uiSetScrollbarPosition
    @param {Node} scroller Reference node to position the scrollbar over
    @protected
    @since 3.5.0
    **/
    _uiSetScrollbarPosition: function (scroller) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_uiSetScrollbarPosition", 1211);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1212);
var scrollbar     = this._scrollbarNode,
            fixedHeader   = this._yScrollHeader;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1215);
if (scrollbar && scroller && fixedHeader) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1216);
scrollbar.setStyles({
                // Using getCS instead of offsetHeight because FF uses
                // fractional values, but reports ints to offsetHeight, so
                // offsetHeight is unreliable.  It is probably fine to use
                // offsetHeight in this case but this was left in place after
                // fixing an off-by-1px issue in FF 10- by fixing the caption
                // font style so FF picked it up.
                top: (parseFloat(fixedHeader.getComputedStyle('height')) +
                      styleDim(scroller, 'borderTopWidth') +
                      scroller.get('offsetTop')) + 'px',

                // Minus 1 because IE 6-10 require the scrolled area to be
                // visible by at least 1px or it won't respond to clicks on the
                // scrollbar rail or endcap arrows.
                left: (scroller.get('offsetWidth') -
                       Y.DOM.getScrollbarWidth() - 1 -
                       styleDim(scroller, 'borderRightWidth')) + 'px'
            });
        }
    },

    /**
    Assigns the width of the `<div>` wrapping the data table in vertically
    scrolling tables.

    If the table can't compress to the specified width, the container is
    expanded accordingly.

    @method _uiSetYScrollWidth
    @param {String} width The CSS width to attempt to set
    @protected
    @since 3.5.0
    **/
    _uiSetYScrollWidth: function (width) {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_uiSetYScrollWidth", 1249);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1250);
var scroller = this._yScrollContainer,
            table    = this._tableNode,
            tableWidth, borderWidth, scrollerWidth, scrollbarWidth;

        _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1254);
if (scroller && table) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1255);
scrollbarWidth = Y.DOM.getScrollbarWidth();

            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1257);
if (width) {
                // Assumes no table border
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1259);
borderWidth = scroller.get('offsetWidth') -
                              scroller.get('clientWidth') +
                              scrollbarWidth; // added back at the end

                // The table's rendered width might be greater than the
                // configured width
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1265);
scroller.setStyle('width', width);

                // Have to subtract the border width from the configured width
                // because the scroller's width will need to be reduced by the
                // border width as well during the width reassignment below.
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1270);
scrollerWidth = scroller.get('clientWidth') - borderWidth;

                // Assumes no table borders
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1273);
table.setStyle('width', scrollerWidth + 'px');

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1275);
tableWidth = table.get('offsetWidth');

                // Expand the scroll node width if the table can't fit.
                // Otherwise, reassign the scroller a pixel width that
                // accounts for the borders.
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1280);
scroller.setStyle('width',
                    (tableWidth + scrollbarWidth) + 'px');
            } else {
                // Allow the table to expand naturally
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1284);
table.setStyle('width', '');
                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1285);
scroller.setStyle('width', '');

                _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1287);
scroller.setStyle('width',
                    (table.get('offsetWidth') + scrollbarWidth) + 'px');
            }
        }
    },

    /**
    Detaches the scroll event subscriptions used to maintain scroll position
    parity between the scrollable `<div>` wrapper around the data table and the
    virtual scrollbar for vertically scrolling tables.

    @method _unbindScrollbar
    @protected
    @since 3.5.0
    **/
    _unbindScrollbar: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_unbindScrollbar", 1302);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1303);
if (this._scrollbarEventHandle) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1304);
this._scrollbarEventHandle.detach();
        }
    },

    /**
    Detaches the resize event subscription used to maintain column parity for
    vertically scrolling tables with percentage widths.

    @method _unbindScrollResize
    @protected
    @since 3.5.0
    **/
    _unbindScrollResize: function () {
        _yuitest_coverfunc("build/datatable-scroll/datatable-scroll.js", "_unbindScrollResize", 1316);
_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1317);
if (this._scrollResizeHandle) {
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1318);
this._scrollResizeHandle.detach();
            _yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1319);
delete this._scrollResizeHandle;
        }
    }

    /**
    Indicates horizontal table scrolling is enabled.

    @property _xScroll
    @type {Boolean}
    @default undefined (not initially set)
    @private
    @since 3.5.0
    **/
    //_xScroll: null,

    /**
    Indicates vertical table scrolling is enabled.

    @property _yScroll
    @type {Boolean}
    @default undefined (not initially set)
    @private
    @since 3.5.0
    **/
    //_yScroll: null,

    /**
    Fixed column header `<table>` Node for vertical scrolling tables.

    @property _yScrollHeader
    @type {Node}
    @default undefined (not initially set)
    @protected
    @since 3.5.0
    **/
    //_yScrollHeader: null,

    /**
    Overflow Node used to contain the data rows in a vertically scrolling table.

    @property _yScrollNode
    @type {Node}
    @default undefined (not initially set)
    @protected
    @since 3.5.0
    **/
    //_yScrollNode: null,

    /**
    Overflow Node used to contain the table headers and data in a horizontally
    scrolling table.

    @property _xScrollNode
    @type {Node}
    @default undefined (not initially set)
    @protected
    @since 3.5.0
    **/
    //_xScrollNode: null
}, true);

_yuitest_coverline("build/datatable-scroll/datatable-scroll.js", 1380);
Y.Base.mix(Y.DataTable, [Scrollable]);


}, '3.7.3', {"requires": ["datatable-base", "datatable-column-widths", "dom-screen"], "skinnable": true});
