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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? render_box.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/**
 * This file is part of the DOM implementation for KDE.
 *
 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
 * Copyright (C) 2004 Apple Computer, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 */
// -------------------------------------------------------------------------
//#define DEBUG_LAYOUT


#include <qpainter.h>
#include "rendering/render_box.h"
#include "rendering/render_replaced.h"
#include "rendering/render_canvas.h"
#include "rendering/render_table.h"
#include "render_flexbox.h"
#include "render_arena.h"

#include "misc/htmlhashes.h"
#include "xml/dom_nodeimpl.h"
#include "xml/dom_docimpl.h"
#include "html/html_elementimpl.h"

#include "render_line.h"

#include <khtmlview.h>
#include <kdebug.h>
#include <assert.h>


using namespace DOM;
using namespace khtml;

#define TABLECELLMARGIN -0x4000

RenderBox::RenderBox(DOM::NodeImpl* node)
    : RenderObject(node)
{
    m_minWidth = -1;
    m_maxWidth = -1;
    m_overrideSize = -1;
    m_width = m_height = 0;
    m_x = 0;
    m_y = 0;
    m_marginTop = 0;
    m_marginBottom = 0;
    m_marginLeft = 0;
    m_marginRight = 0;
    m_staticX = 0;
    m_staticY = 0;
    m_layer = 0;
    m_inlineBoxWrapper = 0;
}

void RenderBox::setStyle(RenderStyle *_style)
{
    RenderObject::setStyle(_style);

    // The root always paints its background/border.
    if (isRoot())
        setShouldPaintBackgroundOrBorder(true);

    setInline(_style->isDisplayInlineType());

    switch(_style->position())
    {
    case ABSOLUTE:
    case FIXED:
        setPositioned(true);
        break;
    default:
        setPositioned(false);

        if (_style->isFloating())
            setFloating(true);

        if (_style->position() == RELATIVE)
            setRelPositioned(true);
    }

    // FIXME: Note that we restrict overflow to blocks for now.  One day table bodies and cells
    // will need to support overflow.
    // We also deal with the body scroll quirk here, since it sets the scrollbars for the document.
    if (_style->overflow() != OVISIBLE && isBlockFlow() && !isTableCell() &&
        (!document()->isHTMLDocument() || !isBody()))
        setHasOverflowClip();

    if (requiresLayer()) {
        if (!m_layer) {
            m_layer = new (renderArena()) RenderLayer(this);
            m_layer->insertOnlyThisLayer();
            if (containingBlock())
                m_layer->updateLayerPositions();
        }
    }
    else if (m_layer && !isRoot() && !isCanvas()) {
        m_layer->removeOnlyThisLayer();
        m_layer = 0;
    }

    if (m_layer)
        m_layer->styleChanged();

    // Set the text color if we're the body.
    if (isBody())
        element()->getDocument()->setTextColor(_style->color());

    if (style()->outlineWidth() > 0 && style()->outlineSize() > maximalOutlineSize(PaintActionOutline))
        static_cast<RenderCanvas*>(document()->renderer())->setMaximalOutlineSize(style()->outlineSize());
}

RenderBox::~RenderBox()
{
    //kdDebug( 6040 ) << "Element destructor: this=" << nodeName().string() << endl;
}

void RenderBox::detach()
{
    RenderLayer* layer = m_layer;
    RenderArena* arena = renderArena();

    // This must be done before we detach the RenderObject.
    if (layer)
        layer->clearClipRect();

    if (m_inlineBoxWrapper) {
        if (!documentBeingDestroyed())
            m_inlineBoxWrapper->remove();
        m_inlineBoxWrapper->detach(arena);
        m_inlineBoxWrapper = 0;
    }

    RenderObject::detach();

    if (layer)
        layer->detach(arena);
}

int RenderBox::contentWidth() const
{
    int w = m_width - borderLeft() - borderRight();
    w -= paddingLeft() + paddingRight();

    if (includeScrollbarSize())
        w -= m_layer->verticalScrollbarWidth();

    //kdDebug( 6040 ) << "RenderBox::contentWidth(2) = " << w << endl;
    return w;
}

