本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}