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

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

?? htmlediting.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
?? 第 1 頁 / 共 5 頁
字號(hào):

void CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position &pos)
{
    if (pos.isNull())
        return;
    
    document()->updateLayout();
    
    VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY);
    VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos));
    VisiblePosition visibleParagraphEnd(endOfParagraph(visiblePos, IncludeLineBreak));
    Position paragraphStart = visibleParagraphStart.deepEquivalent().upstream(StayInBlock);
    Position paragraphEnd = visibleParagraphEnd.deepEquivalent().upstream(StayInBlock);
    Position beforeParagraphStart = paragraphStart.upstream(DoNotStayInBlock);
    
    // Perform some checks to see if we need to perform work in this function.
    if (paragraphStart.node()->isBlockFlow()) {
        if (paragraphEnd.node()->isBlockFlow()) {
            if (!paragraphEnd.node()->isAncestor(paragraphStart.node())) {
                // If the paragraph end is a descendant of paragraph start, then we need to run
                // the rest of this function. If not, we can bail here.
                return;
            }
        }
        else if (paragraphEnd.node()->enclosingBlockFlowElement() != paragraphStart.node()) {
            // The paragraph end is in another block that is an ancestor of the paragraph start.
            // We can bail as we have a full block to work with.
            ASSERT(paragraphStart.node()->isAncestor(paragraphEnd.node()->enclosingBlockFlowElement()));
            return;
        }
        else if (isEndOfDocument(visibleParagraphEnd)) {
            // At the end of the document. We can bail here as well.
            return;
        }
    }
    
    // Create the block to insert. Most times, this will be a shallow clone of the block containing
    // the start of the selection (the start block), except for two cases:
    //    1) When the start block is a body element.
    //    2) When the start block is a mail blockquote and we are not in a position to insert
    //       the new block as a peer of the start block. This prevents creating an unwanted 
    //       additional level of quoting.
    NodeImpl *startBlock = paragraphStart.node()->enclosingBlockFlowElement();
    NodeImpl *newBlock = 0;
    if (startBlock->id() == ID_BODY || (isMailBlockquote(startBlock) && paragraphStart.node() != startBlock))
        newBlock = createDefaultParagraphElement(document());
    else
        newBlock = startBlock->cloneNode(false);

    NodeImpl *moveNode = paragraphStart.node();
    if (paragraphStart.offset() >= paragraphStart.node()->caretMaxOffset())
        moveNode = moveNode->traverseNextNode();
    NodeImpl *endNode = paragraphEnd.node();

    if (paragraphStart.node()->id() == ID_BODY) {
        insertNodeAt(newBlock, paragraphStart.node(), 0);
    }
    else if (paragraphStart.node()->id() == ID_BR) {
        insertNodeAfter(newBlock, paragraphStart.node());
    }
    else if (paragraphStart.node()->isBlockFlow()) {
        insertNodeBefore(newBlock, paragraphStart.node());
    }
    else if (beforeParagraphStart.node()->enclosingBlockFlowElement()->id() != ID_BODY) {
        insertNodeAfter(newBlock, beforeParagraphStart.node()->enclosingBlockFlowElement());
    }
    else {
        insertNodeAfter(newBlock, beforeParagraphStart.node());
    }

    while (moveNode && !moveNode->isBlockFlow()) {
        NodeImpl *next = moveNode->traverseNextSibling();
        removeNode(moveNode);
        appendNode(moveNode, newBlock);
        if (moveNode == endNode)
            break;
        moveNode = next;
    }
}

static bool isSpecialElement(NodeImpl *n)
{
    if (!n->isHTMLElement())
        return false;

    if (n->id() == ID_A && n->hasAnchor())
        return true;

    if (n->id() == ID_UL || n->id() == ID_OL || n->id() == ID_DL)
        return true;

    RenderObject *renderer = n->renderer();

    if (renderer && (renderer->style()->display() == TABLE || renderer->style()->display() == INLINE_TABLE))
        return true;

    if (renderer && renderer->style()->isFloating())
        return true;

    if (renderer && renderer->style()->position() != STATIC)
        return true;

    return false;
}

