亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? render_box.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
?? 第 1 頁 / 共 4 頁
字號:

void RenderBox::calcVerticalMargins()
{
    if( isTableCell() ) {
	// table margins are basically infinite
	m_marginTop = TABLECELLMARGIN;
	m_marginBottom = TABLECELLMARGIN;
	return;
    }

    Length tm = style()->marginTop();
    Length bm = style()->marginBottom();

    // margins are calculated with respect to the _width_ of
    // the containing block (8.3)
    int cw = containingBlock()->contentWidth();

    m_marginTop = tm.minWidth(cw);
    m_marginBottom = bm.minWidth(cw);
}

void RenderBox::setStaticX(int staticX)
{
    m_staticX = staticX;
}

void RenderBox::setStaticY(int staticY)
{
    m_staticY = staticY;
}

void RenderBox::calcAbsoluteHorizontal()
{
    const int AUTO = -666666;
    int l,r,w,ml,mr,cw;

    int pab = borderLeft()+ borderRight()+ paddingLeft()+ paddingRight();

    l=r=ml=mr=w=AUTO;

    // We don't use containingBlock(), since we may be positioned by an enclosing relpositioned inline.
    RenderObject* cb = container();
    cw = containingBlockWidth() + cb->paddingLeft() + cb->paddingRight();

    if(!style()->left().isVariable())
        l = style()->left().width(cw);
    if(!style()->right().isVariable())
        r = style()->right().width(cw);
    if(!style()->width().isVariable())
        w = style()->width().width(cw);
    else if (isReplaced())
        w = intrinsicWidth();
    if(!style()->marginLeft().isVariable())
        ml = style()->marginLeft().width(cw);
    if(!style()->marginRight().isVariable())
        mr = style()->marginRight().width(cw);


//    printf("h1: w=%d, l=%d, r=%d, ml=%d, mr=%d\n",w,l,r,ml,mr);

    int static_distance=0;
    if ((parent()->style()->direction()==LTR && (l==AUTO && r==AUTO ))
            || style()->left().isStatic())
    {
        static_distance = m_staticX - cb->borderLeft(); // Should already have been set through layout of the parent().
        RenderObject* po = parent();
        for (; po && po != cb; po = po->parent())
            static_distance += po->xPos();

        if (l==AUTO || style()->left().isStatic())
            l = static_distance;
    }

    else if ((parent()->style()->direction()==RTL && (l==AUTO && r==AUTO ))
            || style()->right().isStatic())
    {
        RenderObject* po = parent();
        static_distance = m_staticX - cb->borderLeft(); // Should already have been set through layout of the parent().
        while (po && po!=containingBlock()) {
            static_distance+=po->xPos();
            po=po->parent();
        }

        if (r==AUTO || style()->right().isStatic())
            r = static_distance;
    }


    if (l!=AUTO && w!=AUTO && r!=AUTO)
    {
        // left, width, right all given, play with margins
        int ot = l + w + r + pab;

        if (ml==AUTO && mr==AUTO)
        {
            // both margins auto, solve for equality
            ml = (cw - ot)/2;
            mr = cw - ot - ml;
        }
        else if (ml==AUTO)
            // solve for left margin
            ml = cw - ot - mr;
        else if (mr==AUTO)
            // solve for right margin
            mr = cw - ot - ml;
        else
        {
            // overconstrained, solve according to dir
            if (style()->direction()==LTR)
                r = cw - ( l + w + ml + mr + pab);
            else
                l = cw - ( r + w + ml + mr + pab);
        }
    }
    else
    {
        // one or two of (left, width, right) missing, solve

        // auto margins are ignored
        if (ml==AUTO) ml = 0;
        if (mr==AUTO) mr = 0;

        //1. solve left & width.
        if (l==AUTO && w==AUTO && r!=AUTO)
        {
            // From section 10.3.7 of the CSS2.1 specification.
            // "The shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width)."
            w = QMIN(QMAX(m_minWidth-pab, cw - ( r + ml + mr + pab)), m_maxWidth-pab);
            l = cw - ( r + w + ml + mr + pab);
        }
        else

        //2. solve left & right. use static positioning.
        if (l==AUTO && w!=AUTO && r==AUTO)
        {
            if (style()->direction()==RTL)
            {
                r = static_distance;
                l = cw - ( r + w + ml + mr + pab);
            }
            else
            {
                l = static_distance;
                r = cw - ( l + w + ml + mr + pab);
            }

        }
        else

        //3. solve width & right.
        if (l!=AUTO && w==AUTO && r==AUTO)
        {
            // From section 10.3.7 of the CSS2.1 specification.
            // "The shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width)."
            w = QMIN(QMAX(m_minWidth-pab, cw - ( l + ml + mr + pab)), m_maxWidth-pab);
            r = cw - ( l + w + ml + mr + pab);
        }
        else

        //4. solve left
        if (l==AUTO && w!=AUTO && r!=AUTO)
            l = cw - ( r + w + ml + mr + pab);
        else

        //5. solve width
        if (l!=AUTO && w==AUTO && r!=AUTO)
            w = cw - ( r + l + ml + mr + pab);
        else

        //6. solve right
        if (l!=AUTO && w!=AUTO && r==AUTO)
            r = cw - ( l + w + ml + mr + pab);
    }

    m_width = w + pab;
    m_marginLeft = ml;
    m_marginRight = mr;
    m_x = l + ml + cb->borderLeft();
//    printf("h: w=%d, l=%d, r=%d, ml=%d, mr=%d\n",w,l,r,ml,mr);
}


