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

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

?? render_layer.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/*
 * Copyright (C) 2003 Apple Computer, Inc.
 *
 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
 *
 * Other contributors:
 *   Robert O'Callahan <roc+@cs.cmu.edu>
 *   David Baron <dbaron@fas.harvard.edu>
 *   Christian Biesinger <cbiesinger@web.de>
 *   Randall Jesup <rjesup@wgate.com>
 *   Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
 *   Josh Soref <timeless@mac.com>
 *   Boris Zbarsky <bzbarsky@mit.edu>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Alternatively, the contents of this file may be used under the terms
 * of either the Mozilla Public License Version 1.1, found at
 * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
 * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
 * (the "GPL"), in which case the provisions of the MPL or the GPL are
 * applicable instead of those above.  If you wish to allow use of your
 * version of this file only under the terms of one of those two
 * licenses (the MPL or the GPL) and not to allow others to use your
 * version of this file under the LGPL, indicate your decision by
 * deletingthe provisions above and replace them with the notice and
 * other provisions required by the MPL or the GPL, as the case may be.
 * If you do not delete the provisions above, a recipient may use your
 * version of this file under any of the LGPL, the MPL or the GPL.
 */

#include "render_layer.h"
#include <kdebug.h>
#include <assert.h>
#include "khtmlview.h"
#include "render_canvas.h"
#include "render_arena.h"
#include "xml/dom_docimpl.h"
#include "xml/dom2_eventsimpl.h"
#include "misc/htmltags.h"
#include "html/html_blockimpl.h"

#include <qscrollbar.h>
#include <qptrvector.h>

#if APPLE_CHANGES
#include "KWQKHTMLPart.h" // For Dashboard.
#endif

using namespace DOM;
using namespace khtml;

#ifdef APPLE_CHANGES
QScrollBar* RenderLayer::gScrollBar = 0;
#endif

#ifndef NDEBUG
static bool inRenderLayerDetach;
#endif

void* ClipRects::operator new(size_t sz, RenderArena* renderArena) throw()
{
    return renderArena->allocate(sz);
}

void ClipRects::operator delete(void* ptr, size_t sz)
{
    // Stash size where detach can find it.
    *(size_t *)ptr = sz;
}

void ClipRects::detach(RenderArena* renderArena)
{
    delete this;

    // Recover the size left there for us by operator delete and free the memory.
    renderArena->free(*(size_t *)this, this);
}

void
RenderScrollMediator::slotValueChanged(int val)
{
    m_layer->updateScrollPositionFromScrollbars();
}

RenderLayer::RenderLayer(RenderObject* object)
: m_object( object ),
m_parent( 0 ),
m_previous( 0 ),
m_next( 0 ),
m_first( 0 ),
m_last( 0 ),
m_relX( 0 ),
m_relY( 0 ),
m_x( 0 ),
m_y( 0 ),
m_width( 0 ),
m_height( 0 ),
m_scrollX( 0 ),
m_scrollY( 0 ),
m_scrollWidth( 0 ),
m_scrollHeight( 0 ),
m_hBar( 0 ),
m_vBar( 0 ),
m_scrollMediator( 0 ),
m_posZOrderList( 0 ),
m_negZOrderList( 0 ),
m_clipRects( 0 ) ,
m_scrollDimensionsDirty( true ),
m_zOrderListsDirty( true ),
m_usedTransparency( false ),
m_marquee( 0 )
{
}

RenderLayer::~RenderLayer()
{
    // Child layers will be deleted by their corresponding render objects, so
    // our destructor doesn't have to do anything.
    delete m_hBar;
    delete m_vBar;
    delete m_scrollMediator;
    delete m_posZOrderList;
    delete m_negZOrderList;
    delete m_marquee;

    // Make sure we have no lingering clip rects.
    assert(!m_clipRects);
}

void RenderLayer::computeRepaintRects()
{
    // FIXME: Child object could override visibility.
    if (m_object->style()->visibility() == VISIBLE)
        m_object->getAbsoluteRepaintRectIncludingFloats(m_repaintRect, m_fullRepaintRect);
    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
        child->computeRepaintRects();
}