// This version of the function is meant to be called on positions in a document fragment,
// so it does not check for a root editable element, it is assumed these nodes will be put
// somewhere editable in the future
static bool isFirstVisiblePositionInSpecialElementInFragment(const Position& pos)
{
    VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);

    for (NodeImpl *n = pos.node(); n; n = n->parentNode()) {
        if (VisiblePosition(n, 0, DOWNSTREAM) != vPos)
            return false;
        if (isSpecialElement(n))
            return true;
    }

    return false;
}

static bool isFirstVisiblePositionInSpecialElement(const Position& pos)
{
    VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);

    for (NodeImpl *n = pos.node(); n; n = n->parentNode()) {
        if (VisiblePosition(n, 0, DOWNSTREAM) != vPos)
            return false;
        if (n->rootEditableElement() == NULL)
            return false;
        if (isSpecialElement(n))
            return true;
    }

    return false;
}

static Position positionBeforeNode(NodeImpl *node)
{
    return Position(node->parentNode(), node->nodeIndex());
}

static Position positionBeforeContainingSpecialElement(const Position& pos)
{
    ASSERT(isFirstVisiblePositionInSpecialElement(pos));

    VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
    
    NodeImpl *outermostSpecialElement = NULL;

    for (NodeImpl *n = pos.node(); n; n = n->parentNode()) {
        if (VisiblePosition(n, 0, DOWNSTREAM) != vPos)
            break;
        if (n->rootEditableElement() == NULL)
            break;
        if (isSpecialElement(n))
            outermostSpecialElement = n;
    }
    
    ASSERT(outermostSpecialElement);

    Position result = positionBeforeNode(outermostSpecialElement);
    if (result.isNull() || !result.node()->rootEditableElement())
        return pos;
    
    return result;
}

static bool isLastVisiblePositionInSpecialElement(const Position& pos)
{
    // make sure to get a range-compliant version of the position
    Position rangePos = VisiblePosition(pos, DOWNSTREAM).position();

    VisiblePosition vPos = VisiblePosition(rangePos, DOWNSTREAM);

    for (NodeImpl *n = rangePos.node(); n; n = n->parentNode()) {
        if (VisiblePosition(n, maxRangeOffset(n), DOWNSTREAM) != vPos)
            return false;
        if (n->rootEditableElement() == NULL)
            return false;
        if (isSpecialElement(n))
            return true;
    }

    return false;
}

static Position positionAfterNode(NodeImpl *node)
{
    return Position(node->parentNode(), node->nodeIndex() + 1);
}

static Position positionAfterContainingSpecialElement(const Position& pos)
{
    ASSERT(isLastVisiblePositionInSpecialElement(pos));

    // make sure to get a range-compliant version of the position
    Position rangePos = VisiblePosition(pos, DOWNSTREAM).position();

    VisiblePosition vPos = VisiblePosition(rangePos, DOWNSTREAM);

    NodeImpl *outermostSpecialElement = NULL;

    for (NodeImpl *n = rangePos.node(); n; n = n->parentNode()) {
        if (VisiblePosition(n, maxRangeOffset(n), DOWNSTREAM) != vPos)
            break;
        if (n->rootEditableElement() == NULL)
            break;
        if (isSpecialElement(n))
            outermostSpecialElement = n;
    }
    
    ASSERT(outermostSpecialElement);

    Position result = positionAfterNode(outermostSpecialElement);
    if (result.isNull() || !result.node()->rootEditableElement())
        return pos;
    
    return result;
}

static Position positionOutsideContainingSpecialElement(const Position &pos)
{
    if (isFirstVisiblePositionInSpecialElement(pos)) {
        return positionBeforeContainingSpecialElement(pos);
    } else if (isLastVisiblePositionInSpecialElement(pos)) {
        return positionAfterContainingSpecialElement(pos);
    }

    return pos;
}

static Position positionBeforePossibleContainingSpecialElement(const Position &pos)
{
    if (isFirstVisiblePositionInSpecialElement(pos)) {
        return positionBeforeContainingSpecialElement(pos);
    } 

    return pos;
}

