OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 | 164 |
165 InlineBox* nextLeafChild() const; | 165 InlineBox* nextLeafChild() const; |
166 InlineBox* prevLeafChild() const; | 166 InlineBox* prevLeafChild() const; |
167 | 167 |
168 // Helper functions for editing and hit-testing code. | 168 // Helper functions for editing and hit-testing code. |
169 // FIXME: These two functions should be moved to RenderedPosition once the c ode to convert between | 169 // FIXME: These two functions should be moved to RenderedPosition once the c ode to convert between |
170 // Position and inline box, offset pair is moved to RenderedPosition. | 170 // Position and inline box, offset pair is moved to RenderedPosition. |
171 InlineBox* nextLeafChildIgnoringLineBreak() const; | 171 InlineBox* nextLeafChildIgnoringLineBreak() const; |
172 InlineBox* prevLeafChildIgnoringLineBreak() const; | 172 InlineBox* prevLeafChildIgnoringLineBreak() const; |
173 | 173 |
174 LineLayoutItem lineLayoutItem() const { return LineLayoutItem(&m_layoutObjec t); } | 174 LineLayoutItem getLineLayoutItem() const { return LineLayoutItem(&m_layoutOb ject); } |
danakj
2016/02/26 21:02:42
Did you know that this method is shadowed by subcl
pdr.
2016/02/26 21:08:20
I'd like to defer to Elliott (or eae) on this one.
eae
2016/02/26 23:28:41
That's pretty shady, I seem to recall it being for
danakj
2016/02/26 23:30:04
The return type.
LineLayoutItem LineLayoutItem();
| |
175 | 175 |
176 InlineFlowBox* parent() const | 176 InlineFlowBox* parent() const |
177 { | 177 { |
178 ASSERT(!m_hasBadParent); | 178 ASSERT(!m_hasBadParent); |
179 return m_parent; | 179 return m_parent; |
180 } | 180 } |
181 void setParent(InlineFlowBox* par) { m_parent = par; } | 181 void setParent(InlineFlowBox* par) { m_parent = par; } |
182 | 182 |
183 const RootInlineBox& root() const; | 183 const RootInlineBox& root() const; |
184 RootInlineBox& root(); | 184 RootInlineBox& root(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
249 int caretLeftmostOffset() const { return isLeftToRightDirection() ? caretMin Offset() : caretMaxOffset(); } | 249 int caretLeftmostOffset() const { return isLeftToRightDirection() ? caretMin Offset() : caretMaxOffset(); } |
250 int caretRightmostOffset() const { return isLeftToRightDirection() ? caretMa xOffset() : caretMinOffset(); } | 250 int caretRightmostOffset() const { return isLeftToRightDirection() ? caretMa xOffset() : caretMinOffset(); } |
251 | 251 |
252 virtual void clearTruncation() { } | 252 virtual void clearTruncation() { } |
253 | 253 |
254 bool isDirty() const { return m_bitfields.dirty(); } | 254 bool isDirty() const { return m_bitfields.dirty(); } |
255 virtual void markDirty() { m_bitfields.setDirty(true); } | 255 virtual void markDirty() { m_bitfields.setDirty(true); } |
256 | 256 |
257 virtual void dirtyLineBoxes(); | 257 virtual void dirtyLineBoxes(); |
258 | 258 |
259 virtual SelectionState selectionState() const; | 259 virtual SelectionState getSelectionState() const; |
260 | 260 |
261 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid th) const; | 261 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid th) const; |
262 // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system. | 262 // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system. |
263 virtual LayoutUnit placeEllipsisBox(bool ltr, LayoutUnit visibleLeftEdge, La youtUnit visibleRightEdge, LayoutUnit ellipsisWidth, LayoutUnit &truncatedWidth, bool&); | 263 virtual LayoutUnit placeEllipsisBox(bool ltr, LayoutUnit visibleLeftEdge, La youtUnit visibleRightEdge, LayoutUnit ellipsisWidth, LayoutUnit &truncatedWidth, bool&); |
264 | 264 |
265 #if ENABLE(ASSERT) | 265 #if ENABLE(ASSERT) |
266 void setHasBadParent(); | 266 void setHasBadParent(); |
267 #endif | 267 #endif |
268 | 268 |
269 int expansion() const { return m_bitfields.expansion(); } | 269 int expansion() const { return m_bitfields.expansion(); } |
270 | 270 |
271 bool visibleToHitTestRequest(const HitTestRequest& request) const { return l ineLayoutItem().visibleToHitTestRequest(request); } | 271 bool visibleToHitTestRequest(const HitTestRequest& request) const { return g etLineLayoutItem().visibleToHitTestRequest(request); } |
272 | 272 |
273 // Anonymous inline: https://drafts.csswg.org/css2/visuren.html#anonymous | 273 // Anonymous inline: https://drafts.csswg.org/css2/visuren.html#anonymous |
274 bool isAnonymousInline() const { return lineLayoutItem().isText() && lineLay outItem().parent() && lineLayoutItem().parent().isBox(); } | 274 bool isAnonymousInline() const { return getLineLayoutItem().isText() && getL ineLayoutItem().parent() && getLineLayoutItem().parent().isBox(); } |
275 EVerticalAlign verticalAlign() const { return isAnonymousInline() ? Computed Style::initialVerticalAlign() : lineLayoutItem().style(m_bitfields.firstLine())- >verticalAlign(); } | 275 EVerticalAlign verticalAlign() const { return isAnonymousInline() ? Computed Style::initialVerticalAlign() : getLineLayoutItem().style(m_bitfields.firstLine( ))->verticalAlign(); } |
276 | 276 |
277 // Use with caution! The type is not checked! | 277 // Use with caution! The type is not checked! |
278 LineLayoutBoxModel boxModelObject() const | 278 LineLayoutBoxModel boxModelObject() const |
279 { | 279 { |
280 if (!lineLayoutItem().isText()) | 280 if (!getLineLayoutItem().isText()) |
281 return LineLayoutBoxModel(toLayoutBoxModelObject(&m_layoutObject)); | 281 return LineLayoutBoxModel(toLayoutBoxModelObject(&m_layoutObject)); |
282 return LineLayoutBoxModel(nullptr); | 282 return LineLayoutBoxModel(nullptr); |
283 } | 283 } |
284 | 284 |
285 LayoutPoint locationIncludingFlipping() const; | 285 LayoutPoint locationIncludingFlipping() const; |
286 | 286 |
287 // Converts from a rect in the logical space of the InlineBox to one in the physical space | 287 // Converts from a rect in the logical space of the InlineBox to one in the physical space |
288 // of the containing block. The logical space of an InlineBox may be transpo sed for vertical text and | 288 // of the containing block. The logical space of an InlineBox may be transpo sed for vertical text and |
289 // flipped for right-to-left text. | 289 // flipped for right-to-left text. |
290 void logicalRectToPhysicalRect(LayoutRect&) const; | 290 void logicalRectToPhysicalRect(LayoutRect&) const; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 | 454 |
455 } // namespace blink | 455 } // namespace blink |
456 | 456 |
457 #ifndef NDEBUG | 457 #ifndef NDEBUG |
458 // Outside the WebCore namespace for ease of invocation from gdb. | 458 // Outside the WebCore namespace for ease of invocation from gdb. |
459 void showTree(const blink::InlineBox*); | 459 void showTree(const blink::InlineBox*); |
460 void showLineTree(const blink::InlineBox*); | 460 void showLineTree(const blink::InlineBox*); |
461 #endif | 461 #endif |
462 | 462 |
463 #endif // InlineBox_h | 463 #endif // InlineBox_h |
OLD | NEW |