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

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

?? dom2_range.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
字號(hào):
/**
 * This file is part of the DOM implementation for KDE.
 *
 * (C) 1999 Lars Knoll (knoll@kde.org)
 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no)
 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no)
 * (C) 2001 Peter Kelly (pmk@post.com)
 * 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.
 *
 */

#include "dom/dom_exception.h"

#include "xml/dom_docimpl.h"
#include "xml/dom2_rangeimpl.h"

namespace DOM {

Range::Range()
{
    // a range can't exist by itself - it must be associated with a document
    impl = 0;
}

Range::Range(const Document rootContainer)
{
    if(rootContainer.handle())
    {
	impl = new RangeImpl(rootContainer.handle()->docPtr());
	impl->ref();
    }
    else
	impl = 0;
}

Range::Range(const Range &other)
{
    impl = other.impl;
    if (impl) impl->ref();
}

Range::Range(const Node startContainer, const long startOffset, const Node endContainer, const long endOffset)
{
    if (startContainer.isNull() || endContainer.isNull()) {
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::NOT_FOUND_ERR; return; }
#else
        throw DOMException(DOMException::NOT_FOUND_ERR);
#endif    
    }

    if (!startContainer.handle()->getDocument() ||
        startContainer.handle()->getDocument() != endContainer.handle()->getDocument()) {
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::WRONG_DOCUMENT_ERR; return; }
#else
        throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
#endif    
    }

    impl = new RangeImpl(startContainer.handle()->docPtr(),startContainer.handle(),startOffset,endContainer.handle(),endOffset);
    impl->ref();
}

Range::Range(RangeImpl *i)
{
    impl = i;
    if (impl) impl->ref();
}

Range &Range::operator = (const Range &other)
{
    if ( impl != other.impl ) {
    if (impl) impl->deref();
    impl = other.impl;
    if (impl) impl->ref();
    }
    return *this;
}

Range::~Range()
{
    if (impl) impl->deref();
}

Node Range::startContainer() const
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    NodeImpl *r = impl->startContainer(exceptioncode);
    throwException(exceptioncode);
    return r;
}

long Range::startOffset() const
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    long r = impl->startOffset(exceptioncode);
    throwException(exceptioncode);
    return r;

}

Node Range::endContainer() const
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    NodeImpl *r = impl->endContainer(exceptioncode);
    throwException(exceptioncode);
    return r;
}

long Range::endOffset() const
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    long r = impl->endOffset(exceptioncode);
    throwException(exceptioncode);
    return r;
}

bool Range::collapsed() const
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    bool r = impl->collapsed(exceptioncode);
    throwException(exceptioncode);
    return r;
}

Node Range::commonAncestorContainer()
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return Node(); }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    NodeImpl *r = impl->commonAncestorContainer(exceptioncode);
    throwException(exceptioncode);
    return r;
}

void Range::setStart( const Node &refNode, long offset )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->setStart(refNode.handle(),offset,exceptioncode);
    throwException(exceptioncode);
}

void Range::setEnd( const Node &refNode, long offset )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->setEnd(refNode.handle(),offset,exceptioncode);
    throwException(exceptioncode);
}

void Range::setStartBefore( const Node &refNode )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    


    int exceptioncode = 0;
    impl->setStartBefore(refNode.handle(),exceptioncode);
    throwException(exceptioncode);
}

void Range::setStartAfter( const Node &refNode )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->setStartAfter(refNode.handle(),exceptioncode);
    throwException(exceptioncode);
}

void Range::setEndBefore( const Node &refNode )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->setEndBefore(refNode.handle(),exceptioncode);
    throwException(exceptioncode);
}

void Range::setEndAfter( const Node &refNode )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->setEndAfter(refNode.handle(),exceptioncode);
    throwException(exceptioncode);
}

void Range::collapse( bool toStart )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->collapse(toStart,exceptioncode);
    throwException(exceptioncode);
}

void Range::selectNode( const Node &refNode )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->selectNode(refNode.handle(),exceptioncode);
    throwException(exceptioncode);
}

void Range::selectNodeContents( const Node &refNode )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->selectNodeContents(refNode.handle(),exceptioncode);
    throwException(exceptioncode);
}

short Range::compareBoundaryPoints( CompareHow how, const Range &sourceRange )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    short r = impl->compareBoundaryPoints(how,sourceRange.handle(),exceptioncode);
    throwException(exceptioncode);
    return r;
}

bool Range::boundaryPointsValid(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    return impl->boundaryPointsValid();
}

void Range::deleteContents(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->deleteContents(exceptioncode);
    throwException(exceptioncode);
}

DocumentFragment Range::extractContents(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    DocumentFragmentImpl *r = impl->extractContents(exceptioncode);
    throwException(exceptioncode);
    return r;
}

