void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling)
{
    if (LayoutTextItem layoutItem = LayoutTextItem(this->layoutObject())) {
        if (change != NoChange || needsStyleRecalc())
            layoutItem.setStyle(document().ensureStyleResolver().styleForText(this));
        if (needsStyleRecalc())
            layoutItem.setText(dataImpl());
        clearNeedsStyleRecalc();
    } else if (needsStyleRecalc() || needsWhitespaceLayoutObject()) {
        reattach();
        if (this->layoutObject())
            reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
    }
}
Example #2
0
void Text::recalcTextStyle(StyleRecalcChange change, Text* nextTextSibling)
{
    if (RenderText* renderer = this->renderer()) {
        if (change != NoChange || needsStyleRecalc())
            renderer->setStyle(document().ensureStyleResolver().styleForText(this));
        if (needsStyleRecalc())
            renderer->setText(dataImpl());
        clearNeedsStyleRecalc();
    } else if (needsStyleRecalc() || needsWhitespaceRenderer()) {
        reattach();
        if (this->renderer())
            reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
    }
}