void RenderBox::calcAbsoluteVertical()
{
    // css2 spec 10.6.4 & 10.6.5

    // based on
    // http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata
    // (actually updated 2000-10-24)
    // that introduces static-position value for top, left & right

    const int AUTO = -666666;
    int t,b,h,mt,mb,ch;

    t=b=h=mt=mb=AUTO;

    int pab = borderTop()+borderBottom()+paddingTop()+paddingBottom();

    // We don't use containingBlock(), since we may be positioned by an enclosing relpositioned inline.
    RenderObject* cb = container();
    if (cb->isRoot()) // Even in strict mode (where we don't grow the root to fill the viewport) other browsers
                      // position as though the root fills the viewport.
        ch = cb->availableHeight();
    else
        ch = cb->height() - cb->borderTop() - cb->borderBottom();

    if(!style()->top().isVariable())
        t = style()->top().width(ch);
    if(!style()->bottom().isVariable())
        b = style()->bottom().width(ch);
    if (isTable() && style()->height().isVariable())
        // Height is never unsolved for tables. "auto" means shrink to fit.  Use our
        // height instead.
        h = m_height - pab;
    else if(!style()->height().isVariable())
    {
        h = style()->height().width(ch);

        if (m_height-pab > h) {
            setOverflowHeight(m_height + pab - (paddingBottom() + borderBottom()));
            m_height = h+pab;
        }
    }
    else if (isReplaced())
        h = intrinsicHeight();

    if(!style()->marginTop().isVariable())
        mt = style()->marginTop().width(ch);
    if(!style()->marginBottom().isVariable())
        mb = style()->marginBottom().width(ch);

    int static_top=0;
    if ((t==AUTO && b==AUTO ) || style()->top().isStatic())
    {
        // calc hypothetical location in the normal flow
        // used for 1) top=static-position
        //          2) top, bottom, height are all auto -> calc top -> 3.
        //          3) precalc for case 2 below
        static_top = m_staticY - cb->borderTop(); // Should already have been set through layout of the parent().
        RenderObject* po = parent();
        for (; po && po != cb; po = po->parent())
            static_top += po->yPos();

        if (h==AUTO || style()->top().isStatic())
            t = static_top;
    }

    if (t!=AUTO && h!=AUTO && b!=AUTO)
    {
        // top, height, bottom all given, play with margins
        int ot = h + t + b + pab;

        if (mt==AUTO && mb==AUTO)
        {
            // both margins auto, solve for equality
            mt = (ch - ot)/2;
            mb = ch - ot - mt;
        }
        else if (mt==AUTO)
            // solve for top margin
            mt = ch - ot - mb;
        else if (mb==AUTO)
            // solve for bottom margin
            mb = ch - ot - mt;
        else
            // overconstrained, solve for bottom
            b = ch - ( h+t+mt+mb+pab);
    }
    else
    {
        // one or two of (top, height, bottom) missing, solve

        // auto margins are ignored
        if (mt==AUTO) mt = 0;
        if (mb==AUTO) mb = 0;

        //1. solve top & height. use content height.
        if (t==AUTO && h==AUTO && b!=AUTO)
        {
            h = m_height-pab;
            t = ch - ( h+b+mt+mb+pab);
        }
        else

        //2. solve top & bottom. use static positioning.
        if (t==AUTO && h!=AUTO && b==AUTO)
        {
            t = static_top;
            b = ch - ( h+t+mt+mb+pab);
        }
        else

        //3. solve height & bottom. use content height.
        if (t!=AUTO && h==AUTO && b==AUTO)
        {
            h = m_height-pab;
            b = ch - ( h+t+mt+mb+pab);
        }
        else

        //4. solve top
        if (t==AUTO && h!=AUTO && b!=AUTO)
            t = ch - ( h+b+mt+mb+pab);
        else

        //5. solve height
        if (t!=AUTO && h==AUTO && b!=AUTO)
            h = ch - ( t+b+mt+mb+pab);
        else

        //6. solve bottom
        if (t!=AUTO && h!=AUTO && b==AUTO)
            b = ch - ( h+t+mt+mb+pab);
    }

    if (m_height<h+pab) //content must still fit
        m_height = h+pab;

    if (hasOverflowClip() && m_height > h+pab)
        m_height = h+pab;

    // Do not allow the height to be negative.  This can happen when someone specifies both top and bottom
    // but the containing block height is less than top, e.g., top:20px, bottom:0, containing block height 16.
    m_height = kMax(0, m_height);

    m_marginTop = mt;
    m_marginBottom = mb;
    m_y = t + mt + cb->borderTop();

//    printf("v: h=%d, t=%d, b=%d, mt=%d, mb=%d, m_y=%d\n",h,t,b,mt,mb,m_y);

}