DocumentFragment Range::cloneContents(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    DocumentFragmentImpl *r = impl->cloneContents(exceptioncode);
    throwException(exceptioncode);
    return r;
}

void Range::insertNode( const Node &newNode )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->insertNode(newNode.handle(),exceptioncode);
    throwException(exceptioncode);
}

void Range::surroundContents( const Node &newParent )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->surroundContents(newParent.handle(),exceptioncode);
    throwException(exceptioncode);
}

Range Range::cloneRange(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    RangeImpl *r = impl->cloneRange(exceptioncode);
    throwException(exceptioncode);
    return r;
}

DOMString Range::toString(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return DOMString(); }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    DOMString r = impl->toString(exceptioncode);
    throwException(exceptioncode);
    return r;

}

DOMString Range::toHTML(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return DOMString(); }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    return impl->toHTML();
}

DocumentFragment Range::createContextualFragment( DOMString &html )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    DocumentFragmentImpl *r = impl->createContextualFragment(html, exceptioncode);
    throwException(exceptioncode);
    return r;
}


void Range::detach(  )
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    int exceptioncode = 0;
    impl->detach(exceptioncode);
    throwException(exceptioncode);
}

bool Range::isDetached() const
{
    if (!impl)
#if KHTML_NO_EXCEPTIONS    
        { _exceptioncode = DOMException::INVALID_STATE_ERR; return 0; }
#else
        throw DOMException(DOMException::INVALID_STATE_ERR);
#endif    

    return impl->isDetached();
}

RangeImpl *Range::handle() const
{
    return impl;
}

bool Range::isNull() const
{
    return (impl == 0);
}

void Range::throwException(int exceptioncode) const
{
    if (!exceptioncode)
        return;

#if KHTML_NO_EXCEPTIONS
    if (exceptioncode)
        _exceptioncode = exceptioncode;
#else
    if (exceptioncode >= RangeException::_EXCEPTION_OFFSET && exceptioncode <= RangeException::_EXCEPTION_MAX)
        throw RangeException(static_cast<RangeException::RangeExceptionCode>(exceptioncode-RangeException::_EXCEPTION_OFFSET));
    else
        throw DOMException(exceptioncode);
#endif    
    
}

