void LayoutTextControl::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle) { LayoutBlockFlow::styleDidChange(diff, oldStyle); Element* innerEditor = innerEditorElement(); if (!innerEditor) return; LayoutBlock* innerEditorLayoutObject = toLayoutBlock(innerEditor->layoutObject()); if (innerEditorLayoutObject) { // 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. innerEditorLayoutObject->mutableStyleRef().setHeight(Length()); innerEditorLayoutObject->mutableStyleRef().setWidth(Length()); innerEditorLayoutObject->setStyle(createInnerEditorStyle(styleRef())); innerEditor->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Control)); } textFormControlElement()->updatePlaceholderVisibility(false); }
void RenderTextControl::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBlockFlow::styleDidChange(diff, oldStyle); Element* innerEditor = innerEditorElement(); if (!innerEditor) return; RenderBlock* innerEditorRenderer = toRenderBlock(innerEditor->renderer()); if (innerEditorRenderer) { // 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. innerEditorRenderer->style()->setHeight(Length()); innerEditorRenderer->style()->setWidth(Length()); innerEditorRenderer->setStyle(createInnerEditorStyle(style())); innerEditor->setNeedsStyleRecalc(SubtreeStyleChange); } textFormControlElement()->updatePlaceholderVisibility(false); }