void RenderLayer::updateLayerPositions(bool doFullRepaint, bool checkForRepaint)
{
    if (doFullRepaint) {
        m_object->repaint();
        checkForRepaint = doFullRepaint = false;
    }

    updateLayerPosition(); // For relpositioned layers or non-positioned layers,
                           // we need to keep in sync, since we may have shifted relative
                           // to our parent layer.

    if (m_hBar || m_vBar) {
        // Need to position the scrollbars.
        int x = 0;
        int y = 0;
        convertToLayerCoords(root(), x, y);
        QRect layerBounds = QRect(x,y,width(),height());
        positionScrollbars(layerBounds);
    }

    // FIXME: Child object could override visibility.
    if (checkForRepaint && (m_object->style()->visibility() == VISIBLE))
        m_object->repaintAfterLayoutIfNeeded(m_repaintRect, m_fullRepaintRect);

    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
        child->updateLayerPositions(doFullRepaint, checkForRepaint);

    // With all our children positioned, now update our marquee if we need to.
    if (m_marquee)
        m_marquee->updateMarqueePosition();
}

void RenderLayer::updateLayerPosition()
{
    // Clear our cached clip rect information.
    clearClipRect();

    // The canvas is sized to the docWidth/Height over in RenderCanvas::layout, so we
    // don't need to ever update our layer position here.
    if (renderer()->isCanvas())
        return;

    int x = m_object->xPos();
    int y = m_object->yPos();

    if (!m_object->isPositioned()) {
        // We must adjust our position by walking up the render tree looking for the
        // nearest enclosing object with a layer.
        RenderObject* curr = m_object->parent();
        while (curr && !curr->layer()) {
            x += curr->xPos();
            y += curr->yPos();
            curr = curr->parent();
        }
    }

    m_relX = m_relY = 0;
    if (m_object->isRelPositioned()) {
        static_cast<RenderBox*>(m_object)->relativePositionOffset(m_relX, m_relY);
        x += m_relX; y += m_relY;
    }

    // Subtract our parent's scroll offset.
    if (m_object->isPositioned() && enclosingPositionedAncestor()) {
        RenderLayer* positionedParent = enclosingPositionedAncestor();

        // For positioned layers, we subtract out the enclosing positioned layer's scroll offset.
        positionedParent->subtractScrollOffset(x, y);

        if (m_object->isPositioned() && positionedParent->renderer()->isRelPositioned() &&
            positionedParent->renderer()->isInlineFlow()) {
            // When we have an enclosing relpositioned inline, we need to add in the offset of the first line
            // box from the rest of the content, but only in the cases where we know we're positioned
            // relative to the inline itself.
            RenderFlow* flow = static_cast<RenderFlow*>(positionedParent->renderer());
            int sx = 0, sy = 0;
            if (flow->firstLineBox()) {
                sx = flow->firstLineBox()->xPos();
                sy = flow->firstLineBox()->yPos();
            }
            else {
                sx = flow->staticX();
                sy = flow->staticY();
            }
            bool isInlineType = m_object->style()->isOriginalDisplayInlineType();

            if (!m_object->hasStaticX())
                x += sx;

            // This is not terribly intuitive, but we have to match other browsers.  Despite being a block display type inside
            // an inline, we still keep our x locked to the left of the relative positioned inline.  Arguably the correct
            // behavior would be to go flush left to the block that contains the inline, but that isn't what other browsers
            // do.
            if (m_object->hasStaticX() && !isInlineType)
                // Avoid adding in the left border/padding of the containing block twice.  Subtract it out.
                x += sx - (m_object->containingBlock()->borderLeft() + m_object->containingBlock()->paddingLeft());

            if (!m_object->hasStaticY())
                y += sy;
        }
    }
    else if (parent())
        parent()->subtractScrollOffset(x, y);

    setPos(x,y);

    setWidth(m_object->width());
    setHeight(m_object->height());

    if (!m_object->hasOverflowClip()) {
        if (m_object->overflowWidth() > m_object->width())
            setWidth(m_object->overflowWidth());
        if (m_object->overflowHeight() > m_object->height())
            setHeight(m_object->overflowHeight());
    }
}

RenderLayer *RenderLayer::stackingContext() const
{
    RenderLayer* curr = parent();
    for ( ; curr && !curr->m_object->isCanvas() && !curr->m_object->isRoot() &&
          curr->m_object->style()->hasAutoZIndex();
          curr = curr->parent());
    return curr;
}

