Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1390)

Unified Diff: Source/core/layout/LayoutTextControlSingleLine.cpp

Issue 1025213002: Begin tracking why layout is invalidated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | Source/core/layout/LayoutVideo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTextControlSingleLine.cpp
diff --git a/Source/core/layout/LayoutTextControlSingleLine.cpp b/Source/core/layout/LayoutTextControlSingleLine.cpp
index 619bf77f12a569a26231adc57b7dc92aaab1e78c..b12b0a5cc8d13cdcca86c6c5b035308c45dc3378 100644
--- a/Source/core/layout/LayoutTextControlSingleLine.cpp
+++ b/Source/core/layout/LayoutTextControlSingleLine.cpp
@@ -115,14 +115,14 @@ void LayoutTextControlSingleLine::layout()
// To ensure consistency between layouts, we need to reset any conditionally overriden height.
if (innerEditorRenderer && !innerEditorRenderer->styleRef().logicalHeight().isAuto()) {
innerEditorRenderer->mutableStyleRef().setLogicalHeight(Length(Auto));
- layoutScope.setNeedsLayout(innerEditorRenderer);
+ layoutScope.setNeedsLayout(innerEditorRenderer, LayoutInvalidationReason::TextControlChanged);
HTMLElement* placeholderElement = inputElement()->placeholderElement();
if (LayoutBox* placeholderBox = placeholderElement ? placeholderElement->layoutBox() : 0)
- layoutScope.setNeedsLayout(placeholderBox);
+ layoutScope.setNeedsLayout(placeholderBox, LayoutInvalidationReason::TextControlChanged);
}
if (viewPortRenderer && !viewPortRenderer->styleRef().logicalHeight().isAuto()) {
viewPortRenderer->mutableStyleRef().setLogicalHeight(Length(Auto));
- layoutScope.setNeedsLayout(viewPortRenderer);
+ layoutScope.setNeedsLayout(viewPortRenderer, LayoutInvalidationReason::TextControlChanged);
}
LayoutBlockFlow::layoutBlock(false);
@@ -135,15 +135,15 @@ void LayoutTextControlSingleLine::layout()
LayoutUnit logicalHeightLimit = computeLogicalHeightLimit();
if (innerEditorRenderer && innerEditorRenderer->logicalHeight() > logicalHeightLimit) {
if (desiredLogicalHeight != innerEditorRenderer->logicalHeight())
- layoutScope.setNeedsLayout(this);
+ layoutScope.setNeedsLayout(this, LayoutInvalidationReason::TextControlChanged);
m_desiredInnerEditorLogicalHeight = desiredLogicalHeight;
innerEditorRenderer->mutableStyleRef().setLogicalHeight(Length(desiredLogicalHeight, Fixed));
- layoutScope.setNeedsLayout(innerEditorRenderer);
+ layoutScope.setNeedsLayout(innerEditorRenderer, LayoutInvalidationReason::TextControlChanged);
if (viewPortRenderer) {
viewPortRenderer->mutableStyleRef().setLogicalHeight(Length(desiredLogicalHeight, Fixed));
- layoutScope.setNeedsLayout(viewPortRenderer);
+ layoutScope.setNeedsLayout(viewPortRenderer, LayoutInvalidationReason::TextControlChanged);
}
}
// The container might be taller because of decoration elements.
@@ -152,10 +152,10 @@ void LayoutTextControlSingleLine::layout()
LayoutUnit containerLogicalHeight = containerRenderer->logicalHeight();
if (containerLogicalHeight > logicalHeightLimit) {
containerRenderer->mutableStyleRef().setLogicalHeight(Length(logicalHeightLimit, Fixed));
- layoutScope.setNeedsLayout(this);
+ layoutScope.setNeedsLayout(this, LayoutInvalidationReason::TextControlChanged);
} else if (containerRenderer->logicalHeight() < contentLogicalHeight()) {
containerRenderer->mutableStyleRef().setLogicalHeight(Length(contentLogicalHeight(), Fixed));
- layoutScope.setNeedsLayout(this);
+ layoutScope.setNeedsLayout(this, LayoutInvalidationReason::TextControlChanged);
} else {
containerRenderer->mutableStyleRef().setLogicalHeight(Length(containerLogicalHeight, Fixed));
}
@@ -164,7 +164,7 @@ void LayoutTextControlSingleLine::layout()
// We ensure that the inner editor renderer is laid out at least once. This is
// required as the logic below assumes that we don't carry over previous layout values.
if (innerEditorRenderer && !innerEditorRendererHadLayout)
- layoutScope.setNeedsLayout(innerEditorRenderer);
+ layoutScope.setNeedsLayout(innerEditorRenderer, LayoutInvalidationReason::TextControlChanged);
// If we need another layout pass, we have changed one of children's height so we need to relayout them.
if (needsLayout())
@@ -246,7 +246,7 @@ void LayoutTextControlSingleLine::styleDidChange(StyleDifference diff, const Com
}
LayoutObject* innerEditorRenderer = innerEditorElement()->layoutObject();
if (innerEditorRenderer && diff.needsFullLayout())
- innerEditorRenderer->setNeedsLayoutAndFullPaintInvalidation();
+ innerEditorRenderer->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::StyleChange);
if (HTMLElement* placeholder = inputElement()->placeholderElement())
placeholder->setInlineStyleProperty(CSSPropertyTextOverflow, textShouldBeTruncated() ? CSSValueEllipsis : CSSValueClip);
setHasOverflowClip(false);
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | Source/core/layout/LayoutVideo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698