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

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

?? css_ruleimpl.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
字號:
/**
 * This file is part of the DOM implementation for KDE.
 *
 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
 * Copyright (C) 2002 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.
 */
#include "dom/css_rule.h"
#include "dom/css_stylesheet.h"
#include "dom/dom_exception.h"
#include "dom/dom_string.h"

#include "css/css_stylesheetimpl.h"
#include "css/css_valueimpl.h"
#include "css/cssparser.h"
#include "css/css_ruleimpl.h"

#include "misc/loader.h"
#include "misc/htmltags.h"
#include "misc/htmlattrs.h"
#include "xml/dom_docimpl.h"

using namespace DOM;

#include <kdebug.h>

CSSStyleSheetImpl *CSSRuleImpl::parentStyleSheet() const
{
    return ( m_parent && m_parent->isCSSStyleSheet() )  ?
	static_cast<CSSStyleSheetImpl *>(m_parent) : 0;
}

CSSRuleImpl *CSSRuleImpl::parentRule() const
{
    return ( m_parent && m_parent->isRule() )  ?
	static_cast<CSSRuleImpl *>(m_parent) : 0;
}

DOM::DOMString CSSRuleImpl::cssText() const
{
    // ###
    return DOMString();
}

void CSSRuleImpl::setCssText(DOM::DOMString /*str*/)
{
    // ###
}

// ---------------------------------------------------------------------------

CSSFontFaceRuleImpl::CSSFontFaceRuleImpl(StyleBaseImpl *parent)
    : CSSRuleImpl(parent)
{
    m_type = CSSRule::FONT_FACE_RULE;
    m_style = 0;
}

CSSFontFaceRuleImpl::~CSSFontFaceRuleImpl()
{
    if(m_style) m_style->deref();
}

// --------------------------------------------------------------------------

CSSImportRuleImpl::CSSImportRuleImpl( StyleBaseImpl *parent,
                                      const DOM::DOMString &href,
                                      MediaListImpl *media )
    : CSSRuleImpl(parent)
{
    m_type = CSSRule::IMPORT_RULE;

    m_lstMedia = media;
    if ( !m_lstMedia )
	m_lstMedia = new MediaListImpl( this, DOMString() );
    m_lstMedia->setParent( this );
    m_lstMedia->ref();

    m_strHref = href;
    m_styleSheet = 0;

    m_cachedSheet = 0;

    init();
}
CSSImportRuleImpl::CSSImportRuleImpl( StyleBaseImpl *parent,
                                      const DOM::DOMString &href,
                                      const DOM::DOMString &media )
    : CSSRuleImpl(parent)
{
    m_type = CSSRule::IMPORT_RULE;

    m_lstMedia = new MediaListImpl( this, media );
    m_lstMedia->ref();

    m_strHref = href;
    m_styleSheet = 0;

    m_cachedSheet = 0;

    init();
}

CSSImportRuleImpl::~CSSImportRuleImpl()
{
    if( m_lstMedia ) {
 	m_lstMedia->setParent( 0 );
	m_lstMedia->deref();
    }
    if(m_styleSheet) {
        m_styleSheet->setParent(0);
        m_styleSheet->deref();
    }

    if(m_cachedSheet) m_cachedSheet->deref(this);
}

void CSSImportRuleImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DOMString &sheet)
{
    if ( m_styleSheet ) {
        m_styleSheet->setParent(0);
        m_styleSheet->deref();
    }
    m_styleSheet = new CSSStyleSheetImpl(this, url);
    m_styleSheet->ref();

    CSSStyleSheetImpl *parent = parentStyleSheet();
    m_styleSheet->parseString( sheet, parent ? parent->useStrictParsing() : true );
    m_loading = false;

    checkLoaded();
}

bool CSSImportRuleImpl::isLoading()
{
    return ( m_loading || (m_styleSheet && m_styleSheet->isLoading()) );
}