QRect RenderBox::caretRect(int offset, EAffinity affinity, int *extraWidthToEndOfLine)
{
    // FIXME: Is it OK to check only first child instead of picking
    // right child based on offset? Is it OK to pass the same offset
    // along to the child instead of offset 0 or whatever?

    // propagate it downwards to its children, someone will feel responsible
    RenderObject *child = firstChild();
    if (child) {
        QRect result = child->caretRect(offset, affinity, extraWidthToEndOfLine);
        // FIXME: in-band signalling!
        if (result.isEmpty())
            return result;
    }

    int _x, _y, height;

    // if not, use the extents of this box
    // offset 0 means left, offset 1 means right
    _x = xPos() + (offset == 0 ? 0 : m_width);
    InlineBox *box = inlineBoxWrapper();
    if (box) {
        height = box->root()->bottomOverflow() - box->root()->topOverflow();
        _y = box->root()->topOverflow();
    }
    else {
        _y = yPos();
        height = m_height;
    }
    // If height of box is smaller than font height, use the latter one,
    // otherwise the caret might become invisible.
    //
    // Also, if the box is not a replaced element, always use the font height.
    // This prevents the "big caret" bug described in:
    // <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point
    //
    // FIXME: ignoring :first-line, missing good reason to take care of
    int fontHeight = style()->fontMetrics().height();
    if (fontHeight > height || !isReplaced())
        height = fontHeight;

    int absx, absy;
    RenderObject *cb = containingBlock();
    if (cb && cb != this && cb->absolutePosition(absx,absy)) {
        _x += absx;
        _y += absy;
    }
    else {
        // we don't know our absolute position, and there is no point returning
        // just a relative one
        return QRect();
    }

    if (extraWidthToEndOfLine)
        *extraWidthToEndOfLine = m_width - _x;

    return QRect(_x, _y, 1, height);
}

int RenderBox::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
{
    return includeSelf ? m_height : 0;
}

int RenderBox::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
{
    return includeSelf ? m_width : 0;
}

int RenderBox::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
{
    return includeSelf ? 0 : m_width;
}