bool operator==(const Range &a, const Range &b)
{
    RangeImpl *ai = a.handle();
    RangeImpl *bi = b.handle();
    if (ai == bi)
        return true;
    if (!ai || !bi)
        return false;
    bool ad = ai->isDetached();
    bool bd = bi->isDetached();
    if (ad && bd)
        return true;
    if (ad || bd)
        return false;
    return a.startContainer() == b.startContainer()
        && a.endContainer() == b.endContainer()
        && a.startOffset() == b.startOffset()
        && a.endOffset() == b.endOffset();
}

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频中文字幕| 久久精品综合网| 成人视屏免费看| 亚洲成av人片在线| 欧美激情一区二区三区| 欧美精品tushy高清| 成人免费视频免费观看| 日韩国产成人精品| ㊣最新国产の精品bt伙计久久| 日韩欧美国产三级电影视频| 91激情在线视频| 成人污视频在线观看| 蜜臀精品一区二区三区在线观看| 夜夜夜精品看看| 亚洲欧美综合另类在线卡通| 2021久久国产精品不只是精品| 欧美日韩国产美女| 色一区在线观看| 成人av电影在线播放| 国产综合色在线| 免费观看30秒视频久久| 亚洲va在线va天堂| 一区二区三区中文字幕电影| 国产精品久久毛片| 中文字幕成人在线观看| 久久亚洲精精品中文字幕早川悠里| 欧美一区二区三区免费大片 | 国内精品嫩模私拍在线| 日日夜夜精品免费视频| 亚洲综合色成人| 亚洲最色的网站| 亚洲免费观看高清完整版在线观看 | 国产精品888| 九色综合狠狠综合久久| 日韩精品91亚洲二区在线观看 | 亚洲激情在线播放| 亚洲欧美日韩国产综合| 亚洲日本成人在线观看| 亚洲色图欧美在线| 亚洲精品国产a| 亚洲黄色录像片| 亚洲高清视频在线| 亚洲1区2区3区4区| 日韩黄色免费网站| 久久成人免费网站| 韩国成人福利片在线播放| 韩国女主播成人在线| 国产v综合v亚洲欧| 91视频com| 欧美日韩黄色影视| 日韩精品一区在线| 久久久久97国产精华液好用吗| 精品av久久707| 国产喷白浆一区二区三区| 国产精品网曝门| 亚洲色图丝袜美腿| 五月天中文字幕一区二区| 日韩电影免费一区| 国产一区二区伦理片| 国产成人精品午夜视频免费| 91玉足脚交白嫩脚丫在线播放| 91国产视频在线观看| 91精品国产综合久久久久久 | 精品国产不卡一区二区三区| 国产三级一区二区| 最新欧美精品一区二区三区| 亚洲一二三级电影| 久久精品国产精品亚洲精品| 国产九九视频一区二区三区| 91在线视频免费观看| 欧美日韩午夜在线| www国产精品av| 中文字幕日韩一区| 日韩综合小视频| 国产乱对白刺激视频不卡| 成人动漫一区二区在线| 欧美日韩国产天堂| 欧美韩国日本综合| 肉丝袜脚交视频一区二区| 东方欧美亚洲色图在线| 欧美视频自拍偷拍| 国产欧美一区二区精品婷婷 | 亚洲午夜影视影院在线观看| 久久精品999| 91丨九色porny丨蝌蚪| 欧美一级国产精品| 最近日韩中文字幕| 麻豆一区二区在线| 一本高清dvd不卡在线观看| 精品日本一线二线三线不卡| 亚洲精品免费播放| 国产酒店精品激情| 欧美男女性生活在线直播观看| 国产欧美日产一区| 日本不卡视频在线| 日本韩国欧美一区二区三区| 久久综合九色综合欧美亚洲| 亚洲一区二区三区激情| 国产盗摄女厕一区二区三区| 欧美日韩免费高清一区色橹橹| 欧美国产精品中文字幕| 老司机午夜精品| 欧美体内she精视频| 亚洲欧洲无码一区二区三区| 国产麻豆视频一区二区| 777精品伊人久久久久大香线蕉| 中文字幕在线播放不卡一区| 国产一区二区电影| 欧美一区二区三区视频| 亚洲高清三级视频| 色综合欧美在线视频区| 国产精品人人做人人爽人人添| 免费成人av资源网| 欧美日本高清视频在线观看| 亚洲欧美日韩电影| www.亚洲人| 国产欧美日韩综合精品一区二区| 蜜桃视频免费观看一区| 欧美日本在线播放| 亚洲午夜成aⅴ人片| 97久久精品人人爽人人爽蜜臀| 久久久精品欧美丰满| 激情五月婷婷综合网| 日韩美女视频在线| 男男成人高潮片免费网站| 欧美乱妇一区二区三区不卡视频| 亚洲男人的天堂在线观看| 91玉足脚交白嫩脚丫在线播放| 国产精品色哟哟| 成人黄色免费短视频| 国产精品福利一区| 99久久免费视频.com| 中文字幕日韩一区二区| 99精品视频一区二区三区| 中文字幕在线不卡视频| 91麻豆成人久久精品二区三区| 成人欧美一区二区三区黑人麻豆| 成人av在线播放网址| 亚洲视频你懂的| 在线观看视频一区二区 | 青青国产91久久久久久| 欧美一区在线视频| 久久精品国产网站| 久久免费午夜影院| 国产大陆a不卡| 国产精品网站在线观看| 99久久久国产精品| 伊人性伊人情综合网| 欧美日韩亚洲综合在线| 免费看精品久久片| 久久久久久影视| www.欧美日韩国产在线| 亚洲女同一区二区| 欧美日韩国产精品自在自线| 美美哒免费高清在线观看视频一区二区| 日韩一区二区免费在线电影| 国产一区二区福利视频| 日韩一区中文字幕| 欧美精品乱码久久久久久 | proumb性欧美在线观看| 尤物在线观看一区| 欧美一区二区免费观在线| 九色porny丨国产精品| 国产网红主播福利一区二区| 色哟哟国产精品免费观看| 热久久国产精品| 国产日本亚洲高清| 在线观看日韩高清av| 狂野欧美性猛交blacked| 久久久久国产精品人| 91成人免费网站| 久久66热偷产精品| 日韩理论片网站| 欧美一区二区三区免费在线看| 丁香六月久久综合狠狠色| 亚洲一卡二卡三卡四卡无卡久久| 日韩精品中文字幕一区二区三区 | 蜜桃视频第一区免费观看| 欧美韩国日本一区| 欧美精品三级在线观看| 国产电影一区在线| 亚洲va在线va天堂| 国产精品欧美综合在线| 69堂国产成人免费视频| 国产91精品一区二区麻豆亚洲| 午夜国产精品影院在线观看| 国产欧美一区二区三区鸳鸯浴 | 欧美影院午夜播放| 国产精品一区二区久久精品爱涩| 亚洲精品高清在线观看| 精品1区2区在线观看| 色哟哟在线观看一区二区三区| 精品一区二区三区日韩| 亚洲综合免费观看高清在线观看| 国产亚洲精品7777| 91精品在线观看入口| 在线精品国精品国产尤物884a| 国产真实乱子伦精品视频| 亚洲图片有声小说| 国产精品成人午夜|