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

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

Issue 2725933002: Fix LayoutUnit snapping of widths in line breaker (Closed)
Patch Set: Add test cases for m_uncommittedWidth and !m_uncommittedWidth Created 3 years, 10 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 fbddd95d1c184c750de2ab278a50a0cfb7b1fe9a..c96ec9039aa15fa956ee910bdb15c98434a14832 100644
--- a/third_party/WebKit/Source/core/layout/line/LineWidth.h
+++ b/third_party/WebKit/Source/core/layout/line/LineWidth.h
@@ -87,9 +87,15 @@ class LineWidth {
void setTrailingWhitespaceWidth(float width) {
m_trailingWhitespaceWidth = width;
}
- void snapUncommittedWidth() {
- m_uncommittedWidth =
- LayoutUnit::fromFloatCeil(m_uncommittedWidth).toFloat();
+ void snapAtNodeBoundary() {
+ if (!m_uncommittedWidth) {
+ m_committedWidth = LayoutUnit::fromFloatCeil(m_committedWidth).toFloat();
+ } else {
+ m_uncommittedWidth =
+ LayoutUnit::fromFloatCeil(m_committedWidth + m_uncommittedWidth)
+ .toFloat() -
+ m_committedWidth;
+ }
}
IndentTextOrNot indentText() const { return m_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