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

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

?? htmlediting.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
        return;
    }

    // Get the adjustment amount out of the style.
    CSSValueImpl *value = style->getPropertyCSSValue(CSS_PROP__KHTML_FONT_SIZE_DELTA);
    if (!value)
        return;
    value->ref();
    float adjustment = NoFontDelta;
    if (value->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE) {
        CSSPrimitiveValueImpl *primitiveValue = static_cast<CSSPrimitiveValueImpl *>(value);
        if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_PX) {
            // Only PX handled now. If we handle more types in the future, perhaps
            // a switch statement here would be more appropriate.
            adjustment = primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PX);
        }
    }
    style->removeProperty(CSS_PROP__KHTML_FONT_SIZE_DELTA);
    value->deref();
    if (adjustment == NoFontDelta)
        return;
    
    // Adjust to the positions we want to use for applying style.
    Selection selection = endingSelection();
    Position start(selection.start().downstream(StayInBlock));
    Position end(selection.end().upstream(StayInBlock));
    if (RangeImpl::compareBoundaryPoints(end, start) < 0) {
        Position swap = start;
        start = end;
        end = swap;
    }

    // Join up any adjacent text nodes.
    if (start.node()->isTextNode()) {
        joinChildTextNodes(start.node()->parentNode(), start, end);
        selection = endingSelection();
        start = selection.start();
        end = selection.end();
    }
    if (end.node()->isTextNode() && start.node()->parentNode() != end.node()->parentNode()) {
        joinChildTextNodes(end.node()->parentNode(), start, end);
        selection = endingSelection();
        start = selection.start();
        end = selection.end();
    }

    // Split the start text nodes if needed to apply style.
    bool splitStart = splitTextAtStartIfNeeded(start, end); 
    if (splitStart) {
        start = endingSelection().start();
        end = endingSelection().end();
    }
    bool splitEnd = splitTextAtEndIfNeeded(start, end);
    if (splitEnd) {
        start = endingSelection().start();
        end = endingSelection().end();
    }

    NodeImpl *beyondEnd = end.node()->traverseNextNode(); // Calculate loop end point.
    start = start.upstream(StayInBlock); // Move upstream to ensure we do not add redundant spans.
    NodeImpl *startNode = start.node();
    if (startNode->isTextNode() && start.offset() >= startNode->caretMaxOffset()) // Move out of text node if range does not include its characters.
        startNode = startNode->traverseNextNode();

    // Store away font size before making any changes to the document.
    // This ensures that changes to one node won't effect another.
    QMap<const NodeImpl *,float> startingFontSizes;
    for (const NodeImpl *node = startNode; node != beyondEnd; node = node->traverseNextNode())
        startingFontSizes.insert(node, computedFontSize(node));

    // These spans were added by us. If empty after font size changes, they can be removed.
    QPtrList<NodeImpl> emptySpans;
    
    NodeImpl *lastStyledNode = 0;
    for (NodeImpl *node = startNode; node != beyondEnd; node = node->traverseNextNode()) {
        HTMLElementImpl *elem = 0;
        if (node->isHTMLElement()) {
            // Only work on fully selected nodes.
            if (!nodeFullySelected(node, start, end))
                continue;
            elem = static_cast<HTMLElementImpl *>(node);
        }
        else if (node->isTextNode() && node->parentNode() != lastStyledNode) {
            // Last styled node was not parent node of this text node, but we wish to style this
            // text node. To make this possible, add a style span to surround this text node.
            elem = static_cast<HTMLElementImpl *>(createStyleSpanElement(document()));
            insertNodeBefore(elem, node);
            surroundNodeRangeWithElement(node, node, elem);
        }
        else {
            // Only handle HTML elements and text nodes.
            continue;
        }
        lastStyledNode = node;
        
        CSSMutableStyleDeclarationImpl *inlineStyleDecl = elem->getInlineStyleDecl();
        float currentFontSize = computedFontSize(node);
        float desiredFontSize = kMax(MinimumFontSize, startingFontSizes[node] + adjustment);
        if (inlineStyleDecl->getPropertyCSSValue(CSS_PROP_FONT_SIZE)) {
            inlineStyleDecl->removeProperty(CSS_PROP_FONT_SIZE, true);
            currentFontSize = computedFontSize(node);
        }
        if (currentFontSize != desiredFontSize) {
            QString desiredFontSizeString = QString::number(desiredFontSize);
            desiredFontSizeString += "px";
            inlineStyleDecl->setProperty(CSS_PROP_FONT_SIZE, desiredFontSizeString, false, false);
            setNodeAttribute(elem, ATTR_STYLE, inlineStyleDecl->cssText());
        }
        if (inlineStyleDecl->length() == 0) {
            removeNodeAttribute(elem, ATTR_STYLE);
            if (isEmptyStyleSpan(elem))
                emptySpans.append(elem);
        }
    }

    for (QPtrListIterator<NodeImpl> it(emptySpans); it.current(); ++it)
        removeNodePreservingChildren(it.current());
}