static Position positionAfterPossibleContainingSpecialElement(const Position &pos)
{
    if (isLastVisiblePositionInSpecialElement(pos)) {
        return positionAfterContainingSpecialElement(pos);
    }

    return pos;
}

//==========================================================================================
// Concrete commands
//------------------------------------------------------------------------------------------
// AppendNodeCommand

AppendNodeCommand::AppendNodeCommand(DocumentImpl *document, NodeImpl *appendChild, NodeImpl *parentNode)
    : EditCommand(document), m_appendChild(appendChild), m_parentNode(parentNode)
{
    ASSERT(m_appendChild);
    m_appendChild->ref();

    ASSERT(m_parentNode);
    m_parentNode->ref();
}

AppendNodeCommand::~AppendNodeCommand()
{
    ASSERT(m_appendChild);
    m_appendChild->deref();

    ASSERT(m_parentNode);
    m_parentNode->deref();
}

void AppendNodeCommand::doApply()
{
    ASSERT(m_appendChild);
    ASSERT(m_parentNode);

    int exceptionCode = 0;
    m_parentNode->appendChild(m_appendChild, exceptionCode);
    ASSERT(exceptionCode == 0);
}

void AppendNodeCommand::doUnapply()
{
    ASSERT(m_appendChild);
    ASSERT(m_parentNode);
    ASSERT(state() == Applied);

    int exceptionCode = 0;
    m_parentNode->removeChild(m_appendChild, exceptionCode);
    ASSERT(exceptionCode == 0);
}

//------------------------------------------------------------------------------------------
// ApplyStyleCommand

ApplyStyleCommand::ApplyStyleCommand(DocumentImpl *document, CSSStyleDeclarationImpl *style, EditAction editingAction, EPropertyLevel propertyLevel)
    : CompositeEditCommand(document), m_style(style->makeMutable()), m_editingAction(editingAction), m_propertyLevel(propertyLevel)
{   
    ASSERT(m_style);
    m_style->ref();
}

ApplyStyleCommand::~ApplyStyleCommand()
{
    ASSERT(m_style);
    m_style->deref();
}

void ApplyStyleCommand::doApply()
{
    switch (m_propertyLevel) {
        case PropertyDefault: {
            // apply the block-centric properties of the style
            CSSMutableStyleDeclarationImpl *blockStyle = m_style->copyBlockProperties();
            blockStyle->ref();
            applyBlockStyle(blockStyle);
            // apply any remaining styles to the inline elements
            // NOTE: hopefully, this string comparison is the same as checking for a non-null diff
            if (blockStyle->length() < m_style->length()) {
                CSSMutableStyleDeclarationImpl *inlineStyle = m_style->copy();
                inlineStyle->ref();
                applyRelativeFontStyleChange(inlineStyle);
                blockStyle->diff(inlineStyle);
                applyInlineStyle(inlineStyle);
                inlineStyle->deref();
            }
            blockStyle->deref();
            break;
        }
        case ForceBlockProperties:
            // Force all properties to be applied as block styles.
            applyBlockStyle(m_style);
            break;
    }
   
    setEndingSelectionNeedsLayout();
}

EditAction ApplyStyleCommand::editingAction() const
{
    return m_editingAction;
}

