| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 * | 18 * |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #ifndef InlineBox_h | 21 #ifndef InlineBox_h |
| 22 #define InlineBox_h | 22 #define InlineBox_h |
| 23 | 23 |
| 24 #include "core/layout/LayoutBoxModelObject.h" | 24 #include "core/layout/LayoutBoxModelObject.h" |
| 25 #include "core/layout/LayoutObject.h" | 25 #include "core/layout/LayoutObject.h" |
| 26 #include "core/layout/api/LineLayoutBoxModel.h" |
| 26 #include "core/layout/api/LineLayoutItem.h" | 27 #include "core/layout/api/LineLayoutItem.h" |
| 27 #include "core/layout/api/SelectionState.h" | 28 #include "core/layout/api/SelectionState.h" |
| 28 #include "platform/graphics/paint/DisplayItemClient.h" | 29 #include "platform/graphics/paint/DisplayItemClient.h" |
| 29 #include "platform/text/TextDirection.h" | 30 #include "platform/text/TextDirection.h" |
| 30 | 31 |
| 31 namespace blink { | 32 namespace blink { |
| 32 | 33 |
| 33 class HitTestRequest; | 34 class HitTestRequest; |
| 34 class HitTestResult; | 35 class HitTestResult; |
| 35 class RootInlineBox; | 36 class RootInlineBox; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 161 |
| 161 InlineBox* nextLeafChild() const; | 162 InlineBox* nextLeafChild() const; |
| 162 InlineBox* prevLeafChild() const; | 163 InlineBox* prevLeafChild() const; |
| 163 | 164 |
| 164 // Helper functions for editing and hit-testing code. | 165 // Helper functions for editing and hit-testing code. |
| 165 // FIXME: These two functions should be moved to RenderedPosition once the c
ode to convert between | 166 // FIXME: These two functions should be moved to RenderedPosition once the c
ode to convert between |
| 166 // Position and inline box, offset pair is moved to RenderedPosition. | 167 // Position and inline box, offset pair is moved to RenderedPosition. |
| 167 InlineBox* nextLeafChildIgnoringLineBreak() const; | 168 InlineBox* nextLeafChildIgnoringLineBreak() const; |
| 168 InlineBox* prevLeafChildIgnoringLineBreak() const; | 169 InlineBox* prevLeafChildIgnoringLineBreak() const; |
| 169 | 170 |
| 170 // TODO(pilgrim) convert all callers to lineLayoutItem, replace m_layoutObje
ct with m_lineLayoutItem, remove layoutObject() | 171 // TODO(pilgrim): This will be removed as part of the Line Layout API refact
oring crbug.com/499321 |
| 171 LayoutObject& layoutObject() const { return m_layoutObject; } | 172 LayoutObject& layoutObject() const { return m_layoutObject; } |
| 172 LineLayoutItem lineLayoutItem() const { return LineLayoutItem(&m_layoutObjec
t); } | 173 LineLayoutItem lineLayoutItem() const { return LineLayoutItem(&m_layoutObjec
t); } |
| 173 | 174 |
| 174 InlineFlowBox* parent() const | 175 InlineFlowBox* parent() const |
| 175 { | 176 { |
| 176 ASSERT(!m_hasBadParent); | 177 ASSERT(!m_hasBadParent); |
| 177 return m_parent; | 178 return m_parent; |
| 178 } | 179 } |
| 179 void setParent(InlineFlowBox* par) { m_parent = par; } | 180 void setParent(InlineFlowBox* par) { m_parent = par; } |
| 180 | 181 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 #if ENABLE(ASSERT) | 264 #if ENABLE(ASSERT) |
| 264 void setHasBadParent(); | 265 void setHasBadParent(); |
| 265 #endif | 266 #endif |
| 266 | 267 |
| 267 int expansion() const { return m_bitfields.expansion(); } | 268 int expansion() const { return m_bitfields.expansion(); } |
| 268 | 269 |
| 269 bool visibleToHitTestRequest(const HitTestRequest& request) const { return l
ineLayoutItem().visibleToHitTestRequest(request); } | 270 bool visibleToHitTestRequest(const HitTestRequest& request) const { return l
ineLayoutItem().visibleToHitTestRequest(request); } |
| 270 | 271 |
| 271 EVerticalAlign verticalAlign() const { return lineLayoutItem().isText() ? Co
mputedStyle::initialVerticalAlign() : lineLayoutItem().style(m_bitfields.firstLi
ne())->verticalAlign(); } | 272 EVerticalAlign verticalAlign() const { return lineLayoutItem().isText() ? Co
mputedStyle::initialVerticalAlign() : lineLayoutItem().style(m_bitfields.firstLi
ne())->verticalAlign(); } |
| 272 | 273 |
| 273 // Use with caution! The type is not checked! | 274 // TODO(pilgrim) remove this |
| 274 LayoutBoxModelObject* boxModelObject() const | 275 LayoutBoxModelObject* deprecatedBoxModelObject() const |
| 275 { | 276 { |
| 276 if (!lineLayoutItem().isText()) | 277 if (!lineLayoutItem().isText()) |
| 277 return toLayoutBoxModelObject(&layoutObject()); | 278 return toLayoutBoxModelObject(&layoutObject()); |
| 278 return 0; | 279 return 0; |
| 279 } | 280 } |
| 280 | 281 |
| 282 // Use with caution! The type is not checked! |
| 283 LineLayoutBoxModel boxModelObject() const |
| 284 { |
| 285 if (!lineLayoutItem().isText()) |
| 286 return LineLayoutBoxModel(toLayoutBoxModelObject(&layoutObject())); |
| 287 return LineLayoutBoxModel(nullptr); |
| 288 } |
| 289 |
| 281 LayoutPoint locationIncludingFlipping(); | 290 LayoutPoint locationIncludingFlipping(); |
| 282 | 291 |
| 283 // Converts from a rect in the logical space of the InlineBox to one in the
physical space | 292 // Converts from a rect in the logical space of the InlineBox to one in the
physical space |
| 284 // of the containing block. The logical space of an InlineBox may be transpo
sed for vertical text and | 293 // of the containing block. The logical space of an InlineBox may be transpo
sed for vertical text and |
| 285 // flipped for right-to-left text. | 294 // flipped for right-to-left text. |
| 286 void logicalRectToPhysicalRect(LayoutRect&); | 295 void logicalRectToPhysicalRect(LayoutRect&); |
| 287 | 296 |
| 288 void flipForWritingMode(FloatRect&); | 297 void flipForWritingMode(FloatRect&); |
| 289 FloatPoint flipForWritingMode(const FloatPoint&); | 298 FloatPoint flipForWritingMode(const FloatPoint&); |
| 290 void flipForWritingMode(LayoutRect&); | 299 void flipForWritingMode(LayoutRect&); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 448 |
| 440 } // namespace blink | 449 } // namespace blink |
| 441 | 450 |
| 442 #ifndef NDEBUG | 451 #ifndef NDEBUG |
| 443 // Outside the WebCore namespace for ease of invocation from gdb. | 452 // Outside the WebCore namespace for ease of invocation from gdb. |
| 444 void showTree(const blink::InlineBox*); | 453 void showTree(const blink::InlineBox*); |
| 445 void showLineTree(const blink::InlineBox*); | 454 void showLineTree(const blink::InlineBox*); |
| 446 #endif | 455 #endif |
| 447 | 456 |
| 448 #endif // InlineBox_h | 457 #endif // InlineBox_h |
| OLD | NEW |