#undef NoFontDelta
#undef MinimumFontSize

void ApplyStyleCommand::applyInlineStyle(CSSMutableStyleDeclarationImpl *style)
{
    // adjust to the positions we want to use for applying style
    Position start(endingSelection().start().downstream(StayInBlock).equivalentRangeCompliantPosition());
    Position end(endingSelection().end().upstream(StayInBlock));

    if (RangeImpl::compareBoundaryPoints(end, start) < 0) {
        Position swap = start;
        start = end;
        end = swap;
    }

    // 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();

    // split the start node and containing element if the selection starts inside of it
    bool splitStart = splitTextElementAtStartIfNeeded(start, end); 
    if (splitStart) {
        start = endingSelection().start();
        end = endingSelection().end();
    }

    // split the end node and containing element if the selection ends inside of it
    bool splitEnd = splitTextElementAtEndIfNeeded(start, end);
    start = endingSelection().start();
    end = endingSelection().end();

    // Remove style from the selection.
    // Use the upstream position of the start for removing style.
    // This will ensure we remove all traces of the relevant styles from the selection
    // and prevent us from adding redundant ones, as described in:
    // <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
    removeInlineStyle(style, start.upstream(StayInBlock), end);
    start = endingSelection().start();
    end = endingSelection().end();

    if (splitStart) {
        bool mergedStart = mergeStartWithPreviousIfIdentical(start, end);
        if (mergedStart) {
            start = endingSelection().start();
            end = endingSelection().end();
        }
    }

    if (splitEnd) {
        mergeEndWithNextIfIdentical(start, end);
        start = endingSelection().start();
        end = endingSelection().end();
    }

    // update document layout once before running the rest of the function
    // so that we avoid the expense of updating before each and every call
    // to check a computed style
    document()->updateLayout();
    
    if (start.node() == end.node()) {
        // simple case...start and end are the same node
        addInlineStyleIfNeeded(style, start.node(), end.node());
    }
    else {
        NodeImpl *node = start.node();
        if (start.offset() >= start.node()->caretMaxOffset())
            node = node->traverseNextNode();
        while (1) {
            if (node->childNodeCount() == 0 && node->renderer() && node->renderer()->isInline()) {
                NodeImpl *runStart = node;
                while (1) {
                    NodeImpl *next = node->traverseNextNode();
                    // Break if node is the end node, or if the next node does not fit in with
                    // the current group.
                    if (node == end.node() || 
                        runStart->parentNode() != next->parentNode() || 
                        (next->isHTMLElement() && next->id() != ID_BR) || 
                        (next->renderer() && !next->renderer()->isInline()))
                        break;
                    node = next;
                }
                // Now apply style to the run we found.
                addInlineStyleIfNeeded(style, runStart, node);
            }
            if (node == end.node())
                break;
            node = node->traverseNextNode();
        }
    }

    if (splitStart || splitEnd) {
        cleanUpEmptyStyleSpans(start, end);
    }
}

//------------------------------------------------------------------------------------------
// ApplyStyleCommand: style-removal helpers

bool ApplyStyleCommand::isHTMLStyleNode(CSSMutableStyleDeclarationImpl *style, HTMLElementImpl *elem)
{
    QValueListConstIterator<CSSProperty> end;
    for (QValueListConstIterator<CSSProperty> it = style->valuesIterator(); it != end; ++it) {
        switch ((*it).id()) {
            case CSS_PROP_FONT_WEIGHT:
                if (elem->id() == ID_B)
                    return true;
                break;
            case CSS_PROP_FONT_STYLE:
                if (elem->id() == ID_I)
                    return true;
        }
    }

    return false;
}

