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

Unified Diff: Source/core/rendering/line/LineWidth.h

Issue 343663004: Floats following inlines break to next line unncessarily (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Convert Tests to Ref Tests 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/line/BreakingContextInlineHeaders.h ('k') | Source/core/rendering/line/LineWidth.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/line/LineWidth.h
diff --git a/Source/core/rendering/line/LineWidth.h b/Source/core/rendering/line/LineWidth.h
index 512320c49f8a7f4cd551b317e0fe0505a9cf8ee2..e2166f28561ee0223856956f8a51318b05f48e2b 100644
--- a/Source/core/rendering/line/LineWidth.h
+++ b/Source/core/rendering/line/LineWidth.h
@@ -47,12 +47,14 @@ public:
bool fitsOnLine() const { return currentWidth() <= (m_availableWidth + LayoutUnit::epsilon()); }
bool fitsOnLine(float extra) const { return currentWidth() + extra <= (m_availableWidth + LayoutUnit::epsilon()); }
+ bool fitsOnLine(float extra, bool excludeWhitespace) const { return currentWidth() - (excludeWhitespace ? trailingWhitespaceWidth() : 0) + extra <= m_availableWidth; }
leviw_travelin_and_unemployed 2014/06/24 20:07:46 I notice you don't include epsilon here like the a
float currentWidth() const { return m_committedWidth + m_uncommittedWidth; }
// FIXME: We should eventually replace these three functions by ones that work on a higher abstraction.
float uncommittedWidth() const { return m_uncommittedWidth; }
float committedWidth() const { return m_committedWidth; }
float availableWidth() const { return m_availableWidth; }
+ float trailingWhitespaceWidth() const { return m_trailingWhitespaceWidth; }
void updateAvailableWidth(LayoutUnit minimumHeight = 0);
void shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject*);
@@ -60,6 +62,7 @@ public:
void commit();
void applyOverhang(RenderRubyRun*, RenderObject* startRenderer, RenderObject* endRenderer);
void fitBelowFloats(bool isFirstLine = false);
+ void setTrailingWhitespaceWidth(float width) { m_trailingWhitespaceWidth = width; }
bool shouldIndentText() const { return m_shouldIndentText == IndentText; }
@@ -72,6 +75,7 @@ private:
float m_uncommittedWidth;
float m_committedWidth;
float m_overhangWidth; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang.
+ float m_trailingWhitespaceWidth;
float m_left;
float m_right;
float m_availableWidth;
« no previous file with comments | « Source/core/rendering/line/BreakingContextInlineHeaders.h ('k') | Source/core/rendering/line/LineWidth.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698