RenderLayer*
RenderLayer::enclosingPositionedAncestor() const
{
    RenderLayer* curr = parent();
    for ( ; curr && !curr->m_object->isCanvas() && !curr->m_object->isRoot() &&
         !curr->m_object->isPositioned() && !curr->m_object->isRelPositioned();
         curr = curr->parent());

    return curr;
}

#if APPLE_CHANGES
bool
RenderLayer::isTransparent()
{
    return m_object->style()->opacity() < 1.0f;
}

RenderLayer*
RenderLayer::transparentAncestor()
{
    RenderLayer* curr = parent();
    for ( ; curr && curr->m_object->style()->opacity() == 1.0f; curr = curr->parent());
    return curr;
}

void RenderLayer::beginTransparencyLayers(QPainter* p)
{
    if (isTransparent() && m_usedTransparency)
        return;

    RenderLayer* ancestor = transparentAncestor();
    if (ancestor)
        ancestor->beginTransparencyLayers(p);

    if (isTransparent()) {
        m_usedTransparency = true;
        p->beginTransparencyLayer(renderer()->style()->opacity());
    }
}

#endif

void* RenderLayer::operator new(size_t sz, RenderArena* renderArena) throw()
{
    return renderArena->allocate(sz);
}

void RenderLayer::operator delete(void* ptr, size_t sz)
{
    assert(inRenderLayerDetach);

    // Stash size where detach can find it.
    *(size_t *)ptr = sz;
}

void RenderLayer::detach(RenderArena* renderArena)
{
#ifndef NDEBUG
    inRenderLayerDetach = true;
#endif
    delete this;
#ifndef NDEBUG
    inRenderLayerDetach = false;
#endif

    // Recover the size left there for us by operator delete and free the memory.
    renderArena->free(*(size_t *)this, this);
}