void ApplyStyleCommand::removeHTMLStyleNode(HTMLElementImpl *elem)
{
    // This node can be removed.
    // EDIT FIXME: This does not handle the case where the node
    // has attributes. But how often do people add attributes to <B> tags? 
    // Not so often I think.
    ASSERT(elem);
    removeNodePreservingChildren(elem);
}

void ApplyStyleCommand::removeHTMLFontStyle(CSSMutableStyleDeclarationImpl *style, HTMLElementImpl *elem)
{
    ASSERT(style);
    ASSERT(elem);

    if (elem->id() != ID_FONT)
        return;

    int exceptionCode = 0;
    QValueListConstIterator<CSSProperty> end;
    for (QValueListConstIterator<CSSProperty> it = style->valuesIterator(); it != end; ++it) {
        switch ((*it).id()) {
            case CSS_PROP_COLOR:
                elem->removeAttribute(ATTR_COLOR, exceptionCode);
                ASSERT(exceptionCode == 0);
                break;
            case CSS_PROP_FONT_FAMILY:
                elem->removeAttribute(ATTR_FACE, exceptionCode);
                ASSERT(exceptionCode == 0);
                break;
            case CSS_PROP_FONT_SIZE:
                elem->removeAttribute(ATTR_SIZE, exceptionCode);
                ASSERT(exceptionCode == 0);
                break;
        }
    }

    if (isEmptyFontTag(elem))
        removeNodePreservingChildren(elem);
}

void ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclarationImpl *style, HTMLElementImpl *elem)
{
    ASSERT(style);
    ASSERT(elem);

    CSSMutableStyleDeclarationImpl *decl = elem->inlineStyleDecl();
    if (!decl)
        return;

    QValueListConstIterator<CSSProperty> end;
    for (QValueListConstIterator<CSSProperty> it = style->valuesIterator(); it != end; ++it) {
        int propertyID = (*it).id();
        CSSValueImpl *value = decl->getPropertyCSSValue(propertyID);
        if (value) {
            value->ref();
            removeCSSProperty(decl, propertyID);
            value->deref();
        }
    }

    if (isEmptyStyleSpan(elem))
        removeNodePreservingChildren(elem);
}

void ApplyStyleCommand::removeBlockStyle(CSSMutableStyleDeclarationImpl *style, const Position &start, const Position &end)
{
    ASSERT(start.isNotNull());
    ASSERT(end.isNotNull());
    ASSERT(start.node()->inDocument());
    ASSERT(end.node()->inDocument());
    ASSERT(RangeImpl::compareBoundaryPoints(start, end) <= 0);
    
}

static bool hasTextDecorationProperty(NodeImpl *node)
{
    if (!node->isElementNode())
        return false;

    ElementImpl *element = static_cast<ElementImpl *>(node);
    CSSComputedStyleDeclarationImpl style(element);

    CSSValueImpl *value = style.getPropertyCSSValue(CSS_PROP_TEXT_DECORATION, DoNotUpdateLayout);

    if (value) {
        value->ref();
        DOMString valueText(value->cssText());
        value->deref();
        if (strcasecmp(valueText,"none") != 0)
            return true;
    }

    return false;
}

static NodeImpl* highestAncestorWithTextDecoration(NodeImpl *node)
{
    NodeImpl *result = NULL;

    for (NodeImpl *n = node; n; n = n->parentNode()) {
        if (hasTextDecorationProperty(n))
            result = n;
    }

    return result;
}

