本文整理汇总了C++中TextControlInnerTextElement::renderer方法的典型用法代码示例。如果您正苦于以下问题:C++ TextControlInnerTextElement::renderer方法的具体用法?C++ TextControlInnerTextElement::renderer怎么用?C++ TextControlInnerTextElement::renderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextControlInnerTextElement
的用法示例。
在下文中一共展示了TextControlInnerTextElement::renderer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: styleDidChange
void RenderTextControl::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBlockFlow::styleDidChange(diff, oldStyle);
TextControlInnerTextElement* innerText = innerTextElement();
if (!innerText)
return;
RenderTextControlInnerBlock* innerTextRenderer = innerText->renderer();
if (innerTextRenderer) {
// We may have set the width and the height in the old style in layout().
// Reset them now to avoid getting a spurious layout hint.
innerTextRenderer->style().setHeight(Length());
innerTextRenderer->style().setWidth(Length());
innerTextRenderer->setStyle(createInnerTextStyle(&style()));
}
textFormControlElement().updatePlaceholderVisibility();
}
示例4: valueWithHardLineBreaks
String HTMLTextFormControlElement::valueWithHardLineBreaks() const
{
// FIXME: It's not acceptable to ignore the HardWrap setting when there is no renderer.
// While we have no evidence this has ever been a practical problem, it would be best to fix it some day.
if (!isTextFormControl())
return value();
TextControlInnerTextElement* innerText = innerTextElement();
if (!innerText)
return value();
RenderTextControlInnerBlock* renderer = innerText->renderer();
if (!renderer)
return value();
Node* breakNode;
unsigned breakOffset;
RootInlineBox* line = renderer->firstRootBox();
if (!line)
return value();
getNextSoftBreak(line, breakNode, breakOffset);
StringBuilder result;
for (Node* node = innerText->firstChild(); node; node = NodeTraversal::next(*node, innerText)) {
if (is<HTMLBRElement>(*node))
result.append(newlineCharacter);
else if (is<Text>(*node)) {
String data = downcast<Text>(*node).data();
unsigned length = data.length();
unsigned position = 0;
while (breakNode == node && breakOffset <= length) {
if (breakOffset > position) {
result.append(data, position, breakOffset - position);
position = breakOffset;
result.append(newlineCharacter);
}
getNextSoftBreak(line, breakNode, breakOffset);
}
result.append(data, position, length - position);
}
while (breakNode == node)
getNextSoftBreak(line, breakNode, breakOffset);
}
stripTrailingNewline(result);
return result.toString();
}
示例5: 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);
}
示例6: updateFromElement
void RenderTextControl::updateFromElement()
{
TextControlInnerTextElement* innerText = innerTextElement();
if (innerText && innerText->renderer())
updateUserModifyProperty(textFormControlElement(), &innerText->renderer()->style());
}