int RenderBox::contentHeight() const
{
    int h = m_height - borderTop() - borderBottom();
    h -= paddingTop() + paddingBottom();

    if (includeScrollbarSize())
        h -= m_layer->horizontalScrollbarHeight();

    return h;
}

int RenderBox::overrideWidth() const
{
    return m_overrideSize == -1 ? m_width : m_overrideSize;
}

int RenderBox::overrideHeight() const
{
    return m_overrideSize == -1 ? m_height : m_overrideSize;
}

void RenderBox::setPos( int xPos, int yPos )
{
    if (xPos == m_x && yPos == m_y)
        return; // Optimize for the case where we don't move at all.

    m_x = xPos; m_y = yPos;
}

int RenderBox::width() const
{
    return m_width;
}

int RenderBox::height() const
{
    return m_height;
}

// Hit Testing
bool RenderBox::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
                            HitTestAction hitTestAction)
{
    // Check kids first.
    _tx += m_x;
    _ty += m_y;
    for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
        // FIXME: We have to skip over inline flows, since they can show up inside table rows at the moment (a demoted inline <form> for example).  If we ever implement a
        // table-specific hit-test method (which we should do for performance reasons anyway), then we can remove this check.
        if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(info, _x, _y, _tx, _ty, hitTestAction)) {
            setInnerNode(info);
            return true;
        }
    }

    // Check our bounds next.  For this purpose always assume that we can only be hit in the
    // foreground phase (which is true for replaced elements like images).
    if (hitTestAction != HitTestForeground)
        return false;

    QRect boundsRect(_tx, _ty, m_width, m_height);
    if (boundsRect.contains(_x, _y)) {
        setInnerNode(info);
        return true;
    }
    return false;
}

// --------------------- painting stuff -------------------------------

void RenderBox::paint(PaintInfo& i, int _tx, int _ty)
{
    _tx += m_x;
    _ty += m_y;

    // default implementation. Just pass paint through to the children
    for (RenderObject* child = firstChild(); child; child = child->nextSibling())
        child->paint(i, _tx, _ty);
}

#ifdef NOKIA_CHANGES
void RenderBox::getRenderersInRect(QPtrList<BoxInfo>& boxInfoList,int deltaX,int deltaY,const QRect& rect)
{
	deltaX += m_x;
	deltaY += m_y;

	BoxInfo* sel = new BoxInfo;
	sel->renderObject = this;
	sel->absoluteXPos = deltaX;
	sel->absoluteYPos = deltaY;
	sel->width = m_width;
	sel->height = m_height;
	sel->area = 0;
	boxInfoList.append(sel);

    for (RenderObject *child = firstChild(); child; child = child->nextSibling())
	     child->getRenderersInRect(boxInfoList, deltaX, deltaY,rect);
}
#endif

