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

Unified Diff: Source/core/rendering/RenderBlock.cpp

Issue 260073005: Do not cache the result of RenderStyle::computedLineHeight() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 6 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/rendering/RenderBlock.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index dc0f14ec6ecda468d513c4e42e3024e81d51eee7..ad231810717c6dc5d1c696dfd397f4c5d0d82e81 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -155,7 +155,6 @@ private:
RenderBlock::RenderBlock(ContainerNode* node)
: RenderBox(node)
- , m_lineHeight(-1)
, m_hasMarginBeforeQuirk(false)
, m_hasMarginAfterQuirk(false)
, m_beingDestroyed(false)
@@ -351,7 +350,6 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
textAutosizer->record(this);
propagateStyleToAnonymousChildren(true);
- invalidateLineHeight();
// It's possible for our border/padding to change, but for the overall logical width of the block to
// end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
@@ -3784,16 +3782,8 @@ LayoutUnit RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction,
if (isReplaced() && linePositionMode == PositionOnContainingLine)
return RenderBox::lineHeight(firstLine, direction, linePositionMode);
- if (firstLine && document().styleEngine()->usesFirstLineRules()) {
- RenderStyle* s = style(firstLine);
- if (s != style())
- return s->computedLineHeight();
- }
-
- if (m_lineHeight == -1)
- m_lineHeight = style()->computedLineHeight();
-
- return m_lineHeight;
+ RenderStyle* s = style(firstLine && document().styleEngine()->usesFirstLineRules());
+ return s->computedLineHeight();
}
int RenderBlock::beforeMarginInLineDirection(LineDirectionMode direction) const
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698