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

Unified Diff: third_party/WebKit/Source/core/layout/line/LineWidth.h

Issue 1375803002: Snap inline box boundaries to layout units during line breaking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add comment about currentWidth Created 5 years, 3 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 | « third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/line/LineWidth.h
diff --git a/third_party/WebKit/Source/core/layout/line/LineWidth.h b/third_party/WebKit/Source/core/layout/line/LineWidth.h
index 2db3736d6cb6e073958ae4eafd213a5df11e4daf..89fca11d2ef08692111c35649af29490169109e2 100644
--- a/third_party/WebKit/Source/core/layout/line/LineWidth.h
+++ b/third_party/WebKit/Source/core/layout/line/LineWidth.h
@@ -54,7 +54,11 @@ public:
return currentWidth() - (whitespaceTreatment == ExcludeWhitespace ? trailingWhitespaceWidth() : 0) + extra <= (m_availableWidth + LayoutUnit::epsilon());
}
+ // Note that m_uncommittedWidth may not be LayoutUnit-snapped at this point. Because
+ // currentWidth() is used by the code that lays out words in a single LayoutText, it's
+ // expected that offsets will not be snapped until an InlineBox boundary is reached.
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; }
@@ -68,6 +72,7 @@ public:
void applyOverhang(LineLayoutRubyRun, LineLayoutItem startLayoutItem, LineLayoutItem endLayoutItem);
void fitBelowFloats(bool isFirstLine = false);
void setTrailingWhitespaceWidth(float width) { m_trailingWhitespaceWidth = width; }
+ void snapUncommittedWidth() { m_uncommittedWidth = LayoutUnit(m_uncommittedWidth).toFloat(); }
bool shouldIndentText() const { return m_shouldIndentText == IndentText; }
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698