| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "core/layout/BidiRunForLine.h" | 26 #include "core/layout/BidiRunForLine.h" |
| 27 #include "core/layout/LayoutCounter.h" | 27 #include "core/layout/LayoutCounter.h" |
| 28 #include "core/layout/LayoutFlowThread.h" | 28 #include "core/layout/LayoutFlowThread.h" |
| 29 #include "core/layout/LayoutListMarker.h" | 29 #include "core/layout/LayoutListMarker.h" |
| 30 #include "core/layout/LayoutObject.h" | 30 #include "core/layout/LayoutObject.h" |
| 31 #include "core/layout/LayoutRubyRun.h" | 31 #include "core/layout/LayoutRubyRun.h" |
| 32 #include "core/layout/LayoutView.h" | 32 #include "core/layout/LayoutView.h" |
| 33 #include "core/layout/TextRunConstructor.h" | 33 #include "core/layout/TextRunConstructor.h" |
| 34 #include "core/layout/VerticalPositionCache.h" | 34 #include "core/layout/VerticalPositionCache.h" |
| 35 #include "core/layout/api/LineLayoutItem.h" | 35 #include "core/layout/api/LineLayoutItem.h" |
| 36 #include "core/layout/api/SelectionState.h" |
| 36 #include "core/layout/line/BreakingContextInlineHeaders.h" | 37 #include "core/layout/line/BreakingContextInlineHeaders.h" |
| 37 #include "core/layout/line/GlyphOverflow.h" | 38 #include "core/layout/line/GlyphOverflow.h" |
| 38 #include "core/layout/line/LayoutTextInfo.h" | 39 #include "core/layout/line/LayoutTextInfo.h" |
| 39 #include "core/layout/line/LineLayoutState.h" | 40 #include "core/layout/line/LineLayoutState.h" |
| 40 #include "core/layout/line/LineWidth.h" | 41 #include "core/layout/line/LineWidth.h" |
| 41 #include "core/layout/line/TrailingFloatsRootInlineBox.h" | 42 #include "core/layout/line/TrailingFloatsRootInlineBox.h" |
| 42 #include "core/layout/line/WordMeasurement.h" | 43 #include "core/layout/line/WordMeasurement.h" |
| 43 #include "core/layout/svg/line/SVGRootInlineBox.h" | 44 #include "core/layout/svg/line/SVGRootInlineBox.h" |
| 44 #include "platform/fonts/Character.h" | 45 #include "platform/fonts/Character.h" |
| 45 #include "platform/text/BidiResolver.h" | 46 #include "platform/text/BidiResolver.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 if (r->m_object->isText()) | 214 if (r->m_object->isText()) |
| 214 box = createInlineBoxForText(*r, isOnlyRun); | 215 box = createInlineBoxForText(*r, isOnlyRun); |
| 215 else | 216 else |
| 216 box = createInlineBoxForLayoutObject(r->m_object, false, isOnlyRun); | 217 box = createInlineBoxForLayoutObject(r->m_object, false, isOnlyRun); |
| 217 r->m_box = box; | 218 r->m_box = box; |
| 218 | 219 |
| 219 ASSERT(box); | 220 ASSERT(box); |
| 220 if (!box) | 221 if (!box) |
| 221 continue; | 222 continue; |
| 222 | 223 |
| 223 if (!rootHasSelectedChildren && box->layoutObject().selectionState() !=
LayoutObject::SelectionNone) | 224 if (!rootHasSelectedChildren && box->layoutObject().selectionState() !=
SelectionNone) |
| 224 rootHasSelectedChildren = true; | 225 rootHasSelectedChildren = true; |
| 225 | 226 |
| 226 // If we have no parent box yet, or if the run is not simply a sibling, | 227 // If we have no parent box yet, or if the run is not simply a sibling, |
| 227 // then we need to construct inline boxes as necessary to properly enclo
se the | 228 // then we need to construct inline boxes as necessary to properly enclo
se the |
| 228 // run's inline box. Segments can only be siblings at the root level, as | 229 // run's inline box. Segments can only be siblings at the root level, as |
| 229 // they are positioned separately. | 230 // they are positioned separately. |
| 230 if (!parentBox || parentBox->layoutObject() != r->m_object->parent()) { | 231 if (!parentBox || parentBox->layoutObject() != r->m_object->parent()) { |
| 231 // Create new inline boxes all the way back to the appropriate inser
tion point. | 232 // Create new inline boxes all the way back to the appropriate inser
tion point. |
| 232 parentBox = createLineBoxes(r->m_object->parent(), lineInfo, box); | 233 parentBox = createLineBoxes(r->m_object->parent(), lineInfo, box); |
| 233 } else { | 234 } else { |
| (...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 LayoutUnit logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false); | 2034 LayoutUnit logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false); |
| 2034 LayoutUnit availableLogicalWidth = logicalRightOffsetForLine(logicalHeight()
, false) - logicalLeft; | 2035 LayoutUnit availableLogicalWidth = logicalRightOffsetForLine(logicalHeight()
, false) - logicalLeft; |
| 2035 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 2036 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
| 2036 | 2037 |
| 2037 if (!style()->isLeftToRightDirection()) | 2038 if (!style()->isLeftToRightDirection()) |
| 2038 return logicalWidth() - logicalLeft; | 2039 return logicalWidth() - logicalLeft; |
| 2039 return logicalLeft; | 2040 return logicalLeft; |
| 2040 } | 2041 } |
| 2041 | 2042 |
| 2042 } | 2043 } |
| OLD | NEW |