void RenderLayer::addChild(RenderLayer *child, RenderLayer* beforeChild)
{
    RenderLayer* prevSibling = beforeChild ? beforeChild->previousSibling() : lastChild();
    if (prevSibling) {
        child->setPreviousSibling(prevSibling);
        prevSibling->setNextSibling(child);
    }
    else
        setFirstChild(child);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲男人天堂一区| 99视频精品在线| 成人午夜视频福利| 欧美日韩三级视频| 国产欧美日韩另类视频免费观看| 亚洲人123区| 免费成人在线影院| 一本大道久久a久久精品综合| 精品国产乱码久久久久久影片| 亚洲综合免费观看高清完整版 | 欧美日韩中文字幕一区二区| 国产精品无人区| 久久99精品国产麻豆婷婷洗澡| 在线免费观看不卡av| 中文字幕精品三区| 国产精品一区二区在线观看不卡| 91精品国产综合久久久久久久久久| 自拍偷拍欧美精品| 99热这里都是精品| 中文字幕国产一区二区| 激情久久五月天| 日韩欧美精品在线视频| 日韩av成人高清| 欧美视频精品在线观看| 一区2区3区在线看| 91丨九色porny丨蝌蚪| 国产精品午夜春色av| 国产精品77777| 久久久久9999亚洲精品| 国产一区二区三区美女| xfplay精品久久| 韩国精品在线观看| 国产欧美一区二区三区鸳鸯浴| 国产真实乱子伦精品视频| 欧美成va人片在线观看| 久久精品免费看| 2021久久国产精品不只是精品| 蜜臀av性久久久久蜜臀aⅴ| 日韩欧美美女一区二区三区| 麻豆成人免费电影| 久久久不卡影院| 成人性生交大片免费| 国产精品美女久久久久久| 不卡的电视剧免费网站有什么| 国产三级精品在线| 91视频免费看| 亚洲线精品一区二区三区八戒| 欧美日韩国产天堂| 美日韩一区二区| 久久久精品2019中文字幕之3| 成人免费视频一区二区| 国产精品传媒入口麻豆| 色av综合在线| 视频一区二区欧美| 久久免费的精品国产v∧| 成人黄色在线看| 亚洲国产精品麻豆| 日韩免费电影网站| 成人ar影院免费观看视频| 亚洲素人一区二区| 在线播放/欧美激情| 国产精品一卡二卡| 亚洲视频一二区| 欧美一区二区在线视频| 国产成人亚洲精品狼色在线| 亚洲欧美日韩中文字幕一区二区三区| 欧美日韩国产成人在线免费| 激情综合五月婷婷| 一区二区三区四区中文字幕| 欧美大白屁股肥臀xxxxxx| 岛国精品在线播放| 日韩制服丝袜先锋影音| 中文一区在线播放| 欧美高清hd18日本| 成人蜜臀av电影| 日韩综合一区二区| 国产精品不卡在线| 精品美女被调教视频大全网站| 99视频热这里只有精品免费| 麻豆久久久久久| 一区二区三区不卡在线观看| 久久久久久影视| 欧美日韩成人在线| 91蝌蚪porny九色| 国产乱码精品一区二区三区忘忧草| 亚洲精品国产a久久久久久 | 欧美日韩免费电影| 成人免费视频免费观看| 美国十次了思思久久精品导航| 最新热久久免费视频| xvideos.蜜桃一区二区| 欧美久久一区二区| 在线免费观看一区| av在线播放一区二区三区| 国产一区二区调教| 奇米影视7777精品一区二区| 一区二区三区鲁丝不卡| 国产精品污污网站在线观看| 精品成人免费观看| 91精品国产色综合久久 | 国产白丝网站精品污在线入口| 五月婷婷欧美视频| 一区二区三区四区蜜桃| 中文字幕亚洲成人| 欧美激情一区在线观看| 久久亚洲精华国产精华液| 欧美一级久久久久久久大片| 欧美唯美清纯偷拍| 欧美性猛交xxxxxx富婆| 色欧美日韩亚洲| 一本高清dvd不卡在线观看| 色婷婷综合久久久久中文 | 国产91丝袜在线18| 国产美女精品在线| 国产自产2019最新不卡| 久久成人免费网站| 久久99国内精品| 韩国欧美国产1区| 国产精品综合二区| 国产剧情一区二区三区| 国产成人免费xxxxxxxx| gogogo免费视频观看亚洲一| 99久久久免费精品国产一区二区| 成人av免费在线播放| 91丝袜美腿高跟国产极品老师| 91美女片黄在线| 91国在线观看| 欧美酷刑日本凌虐凌虐| 日韩欧美一区二区久久婷婷| 日韩三级.com| 国产亚洲综合色| 国产精品美女www爽爽爽| 1024国产精品| 婷婷开心激情综合| 毛片不卡一区二区| 成人午夜av影视| 日本韩国欧美国产| 欧美一级夜夜爽| 国产欧美日韩在线看| 亚洲精品美腿丝袜| 日本成人在线看| 国产九九视频一区二区三区| 91啪亚洲精品| 91麻豆精品国产自产在线观看一区 | 久久成人av少妇免费| 国内成人自拍视频| 色综合一区二区三区| 91精品国产综合久久久久久| 欧美经典一区二区| 亚洲午夜一区二区三区| 国产综合久久久久久鬼色 | 亚洲激情av在线| 日韩精品1区2区3区| 国产美女娇喘av呻吟久久| 日本精品视频一区二区三区| 日韩欧美国产高清| 一区二区三区四区五区视频在线观看| 青青草视频一区| 色久综合一二码| 久久夜色精品国产欧美乱极品| 亚洲精品伦理在线| 精品一区二区三区在线视频| 色乱码一区二区三区88| 久久嫩草精品久久久精品一| 亚洲影视在线观看| 国产精品996| 欧美一区二区三区色| 中文字幕一区免费在线观看| 精品午夜一区二区三区在线观看| 一本久道久久综合中文字幕| 精品福利一二区| 日韩精品一级二级| 一本到一区二区三区| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲一区二区三区四区中文字幕| 春色校园综合激情亚洲| 欧美一区二区三区电影| 亚洲精品免费一二三区| 国产69精品久久777的优势| 日韩免费观看2025年上映的电影| 一区二区三区四区不卡在线| 成人午夜电影网站| 精品sm在线观看| 老汉av免费一区二区三区| 欧美三级电影在线看| 一区二区三区鲁丝不卡| 91蜜桃网址入口| 最近日韩中文字幕| 成人网页在线观看| 欧美精品一区二区三区高清aⅴ | 国产福利一区二区三区视频| 欧美一区二区在线观看| 日韩影院精彩在线| 欧美理论在线播放| 天堂av在线一区| 91麻豆精品久久久久蜜臀| 日本成人在线看| 欧美r级在线观看| 九色porny丨国产精品| 精品精品欲导航|