#undef DEBUG_LAYOUT

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产伦理精品不卡| 亚洲自拍偷拍网站| 国产一区二区三区免费观看| 日韩精品中文字幕在线一区| 韩国一区二区三区| 亚洲国产精品精华液2区45| 成人综合婷婷国产精品久久| 国产精品久久国产精麻豆99网站| 91影视在线播放| 亚洲综合色成人| 91精品国产入口| 国产大陆a不卡| 一区二区三区在线视频观看58| 欧美三级电影网站| 日韩黄色在线观看| 国产丝袜在线精品| 欧美综合天天夜夜久久| 蜜桃av一区二区| 欧美激情中文字幕一区二区| 欧美日韩视频第一区| 精品无人码麻豆乱码1区2区 | 一区在线播放视频| 在线观看不卡一区| 久久66热偷产精品| 亚洲色图制服丝袜| 日韩欧美一区二区三区在线| 成人综合婷婷国产精品久久蜜臀| 亚洲成人福利片| 国产日本一区二区| 欧美日韩激情在线| 顶级嫩模精品视频在线看| 一区二区三区四区精品在线视频| 欧美大片日本大片免费观看| 91视频免费看| 国产黄人亚洲片| 日韩精品色哟哟| 亚洲人快播电影网| 337p粉嫩大胆噜噜噜噜噜91av| 在线观看日韩电影| 不卡的av在线| 国产一区在线看| 日韩国产成人精品| 亚洲一区二区中文在线| 国产精品毛片久久久久久久| 日韩一区二区高清| 日本韩国精品一区二区在线观看| 国产精品99久久不卡二区| 日韩av一二三| 亚洲香肠在线观看| 综合久久给合久久狠狠狠97色| 精品国产百合女同互慰| 在线播放日韩导航| 色8久久精品久久久久久蜜| 成人丝袜18视频在线观看| 激情av综合网| 久久国产精品99精品国产| 丝袜亚洲另类欧美综合| 一区二区免费在线| 国产精品久久久99| 中文字幕一区在线| 亚洲国产高清aⅴ视频| 国产亚洲午夜高清国产拍精品 | 欧美午夜寂寞影院| a级高清视频欧美日韩| 国产精品小仙女| 国产一区二区伦理| 国产又粗又猛又爽又黄91精品| 视频一区欧美日韩| 视频在线观看一区| 视频在线观看一区| 日日夜夜精品免费视频| 婷婷综合久久一区二区三区| 亚洲国产欧美日韩另类综合 | 日韩国产一二三区| 婷婷一区二区三区| 日韩精品福利网| 免费视频一区二区| 伦理电影国产精品| 国模冰冰炮一区二区| 激情综合网av| 国产精品一二三区| 成人激情小说网站| 91浏览器打开| 欧美日韩综合不卡| 日韩视频免费观看高清完整版在线观看 | 亚洲天堂成人网| 亚洲欧美日韩小说| 午夜一区二区三区在线观看| 午夜欧美大尺度福利影院在线看| 偷拍日韩校园综合在线| 久久激情五月激情| 国产成人免费在线观看不卡| 成人免费看片app下载| 色婷婷精品大在线视频| 欧美日韩国产一级片| 日韩欧美国产1| 久久精品人人做人人综合 | 欧美一区二区三区免费大片 | 日韩一区二区三区免费观看 | 中国av一区二区三区| 中文字幕亚洲视频| 亚洲午夜久久久| 麻豆精品国产91久久久久久| 粉嫩欧美一区二区三区高清影视| jizzjizzjizz欧美| 欧美亚洲高清一区二区三区不卡| 日韩一卡二卡三卡四卡| 国产精品蜜臀在线观看| 亚洲国产精品天堂| 国产一区二区影院| 色94色欧美sute亚洲线路一久| 91精品国产综合久久精品麻豆| 精品久久国产字幕高潮| 最新日韩在线视频| 久久se这里有精品| 99精品欧美一区| 欧美一级理论性理论a| 国产精品麻豆久久久| 日韩精品电影一区亚洲| 成人av网址在线观看| 91精品婷婷国产综合久久| 亚洲国产精品精华液2区45| 五月综合激情日本mⅴ| 国产91精品一区二区麻豆亚洲| 欧美视频一区在线观看| 欧美激情综合网| 蜜乳av一区二区三区| 91免费国产在线观看| 26uuu久久综合| 亚洲va天堂va国产va久| 成人毛片老司机大片| 欧美大片日本大片免费观看| 亚洲一线二线三线视频| 国产99一区视频免费| 91精品国产入口在线| 亚洲激情五月婷婷| 成人午夜免费电影| 精品国产a毛片| 亚洲va韩国va欧美va| 91影视在线播放| 国产欧美日本一区视频| 麻豆久久久久久| 欧美人妇做爰xxxⅹ性高电影| 国产精品免费丝袜| 成人污视频在线观看| 久久亚洲私人国产精品va媚药| 日本91福利区| 欧美男男青年gay1069videost| 亚洲日本护士毛茸茸| 成人开心网精品视频| 久久久久9999亚洲精品| 国产揄拍国内精品对白| 精品国精品自拍自在线| 日本va欧美va欧美va精品| 欧美精品123区| 三级欧美在线一区| 欧美日本在线视频| 亚洲国产欧美在线| 欧美日韩免费在线视频| 亚洲国产wwwccc36天堂| 欧美一a一片一级一片| 洋洋成人永久网站入口| 91视频观看视频| 《视频一区视频二区| 99精品欧美一区| 亚洲精品国产一区二区精华液| 色综合久久中文字幕| 一区二区三区美女视频| 欧美系列日韩一区| 午夜免费久久看| 日韩丝袜美女视频| 国产久卡久卡久卡久卡视频精品| 精品久久久久久久一区二区蜜臀| 国产乱码精品一区二区三| 久久久久99精品一区| 成人黄色免费短视频| 国产精品亲子伦对白| 91小视频免费观看| 亚洲一区欧美一区| 91精品国产美女浴室洗澡无遮挡| 午夜精品久久久久久久久| 日韩精品一区二区三区在线| 激情欧美一区二区三区在线观看| 国产丝袜在线精品| 色综合久久天天| 亚洲mv大片欧洲mv大片精品| 在线综合+亚洲+欧美中文字幕| 久久国产精品72免费观看| 国产精品午夜春色av| 色婷婷av久久久久久久| 午夜在线成人av| xnxx国产精品| 91视视频在线观看入口直接观看www | 国产精品视频麻豆| 91蜜桃在线观看| 日本不卡一区二区三区高清视频| 久久色.com| 色天使久久综合网天天| 精品一区二区日韩| 1024成人网|