void CSSImportRuleImpl::init()
{
    khtml::DocLoader *docLoader = 0;
    StyleBaseImpl *root = this;
    StyleBaseImpl *parent;
    while ( ( parent = root->parent()) )
	root = parent;
    if (root->isCSSStyleSheet())
	docLoader = static_cast<CSSStyleSheetImpl*>(root)->docLoader();

    DOMString absHref = m_strHref;
    CSSStyleSheetImpl *parentSheet = parentStyleSheet();
    if (!parentSheet->href().isNull()) {
      // use parent styleheet's URL as the base URL
      absHref = KURL(parentSheet->href().string(),m_strHref.string()).url();
    }
/*
    else {
      // use documents's URL as the base URL
      DocumentImpl *doc = static_cast<CSSStyleSheetImpl*>(root)->doc();
      absHref = KURL(doc->URL(),m_strHref.string()).url();
    }
*/

    // Check for a cycle in our import chain.  If we encounter a stylesheet
    // in our parent chain with the same URL, then just bail.
    for (parent = static_cast<StyleBaseImpl*>(this)->parent();
         parent;
         parent = parent->parent())
        if (absHref == parent->baseURL())
            return;
    
    // ### pass correct charset here!!
    m_cachedSheet = docLoader->requestStyleSheet(absHref, QString::null);

    if (m_cachedSheet)
    {
      m_cachedSheet->ref(this);

      // If the imported sheet is in the cache, then setStyleSheet gets called,
      // and the sheet even gets parsed (via parseString).  In this case we have
      // loaded (even if our subresources haven't), so if we have stylesheet after
      // checking the cache, then we've clearly loaded. -dwh
      if (!m_styleSheet)
          m_loading = true;
    }
}

// --------------------------------------------------------------------------
CSSMediaRuleImpl::CSSMediaRuleImpl( StyleBaseImpl *parent, MediaListImpl *mediaList, CSSRuleListImpl *ruleList )
    :   CSSRuleImpl( parent )
{
    m_type = CSSRule::MEDIA_RULE;
    m_lstMedia = mediaList;
    m_lstMedia->ref();
    m_lstCSSRules = ruleList;
    m_lstCSSRules->ref();
}

CSSMediaRuleImpl::CSSMediaRuleImpl(StyleBaseImpl *parent)
    :   CSSRuleImpl( parent )
{
    m_type = CSSRule::MEDIA_RULE;
    m_lstMedia = 0;
    m_lstCSSRules = new CSSRuleListImpl();
    m_lstCSSRules->ref();
}

CSSMediaRuleImpl::CSSMediaRuleImpl( StyleBaseImpl *parent, const DOM::DOMString &media )
:   CSSRuleImpl( parent )
{
    m_type = CSSRule::MEDIA_RULE;
    m_lstMedia = new MediaListImpl( this, media );
    m_lstMedia->ref();
    m_lstCSSRules = new CSSRuleListImpl();
    m_lstCSSRules->ref();
}

CSSMediaRuleImpl::~CSSMediaRuleImpl()
{
    if( m_lstMedia ) {
	m_lstMedia->setParent( 0 );
        m_lstMedia->deref();
    }

    int length = m_lstCSSRules->length();
    for (int i = 0; i < length; i++) {
	m_lstCSSRules->item( i )->setParent( 0 );
    }
    m_lstCSSRules->deref();
}

unsigned long CSSMediaRuleImpl::append( CSSRuleImpl *rule )
{
    if (!rule) {
	return 0;
    }

    rule->setParent(this);
    return m_lstCSSRules->insertRule( rule, m_lstCSSRules->length() );
}

unsigned long CSSMediaRuleImpl::insertRule( const DOMString &rule,
                                            unsigned long index )
{
    CSSParser p( strictParsing );
    CSSRuleImpl *newRule = p.parseRule( parentStyleSheet(), rule );

    if (!newRule) {
	return 0;
    }

    newRule->setParent(this);
    return m_lstCSSRules->insertRule( newRule, index );
}

CSSRuleListImpl::~CSSRuleListImpl()
{
    CSSRuleImpl* rule;
    while ( !m_lstCSSRules.isEmpty() && ( rule = m_lstCSSRules.take( 0 ) ) )
        rule->deref();
}

// ---------------------------------------------------------------------------

CSSPageRuleImpl::CSSPageRuleImpl(StyleBaseImpl *parent)
    : CSSRuleImpl(parent)
{
    m_type = CSSRule::PAGE_RULE;
    m_style = 0;
}

CSSPageRuleImpl::~CSSPageRuleImpl()
{
    if(m_style) m_style->deref();
}

DOM::DOMString CSSPageRuleImpl::selectorText() const
{
    // ###
    return DOMString();
}

void CSSPageRuleImpl::setSelectorText(DOM::DOMString /*str*/)
{
    // ###
}

