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

Side by Side Diff: Source/core/rendering/RenderBlockFlow.h

Issue 303673007: Don't pixel snap for ellipsis (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fighting with rebaselining with eae... 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are 10 * modification, are permitted provided that the following conditions are
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return max<LayoutUnit>(0, logicalRightOffsetForLine(position, shouldInde ntText, logicalHeight) - logicalLeftOffsetForLine(position, shouldIndentText, lo gicalHeight)); 67 return max<LayoutUnit>(0, logicalRightOffsetForLine(position, shouldInde ntText, logicalHeight) - logicalLeftOffsetForLine(position, shouldIndentText, lo gicalHeight));
68 } 68 }
69 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentT ext, LayoutUnit logicalHeight = 0) const 69 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentT ext, LayoutUnit logicalHeight = 0) const
70 { 70 {
71 return logicalRightOffsetForLine(position, logicalRightOffsetForContent( ), shouldIndentText, logicalHeight); 71 return logicalRightOffsetForLine(position, logicalRightOffsetForContent( ), shouldIndentText, logicalHeight);
72 } 72 }
73 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentTe xt, LayoutUnit logicalHeight = 0) const 73 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentTe xt, LayoutUnit logicalHeight = 0) const
74 { 74 {
75 return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), shouldIndentText, logicalHeight); 75 return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), shouldIndentText, logicalHeight);
76 } 76 }
77 LayoutUnit pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool sh ouldIndentText, LayoutUnit logicalHeight = 0) const
78 {
79 return roundToInt(logicalLeftOffsetForLine(position, shouldIndentText, l ogicalHeight));
80 }
81 LayoutUnit pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool s houldIndentText, LayoutUnit logicalHeight = 0) const
82 {
83 // FIXME: Multicolumn layouts break carrying over subpixel values to the logical right offset because the lines may be shifted
84 // by a subpixel value for all but the first column. This can lead to th e actual pixel snapped width of the column being off
85 // by one pixel when rendered versus layed out, which can result in the line being clipped. For now, we have to floor.
86 // https://bugs.webkit.org/show_bug.cgi?id=105461
87 return floorToInt(logicalRightOffsetForLine(position, shouldIndentText, logicalHeight));
88 }
89 LayoutUnit startOffsetForLine(LayoutUnit position, bool shouldIndentText, La youtUnit logicalHeight = 0) const 77 LayoutUnit startOffsetForLine(LayoutUnit position, bool shouldIndentText, La youtUnit logicalHeight = 0) const
90 { 78 {
91 return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(posi tion, shouldIndentText, logicalHeight) 79 return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(posi tion, shouldIndentText, logicalHeight)
92 : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentT ext, logicalHeight); 80 : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentT ext, logicalHeight);
93 } 81 }
94 LayoutUnit endOffsetForLine(LayoutUnit position, bool shouldIndentText, Layo utUnit logicalHeight = 0) const 82 LayoutUnit endOffsetForLine(LayoutUnit position, bool shouldIndentText, Layo utUnit logicalHeight = 0) const
95 { 83 {
96 return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(pos ition, shouldIndentText, logicalHeight) 84 return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(pos ition, shouldIndentText, logicalHeight)
97 : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentT ext, logicalHeight); 85 : logicalWidth() - logicalRightOffsetForLine(position, shouldIndentT ext, logicalHeight);
98 } 86 }
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 481
494 // END METHODS DEFINED IN RenderBlockLineLayout 482 // END METHODS DEFINED IN RenderBlockLineLayout
495 483
496 }; 484 };
497 485
498 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); 486 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow());
499 487
500 } // namespace WebCore 488 } // namespace WebCore
501 489
502 #endif // RenderBlockFlow_h 490 #endif // RenderBlockFlow_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698