void ApplyStyleCommand::applyBlockStyle(CSSMutableStyleDeclarationImpl *style)
{
    // update document layout once before removing styles
    // so that we avoid the expense of updating before each and every call
    // to check a computed style
    document()->updateLayout();

    // get positions we want to use for applying style
    Position start(endingSelection().start());
    Position end(endingSelection().end());
    
    // remove current values, if any, of the specified styles from the blocks
    // NOTE: tracks the previous block to avoid repeated processing
    // Also, gather up all the nodes we want to process in a QPtrList before
    // doing anything. This averts any bugs iterating over these nodes
    // once you start removing and applying style.
    NodeImpl *beyondEnd = end.node()->traverseNextNode();
    QPtrList<NodeImpl> nodes;
    for (NodeImpl *node = start.node(); node != beyondEnd; node = node->traverseNextNode())
        nodes.append(node);
        
    NodeImpl *prevBlock = 0;
    for (QPtrListIterator<NodeImpl> it(nodes); it.current(); ++it) {
        NodeImpl *block = it.current()->enclosingBlockFlowElement();
        if (block != prevBlock && block->isHTMLElement()) {
            removeCSSStyle(style, static_cast<HTMLElementImpl *>(block));
            prevBlock = block;
        }
    }
    
    // apply specified styles to the block flow elements in the selected range
    prevBlock = 0;
    for (QPtrListIterator<NodeImpl> it(nodes); it.current(); ++it) {
        NodeImpl *node = it.current();
        if (node->renderer()) {
            NodeImpl *block = node->enclosingBlockFlowElement();
            if (block != prevBlock) {
                addBlockStyleIfNeeded(style, node);
                prevBlock = block;
            }
        }
    }
}

#define NoFontDelta (0.0f)
#define MinimumFontSize (0.1f)