// --------------------------------------------------------------------------

CSSStyleRuleImpl::CSSStyleRuleImpl(StyleBaseImpl *parent)
    : CSSRuleImpl(parent)
{
    m_type = CSSRule::STYLE_RULE;
    m_style = 0;
    m_selector = 0;
}

CSSStyleRuleImpl::~CSSStyleRuleImpl()
{
    if(m_style) {
	m_style->setParent( 0 );
	m_style->deref();
    }
    delete m_selector;
}

DOM::DOMString CSSStyleRuleImpl::selectorText() const
{
    // FIXME: Handle all the selectors in the chain for comma-separated selectors.
    if (m_selector)
        return m_selector->selectorText();
    return DOMString();
}

void CSSStyleRuleImpl::setSelectorText(DOM::DOMString /*str*/)
{
    // ###
}

bool CSSStyleRuleImpl::parseString( const DOMString &/*string*/, bool )
{
    // ###
    return false;
}

void CSSStyleRuleImpl::setDeclaration( CSSMutableStyleDeclarationImpl *style)
{
    if ( m_style != style ) {
        if(m_style) m_style->deref();
        m_style = style;
        if(m_style) m_style->ref();
    }
}

void CSSRuleListImpl::deleteRule ( unsigned long index )
{
    CSSRuleImpl *rule = m_lstCSSRules.take( index );
    if( rule )
        rule->deref();
    else
        ; // ### Throw INDEX_SIZE_ERR exception here (TODO)
}

void CSSRuleListImpl::append( CSSRuleImpl *rule )
{
    insertRule( rule, m_lstCSSRules.count() ) ;
}

