当前位置: 首页>>代码示例>>C++>>正文


C++ TextControlInnerTextElement::renderBox方法代码示例

本文整理汇总了C++中TextControlInnerTextElement::renderBox方法的典型用法代码示例。如果您正苦于以下问题:C++ TextControlInnerTextElement::renderBox方法的具体用法?C++ TextControlInnerTextElement::renderBox怎么用?C++ TextControlInnerTextElement::renderBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextControlInnerTextElement的用法示例。


在下文中一共展示了TextControlInnerTextElement::renderBox方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: textBlockLogicalWidth

int RenderTextControl::textBlockLogicalWidth() const
{
    TextControlInnerTextElement* innerText = innerTextElement();
    ASSERT(innerText);

    LayoutUnit unitWidth = logicalWidth() - borderAndPaddingLogicalWidth();
    if (innerText->renderer())
        unitWidth -= innerText->renderBox()->paddingStart() + innerText->renderBox()->paddingEnd();

    return unitWidth;
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:11,代码来源:RenderTextControl.cpp

示例2: hitInnerTextElement

void RenderTextControl::hitInnerTextElement(HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset)
{
    TextControlInnerTextElement* innerText = innerTextElement();
    if (!innerText->renderer())
        return;

    LayoutPoint adjustedLocation = accumulatedOffset + location();
    LayoutPoint localPoint = pointInContainer - toLayoutSize(adjustedLocation + innerText->renderBox()->location()) + scrolledContentOffset();
    result.setInnerNode(innerText);
    result.setInnerNonSharedNode(innerText);
    result.setLocalPoint(localPoint);
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:12,代码来源:RenderTextControl.cpp

示例3: computeLogicalHeight

void RenderTextControl::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
{
    TextControlInnerTextElement* innerText = innerTextElement();
    ASSERT(innerText);
    if (RenderBox* innerTextBox = innerText->renderBox()) {
        LayoutUnit nonContentHeight = innerTextBox->verticalBorderAndPaddingExtent() + innerTextBox->verticalMarginExtent();
        logicalHeight = computeControlLogicalHeight(innerTextBox->lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight) + verticalBorderAndPaddingExtent();

        // We are able to have a horizontal scrollbar if the overflow style is scroll, or if its auto and there's no word wrap.
        if ((isHorizontalWritingMode() && (style().overflowX() == OSCROLL ||  (style().overflowX() == OAUTO && innerText->renderer()->style().overflowWrap() == NormalOverflowWrap)))
            || (!isHorizontalWritingMode() && (style().overflowY() == OSCROLL ||  (style().overflowY() == OAUTO && innerText->renderer()->style().overflowWrap() == NormalOverflowWrap))))
            logicalHeight += scrollbarThickness();
    }

    RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:16,代码来源:RenderTextControl.cpp

示例4: setSelectionRange

void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextFieldSelectionDirection direction)
{
    if (!isTextFormControl())
        return;

    end = std::max(end, 0);
    start = std::min(std::max(start, 0), end);

    TextControlInnerTextElement* innerText = innerTextElement();
    bool hasFocus = document().focusedElement() == this;
    if (!hasFocus && innerText) {
        // FIXME: Removing this synchronous layout requires fixing <https://webkit.org/b/128797>
        document().updateLayoutIgnorePendingStylesheets();
        if (RenderElement* rendererTextControl = renderer()) {
            if (rendererTextControl->style().visibility() == HIDDEN || !innerText->renderBox()->height()) {
                cacheSelection(start, end, direction);
                return;
            }
        }
    }

    Position startPosition = positionForIndex(innerText, start);
    Position endPosition;
    if (start == end)
        endPosition = startPosition;
    else {
        if (direction == SelectionHasBackwardDirection) {
            endPosition = startPosition;
            startPosition = positionForIndex(innerText, end);
        } else
            endPosition = positionForIndex(innerText, end);
    }

    if (Frame* frame = document().frame())
        frame->selection().moveWithoutValidationTo(startPosition, endPosition, direction != SelectionHasNoDirection, !hasFocus);
}
开发者ID:clbr,项目名称:webkitfltk,代码行数:36,代码来源:HTMLTextFormControlElement.cpp


注:本文中的TextControlInnerTextElement::renderBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。