亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品一区二区在线观看不卡 | 麻豆91精品91久久久的内涵| 激情综合网激情| 日本韩国精品在线| 国产情人综合久久777777| 日韩成人午夜电影| 一本到高清视频免费精品| 精品国产第一区二区三区观看体验| 一个色妞综合视频在线观看| 国产精品综合在线视频| 日韩一级在线观看| 中文字幕欧美激情| 久久影视一区二区| 久久综合九色综合97_久久久| 亚洲免费成人av| 成人av在线一区二区三区| 337p日本欧洲亚洲大胆精品 | 精品国产一区二区三区不卡 | 欧美日韩国产美| 一区二区三区中文字幕电影| 岛国av在线一区| 国产亚洲精品aa午夜观看| 奇米一区二区三区| 欧美一级搡bbbb搡bbbb| 午夜欧美大尺度福利影院在线看| 91伊人久久大香线蕉| 亚洲日本在线天堂| 99久久综合精品| 国产精品美女一区二区| 成人黄页在线观看| 国产精品日产欧美久久久久| 不卡一卡二卡三乱码免费网站| 久久久久久影视| 国产91丝袜在线观看| 欧美韩日一区二区三区四区| 成人黄色av电影| 国产精品久久久久四虎| 99久久久国产精品| 伊人一区二区三区| 欧美日韩久久一区| 日av在线不卡| 久久综合久久综合亚洲| 国产福利一区二区三区| 亚洲国产岛国毛片在线| kk眼镜猥琐国模调教系列一区二区| 国产日韩三级在线| 99国产精品久久久久久久久久| 亚洲色图在线播放| 欧美日韩一区二区三区不卡| 五月天精品一区二区三区| 欧美大黄免费观看| 成人久久久精品乱码一区二区三区| 国产精品久久午夜| 精品视频一区二区不卡| 男人的天堂久久精品| 国产人成亚洲第一网站在线播放| 成人aaaa免费全部观看| 一区二区三区日韩精品| 欧美一区二区三级| 成人一区二区三区中文字幕| 亚洲综合色丁香婷婷六月图片| 欧美高清视频一二三区| 国产麻豆视频精品| 亚洲一区二区在线免费观看视频| 日韩视频一区二区三区在线播放 | 欧美日韩久久不卡| 国产一区不卡精品| 一区二区欧美视频| 日韩一级二级三级| 99riav一区二区三区| 免费欧美高清视频| 国产精品久久久久9999吃药| 777a∨成人精品桃花网| 不卡av在线免费观看| 久久精品国产网站| 亚洲卡通欧美制服中文| 精品福利一区二区三区免费视频| 99精品1区2区| 国产精品主播直播| 午夜精品福利久久久| 国产精品国产三级国产aⅴ无密码| 欧美裸体一区二区三区| 91浏览器在线视频| 国产v日产∨综合v精品视频| 日本欧美在线看| 亚洲一本大道在线| 国产精品久久久久久久久图文区| 91.麻豆视频| 色8久久精品久久久久久蜜 | 中文无字幕一区二区三区| 欧美日本韩国一区| 色综合久久99| 国产91在线看| 国产久卡久卡久卡久卡视频精品| 日韩成人dvd| 婷婷成人激情在线网| 一区二区三区日韩欧美精品| 国产精品久久久久桃色tv| 2019国产精品| 欧美电影精品一区二区| 欧美一级免费大片| 在线播放91灌醉迷j高跟美女| 欧美伊人久久久久久午夜久久久久| jlzzjlzz亚洲女人18| 国产69精品久久99不卡| 国产一区二区三区日韩| 精品在线播放免费| 久久国产精品99久久人人澡| 日韩专区中文字幕一区二区| 一区二区久久久久久| 亚洲最大成人网4388xx| 一区二区在线免费观看| 亚洲欧美日韩人成在线播放| 国产精品久久久久久亚洲伦| 日韩美女视频一区| 亚洲美女视频在线观看| 亚洲欧美国产77777| 亚洲欧美日韩电影| 亚洲综合视频在线观看| 亚洲一区二区三区自拍| 亚洲成人av中文| 男女性色大片免费观看一区二区| 日韩成人伦理电影在线观看| 久久精品国产一区二区| 国产成人高清视频| caoporn国产精品| 在线免费观看日本一区| 欧美久久一区二区| 欧美第一区第二区| 国产精品久久久久三级| 一区二区不卡在线播放 | 日韩欧美自拍偷拍| 国产午夜亚洲精品理论片色戒| 国产精品久久久久久久久动漫| 亚洲人妖av一区二区| 亚洲成人免费看| 国产在线麻豆精品观看| aaa欧美大片| 欧美精品精品一区| 久久精品一区二区三区不卡| 综合在线观看色| 奇米精品一区二区三区在线观看| 国产高清不卡一区二区| 99久久精品免费看| 日韩三级精品电影久久久| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 不卡影院免费观看| 欧美日韩日日摸| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲黄色小说网站| 精品一区二区在线播放| 99久久精品国产导航| 91精品国产免费| 中文字幕亚洲在| 极品少妇xxxx精品少妇| 一本一道久久a久久精品| 日韩一区二区三区免费看| 一区在线观看视频| 看电影不卡的网站| 在线精品视频一区二区三四| 精品国内二区三区| 亚洲国产精品一区二区www在线| 狠狠色丁香九九婷婷综合五月| 91影视在线播放| 国产三级久久久| 日本欧洲一区二区| 色婷婷综合久久久久中文| 国产亚洲精久久久久久| 日本成人超碰在线观看| 欧美吻胸吃奶大尺度电影| 久久久影院官网| 男女激情视频一区| 欧美日韩成人一区二区| 亚洲欧美在线视频| 国产99精品在线观看| 精品少妇一区二区三区日产乱码| 亚洲综合色丁香婷婷六月图片| 不卡一区在线观看| 欧美激情综合在线| 国产在线精品一区在线观看麻豆| 欧美日韩激情一区二区| 亚洲午夜免费电影| 色素色在线综合| 自拍av一区二区三区| 成人免费观看视频| 中文天堂在线一区| 成人午夜av影视| 国产精品视频第一区| 丁香婷婷综合色啪| 国产日韩欧美a| 国产91色综合久久免费分享| 精品日产卡一卡二卡麻豆| 麻豆一区二区三区| 91精品国产一区二区三区香蕉| 丝袜美腿亚洲一区| 91精品国产色综合久久不卡蜜臀 | 日韩一级片网站| 免费成人在线播放| 欧美大胆一级视频| 久99久精品视频免费观看|