unsigned long CSSRuleListImpl::insertRule( CSSRuleImpl *rule,
                                           unsigned long index )
{
    if( rule && m_lstCSSRules.insert( index, rule ) )
    {
        rule->ref();
        return index;
    }

    // ### Should throw INDEX_SIZE_ERR exception instead! (TODO)
    return 0;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品青草综合久久久久99| 免费在线观看精品| 奇米色一区二区三区四区| 成人免费三级在线| 日韩欧美精品三级| 亚洲制服欧美中文字幕中文字幕| 国产福利一区在线| 日韩欧美国产综合一区| 亚洲午夜一二三区视频| 色综合中文字幕国产| 久久五月婷婷丁香社区| 日本在线不卡视频| 欧美日韩一级片网站| 亚洲欧美日韩一区| 波多野结衣的一区二区三区| 久久亚区不卡日本| 另类小说综合欧美亚洲| 91超碰这里只有精品国产| 有码一区二区三区| 色菇凉天天综合网| 亚洲欧洲成人精品av97| www.成人网.com| 国产精品久久毛片av大全日韩| 国内精品久久久久影院一蜜桃| 日韩一区二区电影网| 日产欧产美韩系列久久99| 欧美日韩1区2区| 亚洲成人在线免费| 欧美日高清视频| 日本女优在线视频一区二区| 69久久99精品久久久久婷婷| 亚洲大型综合色站| 91精品国产乱| 久久成人免费网站| 久久久久久久av麻豆果冻| 国产精品综合二区| 久久久久国产精品麻豆ai换脸 | 国产69精品一区二区亚洲孕妇 | 国内精品在线播放| 久久人人爽爽爽人久久久| 国产精品自在在线| 国产精品美女一区二区三区| www.亚洲精品| 亚洲综合激情网| 在线不卡a资源高清| 精品亚洲成a人| 久久久久久免费毛片精品| 国产很黄免费观看久久| 中文字幕亚洲电影| 欧美午夜理伦三级在线观看| 日本亚洲电影天堂| 国产欧美日韩另类一区| 色欧美88888久久久久久影院| 亚洲综合成人在线视频| 日韩一区二区麻豆国产| 成人综合在线视频| 夜色激情一区二区| 日韩欧美国产一区二区三区 | 6080午夜不卡| 国产精品一二三四区| 中文字幕日韩av资源站| 欧美日韩一区二区三区免费看| 男女男精品网站| 国产精品久久一卡二卡| 欧美日本在线看| 国产不卡在线播放| 亚洲bdsm女犯bdsm网站| 国产视频亚洲色图| 欧美精品日韩精品| 成人美女视频在线观看| 日本一区中文字幕| 亚洲青青青在线视频| 欧美一区国产二区| 91视频免费看| 国产一区二区三区精品视频| 一区二区日韩电影| 国产视频不卡一区| 欧美一区二区啪啪| 欧美主播一区二区三区美女| 国产美女娇喘av呻吟久久| 亚洲第一狼人社区| 亚洲欧美精品午睡沙发| 日韩欧美专区在线| 欧美在线观看视频一区二区 | 欧美哺乳videos| 在线这里只有精品| av亚洲精华国产精华精华| 国产综合久久久久久久久久久久| 一区二区三区蜜桃网| 中文字幕av一区二区三区高 | 欧美色综合影院| 成人动漫一区二区| 久久99久久久欧美国产| 亚洲国产欧美另类丝袜| 日韩伦理av电影| 久久天堂av综合合色蜜桃网| 日韩一级高清毛片| 884aa四虎影成人精品一区| 91免费精品国自产拍在线不卡| 国内精品伊人久久久久av一坑| 午夜精品久久久久久久久久| 一区二区三区精品视频在线| 亚洲毛片av在线| 亚洲天堂精品视频| 亚洲欧洲日产国码二区| 国产精品妹子av| 中文字幕亚洲欧美在线不卡| 中文字幕乱码日本亚洲一区二区| 国产欧美日韩精品a在线观看| 精品毛片乱码1区2区3区| 日韩精品一区二区三区四区 | 国产在线观看一区二区| 欧美日韩不卡在线| 日本大胆欧美人术艺术动态| 亚洲一区二区三区四区五区中文| 制服丝袜亚洲色图| 久久爱另类一区二区小说| 青青国产91久久久久久| 丁香婷婷综合色啪| 9191久久久久久久久久久| 欧美国产日本韩| 日本午夜一本久久久综合| 成人黄色免费短视频| 91精品午夜视频| 1区2区3区精品视频| 麻豆成人91精品二区三区| 色综合天天在线| 久久久精品一品道一区| 午夜精品成人在线视频| 91在线观看成人| 欧美精品一区二区三区高清aⅴ | 91啪亚洲精品| 26uuu欧美| 日韩高清一级片| 欧美亚洲国产bt| 最好看的中文字幕久久| 国产乱一区二区| 欧美一区二区三区免费在线看| 亚洲三级视频在线观看| 岛国一区二区三区| 精品国产伦理网| 免费看日韩a级影片| 欧美日韩一区不卡| 一区二区三区四区在线| 国产高清精品网站| 久久综合av免费| 免费看欧美女人艹b| 555夜色666亚洲国产免| 亚洲综合一二区| 91麻豆国产在线观看| 亚洲国产高清在线观看视频| 国产久卡久卡久卡久卡视频精品| 91精品国产综合久久久久久| 亚洲电影第三页| 欧美伦理电影网| 亚洲小说欧美激情另类| 色狠狠桃花综合| 一区二区三区免费在线观看| 日本高清不卡一区| 亚洲免费观看高清| 91色porny| 亚洲欧美日本韩国| 91视频.com| 一区二区三区波多野结衣在线观看 | 亚洲一区二区四区蜜桃| 欧美亚洲国产一区二区三区| 亚洲永久精品大片| 欧美亚洲高清一区二区三区不卡| 亚洲男女一区二区三区| 欧亚一区二区三区| 香蕉乱码成人久久天堂爱免费| 欧美日本在线播放| 免费看日韩a级影片| 久久亚洲精品国产精品紫薇| 国产精品996| 中文字幕五月欧美| 欧美视频在线一区二区三区| 亚洲国产精品一区二区久久| 欧美浪妇xxxx高跟鞋交| 久久成人18免费观看| 国产网站一区二区三区| 成人福利视频网站| 亚洲一区在线视频| 欧美精品vⅰdeose4hd| 蜜桃av一区二区三区电影| 精品粉嫩aⅴ一区二区三区四区| 国产福利一区二区三区视频在线 | 337p粉嫩大胆色噜噜噜噜亚洲| 国产麻豆精品在线| **欧美大码日韩| 欧美日韩精品专区| 麻豆久久久久久| 国产精品丝袜在线| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 日本美女一区二区| 久久精品一区二区三区四区| 不卡的av电影在线观看| 性做久久久久久免费观看欧美| 日韩欧美国产精品| 成人av电影在线|