CSSMutableStyleDeclarationImpl *ApplyStyleCommand::extractTextDecorationStyle(NodeImpl *node)
{
    ASSERT(node);
    ASSERT(node->isElementNode());
    
    // non-html elements not handled yet
    if (!node->isHTMLElement())
        return 0;

    HTMLElementImpl *element = static_cast<HTMLElementImpl *>(node);
    CSSMutableStyleDeclarationImpl *style = element->inlineStyleDecl();
    if (!style)
        return 0;

    style->ref();
    int properties[1] = { CSS_PROP_TEXT_DECORATION };
    CSSMutableStyleDeclarationImpl *textDecorationStyle = style->copyPropertiesInSet(properties, 1);

    CSSValueImpl *property = style->getPropertyCSSValue(CSS_PROP_TEXT_DECORATION);
    if (property && strcasecmp(property->cssText(), "none") != 0) {
        removeCSSProperty(style, CSS_PROP_TEXT_DECORATION);
    }

    style->deref();

    return textDecorationStyle;
}

CSSMutableStyleDeclarationImpl *ApplyStyleCommand::extractAndNegateTextDecorationStyle(NodeImpl *node)
{
    ASSERT(node);
    ASSERT(node->isElementNode());
    
    // non-html elements not handled yet
    if (!node->isHTMLElement())
        return 0;

    HTMLElementImpl *element = static_cast<HTMLElementImpl *>(node);
    CSSComputedStyleDeclarationImpl *computedStyle = new CSSComputedStyleDeclarationImpl(element);
    ASSERT(computedStyle);

    computedStyle->ref();

    int properties[1] = { CSS_PROP_TEXT_DECORATION };
    CSSMutableStyleDeclarationImpl *textDecorationStyle = computedStyle->copyPropertiesInSet(properties, 1);
    

    CSSValueImpl *property = computedStyle->getPropertyCSSValue(CSS_PROP_TEXT_DECORATION);
    if (property && strcasecmp(property->cssText(), "none") != 0) {
        property->ref();
        CSSMutableStyleDecla

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91色视频在线| 成人性视频免费网站| 中文字幕一区二区三区视频| 在线这里只有精品| 国产盗摄一区二区| 精品在线亚洲视频| 91精品国产综合久久久蜜臀粉嫩 | 精品少妇一区二区三区| 欧美日韩成人综合天天影院| 欧美怡红院视频| 欧美电视剧在线看免费| 91超碰这里只有精品国产| 成人av网址在线| 日本成人中文字幕在线视频| 国产日韩精品一区二区浪潮av | 国产精品123| 日韩制服丝袜先锋影音| 国产精品乱人伦中文| 欧美成人福利视频| 欧美一区永久视频免费观看| 99久久er热在这里只有精品15| 免费亚洲电影在线| 亚洲图片欧美一区| 一区二区三区不卡视频在线观看| 久久精品免视看| 久久久久免费观看| 26uuu亚洲婷婷狠狠天堂| 69精品人人人人| 91精品国产综合久久久久久久久久 | 久久亚洲二区三区| 中文字幕一区在线| 亚洲一区在线观看免费观看电影高清| 亚洲欧美偷拍三级| 视频一区欧美日韩| 成人精品电影在线观看| a亚洲天堂av| 欧美日韩一区高清| 久久久精品2019中文字幕之3| 国产精品久久久久桃色tv| 亚洲国产精品久久不卡毛片| 久久99精品国产麻豆婷婷洗澡| av网站免费线看精品| 欧美色倩网站大全免费| 久久精品视频在线看| 亚洲人成亚洲人成在线观看图片| 亚洲电影视频在线| 国产精品99久久久久久有的能看| 91无套直看片红桃| 欧美一区二区观看视频| 国产精品久久久久久久久久久免费看| 亚洲一区二区三区四区五区黄 | 国产日韩欧美麻豆| 日韩av一区二区三区四区| 粉嫩欧美一区二区三区高清影视| 不卡欧美aaaaa| 国产网站一区二区三区| 国产91精品一区二区麻豆网站 | 成人精品电影在线观看| 日本一二三四高清不卡| 成人做爰69片免费看网站| 欧美日韩电影在线| 五月天丁香久久| 欧美系列日韩一区| 亚洲精品美腿丝袜| 播五月开心婷婷综合| 久久精品亚洲精品国产欧美| 日韩福利视频网| 91精品久久久久久蜜臀| 午夜精品免费在线| 日韩一区二区三区在线| 久久99精品视频| 国产午夜精品一区二区三区嫩草| 国内不卡的二区三区中文字幕| 欧美电影免费观看完整版| 久久不见久久见中文字幕免费| 91精品国产色综合久久不卡蜜臀| 亚洲香肠在线观看| 欧美日韩免费一区二区三区视频| 午夜成人在线视频| 久久老女人爱爱| 99re热这里只有精品视频| 亚洲男女毛片无遮挡| 欧美日韩国产首页在线观看| 久久66热re国产| 亚洲香肠在线观看| 欧美高清视频不卡网| 美国十次综合导航| 国产精品久久久久久久久动漫| 欧美性猛片aaaaaaa做受| 欧美a级一区二区| 中文字幕高清一区| 欧美猛男gaygay网站| 高清在线不卡av| 天天色综合成人网| ...av二区三区久久精品| 欧美一级艳片视频免费观看| 成人精品鲁一区一区二区| 欧美a级一区二区| 中文字幕一区二区三区在线播放 | 色呦呦网站一区| 亚洲欧美中日韩| 欧美精品成人一区二区三区四区| 麻豆中文一区二区| 亚洲免费观看在线观看| 91精品办公室少妇高潮对白| 免费观看一级欧美片| 国产精品视频看| 日韩精品中文字幕一区二区三区| 99精品视频中文字幕| 日韩精品欧美成人高清一区二区| 久久久久国产精品人| 日韩一级成人av| 91丨porny丨最新| 国产91富婆露脸刺激对白| 欧美bbbbb| 免费美女久久99| 天天亚洲美女在线视频| 天堂成人免费av电影一区| 伊人婷婷欧美激情| 亚洲成人一区二区| 亚洲精品少妇30p| 亚洲电影你懂得| 日韩精品午夜视频| 国产精品自在在线| 成人一区二区三区| 97久久精品人人澡人人爽| 国产精品伊人色| 久久精品久久精品| 亚洲国产一二三| 午夜精品一区二区三区免费视频 | 日韩一区二区高清| 欧美剧在线免费观看网站 | 精品国产乱码久久久久久夜甘婷婷 | 色素色在线综合| 国产亲近乱来精品视频 | 精品福利一区二区三区免费视频| 欧美喷水一区二区| 欧美精品1区2区3区| 91精品国产手机| 欧美二区三区91| 欧美日韩精品欧美日韩精品一| 91捆绑美女网站| 欧美色图片你懂的| 日韩免费观看高清完整版| 欧美精品一区二区三区在线播放| 亚洲国产精品黑人久久久| 一区二区三区四区在线免费观看| 亚洲人成小说网站色在线| 污片在线观看一区二区| 久久国产精品99久久人人澡| 国产精品456露脸| 91在线视频免费91| 欧美激情综合在线| 亚洲国产中文字幕在线视频综合| 亚洲国产视频a| 懂色av一区二区三区蜜臀 | 粉嫩绯色av一区二区在线观看| 色网综合在线观看| 欧美主播一区二区三区| 国产亚洲精品福利| 秋霞电影网一区二区| 91丨九色丨蝌蚪丨老版| 欧美不卡一区二区三区四区| 亚洲女子a中天字幕| 国产精品一品二品| 欧美一区二区黄| 亚洲精品成人悠悠色影视| 精品一区二区三区在线观看| 欧美视频自拍偷拍| 一区二区三区精密机械公司| 国产成a人亚洲| 2023国产精品自拍| 青青草91视频| 欧美肥大bbwbbw高潮| 天堂成人免费av电影一区| 欧美系列亚洲系列| 亚洲成在人线在线播放| thepron国产精品| 欧美国产成人在线| caoporm超碰国产精品| 亚洲天堂精品视频| 在线亚洲欧美专区二区| 亚洲免费观看高清完整版在线| 99久久综合国产精品| 一区二区久久久| 国产一区二区三区四区五区入口| 日韩欧美一二三| 国产精品18久久久久久久久| 国产喂奶挤奶一区二区三区| 精品一区二区三区在线观看国产 | 久久精品国产成人一区二区三区| 欧美高清视频一二三区| 亚洲在线视频网站| 日韩欧美的一区二区| 国产成人av在线影院| 国产丝袜在线精品| 91国产福利在线| 亚洲高清视频中文字幕| 欧美一区三区二区| 久久精品国产99|