コード例 #1
0
void RenderDataGrid::recalcStyleForColumns()
{
    DataGridColumnList* columns = gridElement()->columns();
    unsigned length = columns->length();
    for (unsigned i = 0; i < length; ++i)
        recalcStyleForColumn(columns->item(i));
}
JSValue JSC_HOST_CALL jsDataGridColumnListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSDataGridColumnList::s_info))
        return throwError(exec, TypeError);
    JSDataGridColumnList* castedThisObj = static_cast<JSDataGridColumnList*>(asObject(thisValue));
    DataGridColumnList* imp = static_cast<DataGridColumnList*>(castedThisObj->impl());
    int index = args.at(0).toInt32(exec);
    if (index < 0) {
        setDOMException(exec, INDEX_SIZE_ERR);
        return jsUndefined();
    }


    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->item(index)));
    return result;
}
コード例 #3
0
void RenderDataGrid::paintColumnHeaders(PaintInfo& paintInfo, int tx, int ty)
{
    DataGridColumnList* columns = gridElement()->columns();
    unsigned length = columns->length();
    for (unsigned i = 0; i < length; ++i) {
        DataGridColumn* column = columns->item(i);
        RenderStyle* columnStyle = headerStyle(column);

        // Don't render invisible columns.
        if (!columnStyle || columnStyle->display() == NONE || columnStyle->visibility() != VISIBLE)
            continue;
        
        // Paint the column header if it intersects the dirty rect.
        IntRect columnRect(column->rect());
        columnRect.move(tx, ty);
        if (columnRect.intersects(paintInfo.rect))
            paintColumnHeader(column, paintInfo, tx, ty);
    }
}