void RenderBox::paintRootBoxDecorations(PaintInfo& i, int _tx, int _ty)
{
    //kdDebug( 6040 ) << renderName() << "::paintBoxDecorations()" << _tx << "/" << _ty << endl;
    const BackgroundLayer* bgLayer = style()->backgroundLayers();
    QColor bgColor = style()->backgroundColor();
    if (document()->isHTMLDocument() && !style()->hasBackground()) {
        // Locate the <body> element using the DOM.  This is easier than trying
        // to crawl around a render tree with potential :before/:after content and
        // anonymous blocks created by inline <body> tags etc.  We can locate the <body>
        // render object very easily via the DOM.
        HTMLElementImpl* body = document()->body();
        RenderObject* bodyObject = (body && body->id() == ID_BODY) ? body->renderer() : 0;
        if (bodyObject) {
            bgLayer = bodyObject->style()->backgroundLayers();
            bgColor = bodyObject->style()->backgroundColor();
        }
    }

    int w = width();
    int h = height();

    //    kdDebug(0) << "width = " << w <<endl;

    int rw, rh;
    if (canvas()->view()) {
        rw = canvas()->view()->contentsWidth();
        rh = canvas()->view()->contentsHeight();
    }
    else {
        rw = canvas()->width();
        rh = canvas()->height();
    }

    //    kdDebug(0) << "rw = " << rw <<endl;

    int bx = _tx - marginLeft();
    int by = _ty - marginTop();
    int bw = kMax(w + marginLeft() + marginRight() + borderLeft() + borderRight(), rw);
    int bh = kMax(h + marginTop() + marginBottom() + borderTop() + borderBottom(), rh);

    // CSS2 14.2:
    // " The background of the box generated by the root element covers the entire canvas."
    // hence, paint the background even in the margin areas (unlike for every other element!)
    // I just love these little inconsistencies .. :-( (Dirk)
    int my = kMax(by, i.r.y());

    paintBackgrounds(i.p, bgColor, bgLayer, my, i.r.height(), bx, by, bw, bh);

    if (style()->hasBorder() && style()->display() != INLINE)
        paintBorder( i.p, _tx, _ty, w, h, style() );
}

void RenderBox::paintBoxDecorations(PaintInfo& i, int _tx, int _ty)
{
    if (!shouldPaintWithinRoot(i))
        return;

    //kdDebug( 6040 ) << renderName() << "::paintDecorations()" << endl;
    if (isRoot())
        return paintRootBoxDecorations(i, _tx, _ty);

    int w = width();
    int h = height() + borderTopExtra() + borderBottomExtra();
    _ty -= borderTopExtra();

    int my = kMax(_ty, i.r.y());
    int mh;
    if (_ty < i.r.y())
        mh= kMax(0, h - (i.r.y() - _ty));
    else
        mh = kMin(i.r.height(), h);

    // The <body> only paints its background if the root element has defined a background
    // independent of the body.  Go through the DOM to get to the root element's render object,
    // since the root could be inline and wrapped in an anonymous block.
    if (!isBody() || !document()->isHTMLDocument() || document()->documentElement()->renderer()->style()->hasBackground())
        paintBackgrounds(i.p, style()->backgroundColor(), style()->backgroundLayers(), my, mh, _tx, _ty, w, h);

    if (style()->hasBorder())
        paintBorder(i.p, _tx, _ty, w, h, style());
}

void RenderBox::paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height)
{
    if (!bgLayer) return;
    paintBackgrounds(p, c, bgLayer->next(), clipy, cliph, _tx, _ty, w, height);
    paintBackground(p, c, bgLayer, clipy, cliph, _tx, _ty, w, height);
}

void RenderBox::paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height)
{
    paintBackgroundExtended(p, c, bgLayer, clipy, cliph, _tx, _ty, w, height,
                            borderLeft(), borderRight());
}

