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

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

Issue 331303004: Fix selection rect calculation for inline elements with padding (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing 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
« no previous file with comments | « Source/core/rendering/InlineFlowBox.cpp ('k') | Source/core/rendering/RootInlineBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 LayoutUnit selectionTop() const; 66 LayoutUnit selectionTop() const;
67 LayoutUnit selectionBottom() const; 67 LayoutUnit selectionBottom() const;
68 LayoutUnit selectionHeight() const { return max<LayoutUnit>(0, selectionBott om() - selectionTop()); } 68 LayoutUnit selectionHeight() const { return max<LayoutUnit>(0, selectionBott om() - selectionTop()); }
69 69
70 LayoutUnit selectionTopAdjustedForPrecedingBlock() const; 70 LayoutUnit selectionTopAdjustedForPrecedingBlock() const;
71 LayoutUnit selectionHeightAdjustedForPrecedingBlock() const { return max<Lay outUnit>(0, selectionBottom() - selectionTopAdjustedForPrecedingBlock()); } 71 LayoutUnit selectionHeightAdjustedForPrecedingBlock() const { return max<Lay outUnit>(0, selectionBottom() - selectionTopAdjustedForPrecedingBlock()); }
72 72
73 int blockDirectionPointInLine() const; 73 int blockDirectionPointInLine() const;
74 74
75 LayoutUnit alignBoxesInBlockDirection(LayoutUnit heightOfBlock, GlyphOverflo wAndFallbackFontsMap&, VerticalPositionCache&); 75 LayoutUnit alignBoxesInBlockDirection(LayoutUnit heightOfBlock, GlyphOverflo wAndFallbackFontsMap&, VerticalPositionCache&);
76 void setLineTopBottomPositions(LayoutUnit top, LayoutUnit bottom, LayoutUnit topWithLeading, LayoutUnit bottomWithLeading) 76 void setLineTopBottomPositions(LayoutUnit top, LayoutUnit bottom, LayoutUnit topWithLeading, LayoutUnit bottomWithLeading, LayoutUnit selectionBottom = Layo utUnit::min())
77 { 77 {
78 m_lineTop = top; 78 m_lineTop = top;
79 m_lineBottom = bottom; 79 m_lineBottom = bottom;
80 m_lineTopWithLeading = topWithLeading; 80 m_lineTopWithLeading = topWithLeading;
81 m_lineBottomWithLeading = bottomWithLeading; 81 m_lineBottomWithLeading = bottomWithLeading;
82 m_selectionBottom = selectionBottom == LayoutUnit::min() ? bottom : sele ctionBottom;
82 } 83 }
83 84
84 virtual RenderLineBoxList* rendererLineBoxes() const OVERRIDE FINAL; 85 virtual RenderLineBoxList* rendererLineBoxes() const OVERRIDE FINAL;
85 86
86 RenderObject* lineBreakObj() const { return m_lineBreakObj; } 87 RenderObject* lineBreakObj() const { return m_lineBreakObj; }
87 BidiStatus lineBreakBidiStatus() const; 88 BidiStatus lineBreakBidiStatus() const;
88 void setLineBreakInfo(RenderObject*, unsigned breakPos, const BidiStatus&); 89 void setLineBreakInfo(RenderObject*, unsigned breakPos, const BidiStatus&);
89 90
90 unsigned lineBreakPos() const { return m_lineBreakPos; } 91 unsigned lineBreakPos() const { return m_lineBreakPos; }
91 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } 92 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // we can create an InlineIterator beginning just after the end of this line . 207 // we can create an InlineIterator beginning just after the end of this line .
207 RenderObject* m_lineBreakObj; 208 RenderObject* m_lineBreakObj;
208 RefPtr<BidiContext> m_lineBreakContext; 209 RefPtr<BidiContext> m_lineBreakContext;
209 210
210 LayoutUnit m_lineTop; 211 LayoutUnit m_lineTop;
211 LayoutUnit m_lineBottom; 212 LayoutUnit m_lineBottom;
212 213
213 LayoutUnit m_lineTopWithLeading; 214 LayoutUnit m_lineTopWithLeading;
214 LayoutUnit m_lineBottomWithLeading; 215 LayoutUnit m_lineBottomWithLeading;
215 216
217 LayoutUnit m_selectionBottom;
218
216 struct LineFragmentationData { 219 struct LineFragmentationData {
217 WTF_MAKE_NONCOPYABLE(LineFragmentationData); WTF_MAKE_FAST_ALLOCATED; 220 WTF_MAKE_NONCOPYABLE(LineFragmentationData); WTF_MAKE_FAST_ALLOCATED;
218 public: 221 public:
219 LineFragmentationData() 222 LineFragmentationData()
220 : m_paginationStrut(0) 223 : m_paginationStrut(0)
221 , m_paginatedLineWidth(0) 224 , m_paginatedLineWidth(0)
222 , m_isFirstAfterPageBreak(false) 225 , m_isFirstAfterPageBreak(false)
223 { 226 {
224 227
225 } 228 }
226 229
227 LayoutUnit m_paginationStrut; 230 LayoutUnit m_paginationStrut;
228 LayoutUnit m_paginatedLineWidth; 231 LayoutUnit m_paginatedLineWidth;
229 bool m_isFirstAfterPageBreak; 232 bool m_isFirstAfterPageBreak;
230 }; 233 };
231 234
232 OwnPtr<LineFragmentationData> m_fragmentationData; 235 OwnPtr<LineFragmentationData> m_fragmentationData;
233 236
234 // Floats hanging off the line are pushed into this vector during layout. It is only 237 // Floats hanging off the line are pushed into this vector during layout. It is only
235 // good for as long as the line has not been marked dirty. 238 // good for as long as the line has not been marked dirty.
236 OwnPtr<Vector<RenderBox*> > m_floats; 239 OwnPtr<Vector<RenderBox*> > m_floats;
237 }; 240 };
238 241
239 } // namespace WebCore 242 } // namespace WebCore
240 243
241 #endif // RootInlineBox_h 244 #endif // RootInlineBox_h
OLDNEW
« no previous file with comments | « Source/core/rendering/InlineFlowBox.cpp ('k') | Source/core/rendering/RootInlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698