void ApplyStyleCommand::applyRelativeFontStyleChange(CSSMutableStyleDeclarationImpl *style)
{
    if (style->getPropertyCSSValue(CSS_PROP_FONT_SIZE)) {
        // Explicit font size overrides any delta.
        style->removeProperty(CSS_PROP__KHTML_FONT_SIZE_DELTA);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费成人你懂的| 久久这里只有精品视频网| 国产伦精品一区二区三区在线观看| 亚洲在线观看免费视频| 亚洲欧美日韩久久精品| 亚洲欧美日韩精品久久久久| 亚洲四区在线观看| 亚洲三级在线观看| 亚洲一区在线看| 婷婷夜色潮精品综合在线| 午夜精品国产更新| 男男视频亚洲欧美| 久久精品国产亚洲5555| 国产剧情av麻豆香蕉精品| 国产成人免费视频精品含羞草妖精| 成人黄色小视频在线观看| 99re成人精品视频| 欧美日韩综合不卡| 日韩女优av电影| 国产日韩欧美在线一区| 亚洲色图欧美激情| 日韩av午夜在线观看| 美女性感视频久久| 波多野结衣亚洲| 欧美私人免费视频| 精品免费一区二区三区| 中文在线一区二区| 亚洲一二三专区| 老司机精品视频一区二区三区| 国产伦理精品不卡| 欧美性猛片xxxx免费看久爱| 日韩三级高清在线| 国产精品久久久久久亚洲毛片 | 国产亚洲精品aa午夜观看| 2023国产一二三区日本精品2022| 久久综合久色欧美综合狠狠| 亚洲精品你懂的| 激情欧美日韩一区二区| 91网上在线视频| 久久综合久久综合九色| 一区二区三区国产| 国产伦精品一区二区三区免费| 色香蕉成人二区免费| 欧美精品一区二区三区蜜臀| 亚洲欧美激情在线| 国产激情一区二区三区桃花岛亚洲| 色综合色综合色综合色综合色综合| 91精品国产aⅴ一区二区| 国产精品久线观看视频| 捆绑紧缚一区二区三区视频| 色综合久久99| 久久久国产综合精品女国产盗摄| 亚洲高清在线精品| 成人av在线资源| 精品99999| 蜜桃免费网站一区二区三区| 色综合久久中文字幕综合网| 国产亚洲va综合人人澡精品| 蜜臀av亚洲一区中文字幕| 欧美日韩在线观看一区二区 | 成人综合日日夜夜| 日韩一区二区免费视频| 性感美女久久精品| a4yy欧美一区二区三区| 国产日韩欧美精品一区| 久久99这里只有精品| 欧美精品tushy高清| 一区二区三区中文字幕电影| 91亚洲永久精品| 国产精品久久精品日日| 高清国产一区二区三区| 精品嫩草影院久久| 国内不卡的二区三区中文字幕| 日韩欧美一区二区不卡| 日韩和欧美一区二区| 717成人午夜免费福利电影| 亚洲午夜影视影院在线观看| 欧美色区777第一页| 亚洲午夜久久久久久久久电影网 | 日韩欧美一级精品久久| 免费成人性网站| 欧美xfplay| 久久99精品久久久久久久久久久久 | 亚洲1区2区3区视频| 欧美日韩一区二区三区高清| 视频一区二区三区中文字幕| 欧美久久久久久久久中文字幕| 亚洲午夜久久久久久久久久久| 欧美日韩精品电影| 日韩影院免费视频| 精品久久久三级丝袜| 韩国毛片一区二区三区| 国产喂奶挤奶一区二区三区| zzijzzij亚洲日本少妇熟睡| 亚洲一二三区视频在线观看| 9191国产精品| 国产精品一区二区免费不卡| 亚洲精品日日夜夜| 制服丝袜av成人在线看| 久久99国产精品久久| 中文字幕亚洲电影| 欧美性xxxxxx少妇| 久久99精品久久久久久动态图| 久久精品水蜜桃av综合天堂| 91亚洲精品久久久蜜桃网站| 午夜日韩在线电影| 国产亚洲一区字幕| 成人av电影在线播放| 亚洲成av人影院在线观看网| 精品国产乱码久久久久久闺蜜| av电影天堂一区二区在线| 亚洲成av人片在线观看无码| 欧美精品一区二区精品网| 97超碰欧美中文字幕| 蜜乳av一区二区| 亚洲丝袜自拍清纯另类| 欧美一区二区免费观在线| 成人一区二区三区| 午夜久久电影网| 国产精品免费视频网站| 4438成人网| 99国产欧美久久久精品| 精品无人码麻豆乱码1区2区| 夜夜嗨av一区二区三区网页| 久久精品视频在线看| 91精品国产91久久综合桃花| 99久久er热在这里只有精品15| 日本成人中文字幕| 亚洲欧美一区二区三区孕妇| 久久影视一区二区| 欧美精品日韩精品| 91在线免费视频观看| 国产精品一区二区三区四区| 麻豆免费看一区二区三区| 亚洲久草在线视频| 国产精品视频九色porn| 精品国产麻豆免费人成网站| 337p亚洲精品色噜噜| 一本一本大道香蕉久在线精品| 国产一区福利在线| 美脚の诱脚舐め脚责91| 亚洲成人7777| 亚洲一区二区三区四区的 | 在线观看日韩毛片| 99久免费精品视频在线观看| 国产精品自拍一区| 精品一区二区久久| 捆绑紧缚一区二区三区视频 | 国产日韩欧美综合在线| 久久久精品欧美丰满| 亚洲精品一区二区三区香蕉| 日韩欧美高清在线| 欧美xxxxxxxx| 久久久久久久久久电影| 久久午夜电影网| 久久久久久综合| 久久精品男人的天堂| 久久精品免视看| 国产清纯在线一区二区www| 国产日韩欧美制服另类| 国产精品污www在线观看| 国产精品无遮挡| 国产精品久久久久久妇女6080| 国产精品热久久久久夜色精品三区| 久久精品视频在线免费观看 | 欧美日韩国产大片| 欧美性色黄大片手机版| 91精品国产综合久久蜜臀| 日韩一区二区在线看| wwwwww.欧美系列| 国产精品久线在线观看| 亚洲国产精品久久久男人的天堂 | 国产色产综合产在线视频| 国产精品欧美经典| 一二三区精品视频| 久久机这里只有精品| 大尺度一区二区| 欧美中文字幕一区二区三区亚洲| 欧美精品久久一区| 精品国产乱码久久久久久浪潮| 国产精品蜜臀在线观看| 怡红院av一区二区三区| 美女视频黄a大片欧美| 国产不卡一区视频| 91麻豆国产精品久久| 91精品在线一区二区| xfplay精品久久| 一区二区三区在线影院| 日本在线观看不卡视频| 成人aa视频在线观看| 欧美久久久一区| 成人欧美一区二区三区1314| 丝袜美腿亚洲综合| 成人毛片老司机大片| 91精品啪在线观看国产60岁| 国产精品久久久久aaaa| 男女激情视频一区| 色94色欧美sute亚洲线路一久| 精品日韩av一区二区| 亚洲午夜视频在线|