void RenderBox::paintBackgroundExtended(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph,
                                        int _tx, int _ty, int w, int h,
                                        int bleft, int bright)
{
    CachedImage* bg = bgLayer->backgroundImage();
    bool shouldPaintBackgroundImage = bg && bg->pixmap_size() == bg->valid_rect().size() && !bg->isTransparent() && !bg->isErrorImage();
    QColor bgColor = c;
    
    // When this style flag is set, change existing background colors and images to a solid white background.
    // If there's no bg color or image, leave it untouched to avoid affecting transparency.
    // We don't try to avoid loading the background images, because this style flag is only set
    // when printing, and at that point we've already loaded the background images anyway. (To avoid
    // loading the background images we'd have to do this check when applying styles rather than
    // while rendering.)
    if (style()->forceBackgroundsToWhite()) {
        // Note that we can't reuse this variable below because the bgColor might be changed
        bool shouldPaintBackgroundColor = !bgLayer->next() && bgColor.isValid() && qAlpha(bgColor.rgb()) > 0;
        if (shouldPaintBackgroundImage || shouldPaintBackgroundColor) {
            bgColor = Qt::white;
            shouldPaintBackgroundImage = false;
        }
    }

    // Only fill with a base color (e.g., white) if we're the root document, since iframes/frames with
    // no background in the child document should show the parent's background.
    if (!bgLayer->next() && isRoot() && !(bgColor.isValid() && qAlpha(bgColor.rgb()) > 0) && canvas()->view()) {
        bool isTransparent;
        DOM::NodeImpl* elt = document()->ownerElement();
        if (elt) {
            if (elt->id() == ID_FRAME)
                isTransparent = false;
            else {
                // Locate the <body> element using the DOM.  This is easier than trying
                // to crawl around a render tree with potential :before/:after content and
                // anonymous blocks created by inline <body> tags etc.  We can locate the <body>
                // render object very easily via the DOM.
                HTMLElementImpl* body = document()->body();
                isTransparent = !body || body->id() != ID_FRAMESET; // Can't scroll a frameset document anyway.
            }
        } else
            isTransparent = canvas()->view()->isTransparent();

        if (isTransparent)
            canvas()->view()->useSlowRepaints(); // The parent must show behind the child.
        else
            bgColor = canvas()->view()->palette().active().color(QColorGroup::Base);
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人aaaa免费全部观看| 丝袜a∨在线一区二区三区不卡| 精品一区二区三区欧美| 欧美一级一级性生活免费录像| 免费精品视频在线| 久久伊人中文字幕| 国产成人精品亚洲午夜麻豆| 国产精品久久777777| 91蜜桃免费观看视频| 亚洲一区二区av在线| 制服视频三区第一页精品| 久久99国产精品麻豆| 国产欧美精品国产国产专区 | 91性感美女视频| 亚洲综合激情另类小说区| 3d动漫精品啪啪| 国产成人在线视频网站| 亚洲黄一区二区三区| 这里只有精品电影| 国产精品亚洲第一区在线暖暖韩国 | 亚洲国产精品久久人人爱| 欧美二区在线观看| 黄色资源网久久资源365| 国产精品伦理一区二区| 欧美日韩黄色一区二区| 精品午夜久久福利影院| 国产精品免费丝袜| 欧美精品在线观看一区二区| 国产v综合v亚洲欧| 亚洲一级电影视频| 久久久久久久久久美女| 欧美日韩中文精品| 懂色av噜噜一区二区三区av| 亚洲成人免费在线观看| 国产人妖乱国产精品人妖| 欧美日韩在线一区二区| 国产**成人网毛片九色| 亚洲成va人在线观看| 久久久精品中文字幕麻豆发布| 日本道精品一区二区三区| 国产制服丝袜一区| 亚洲在线视频网站| 国产精品久久久久久久岛一牛影视 | 91麻豆精品国产无毒不卡在线观看| 国产精品一区二区男女羞羞无遮挡| 亚洲午夜在线电影| 国产丝袜美腿一区二区三区| 91精品国产品国语在线不卡| 色婷婷激情久久| 国产成人免费在线观看不卡| 青青草精品视频| 亚洲一区二区三区中文字幕| 国产精品成人网| 久久亚洲精品小早川怜子| 欧美疯狂做受xxxx富婆| 91麻豆成人久久精品二区三区| 国产成人免费视| 久久av中文字幕片| 日本伊人午夜精品| 亚洲福利一区二区三区| 一区二区在线免费观看| 国产精品盗摄一区二区三区| 久久亚洲综合色| 精品欧美黑人一区二区三区| 欧美妇女性影城| 欧美日韩一区 二区 三区 久久精品| 成人18视频在线播放| 国产成人精品免费看| 国内精品写真在线观看| 久久99国产精品尤物| 另类欧美日韩国产在线| 蜜桃视频在线一区| 午夜激情久久久| 日日摸夜夜添夜夜添国产精品| 亚洲成人激情自拍| 亚洲一区二区欧美| 亚洲一区在线观看视频| 亚洲一区电影777| 亚洲a一区二区| 日本在线不卡视频| 日本成人超碰在线观看| 日本欧美肥老太交大片| 日本免费新一区视频| 免费看日韩精品| 精品一区二区三区在线视频| 国产一区二三区好的| 国产真实乱对白精彩久久| 国产盗摄一区二区三区| eeuss鲁片一区二区三区| 不卡的av网站| 欧美自拍偷拍午夜视频| 国产精品欧美一区二区三区| 国产片一区二区| 亚洲欧美日韩在线| 亚洲国产综合色| 久久国产三级精品| 国产成人精品亚洲日本在线桃色| 懂色av中文一区二区三区| 色老头久久综合| 91麻豆精品久久久久蜜臀| 精品99久久久久久| 国产精品久99| 日韩精品一二三| 国产成人亚洲综合a∨猫咪| 91丨九色丨蝌蚪丨老版| 在线成人av网站| 久久先锋影音av| 亚洲婷婷在线视频| 亚洲福利一区二区| 国产一区二区三区国产| 9久草视频在线视频精品| 在线视频国产一区| 日韩久久久久久| 日韩伦理电影网| 免费一级片91| caoporm超碰国产精品| 91精品国产乱码久久蜜臀| 国产日韩一级二级三级| 亚洲综合在线第一页| 国产一区在线观看视频| 91久久香蕉国产日韩欧美9色| 日韩一级欧美一级| 亚洲天堂成人在线观看| 久久草av在线| 色激情天天射综合网| 日韩视频免费观看高清完整版 | 中文字幕一区二区三区不卡在线| 亚洲成人动漫一区| 成人一道本在线| 91精品国产一区二区三区| 国产精品麻豆久久久| 日本vs亚洲vs韩国一区三区| 91丨porny丨最新| 久久婷婷综合激情| 婷婷国产v国产偷v亚洲高清| 丁香桃色午夜亚洲一区二区三区| 91精品国产丝袜白色高跟鞋| 日韩美女精品在线| 国产美女视频一区| 91精品国产一区二区人妖| 一区二区三区在线观看欧美| 国产丶欧美丶日本不卡视频| 日韩欧美国产午夜精品| 亚洲五码中文字幕| 成人污污视频在线观看| 精品国产欧美一区二区| 婷婷开心激情综合| 欧美自拍偷拍一区| 国产精品高潮呻吟| 国产成人综合视频| 日韩免费视频一区| 奇米综合一区二区三区精品视频| 日韩欧美国产三级电影视频| 色欧美乱欧美15图片| 国产欧美综合色| 国产在线精品免费av| 91精品国产综合久久久蜜臀粉嫩 | 美女一区二区三区| 欧美在线不卡视频| 亚洲三级小视频| 99精品国产99久久久久久白柏| 久久久亚洲综合| 国产一区二区三区四区在线观看| 日韩欧美国产麻豆| 青青草91视频| 欧美大白屁股肥臀xxxxxx| 热久久一区二区| 欧美成人精品福利| 久久99精品久久久久久| 精品久久久影院| 精品一区二区三区在线播放| 精品国偷自产国产一区| 免费在线成人网| 精品第一国产综合精品aⅴ| 久久成人麻豆午夜电影| 久久综合色之久久综合| 国产精品一区二区不卡| 国产精品亲子乱子伦xxxx裸| 91亚洲大成网污www| 一区二区三区精品视频在线| 欧美蜜桃一区二区三区| 日本免费在线视频不卡一不卡二| 精品久久久久久久久久久久久久久 | 亚洲国产精品久久人人爱蜜臀| 欧美午夜宅男影院| 日本不卡不码高清免费观看| 精品国产不卡一区二区三区| 国产成人高清在线| 亚洲男女一区二区三区| 欧美男人的天堂一二区| 九九精品视频在线看| 中文字幕精品三区| 在线视频亚洲一区| 日本特黄久久久高潮| 久久久五月婷婷| 色婷婷久久99综合精品jk白丝| 午夜精品久久久久久久久久久| 日韩欧美国产电影| 成人性视频网站| 丝袜美腿亚洲色图|