| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // First sanity-check the unoverflowed width of the whole line to see if the
re is sufficient room. | 106 // First sanity-check the unoverflowed width of the whole line to see if the
re is sufficient room. |
| 107 int delta = ltr ? lineBoxEdge - blockEdge : blockEdge - lineBoxEdge; | 107 int delta = ltr ? lineBoxEdge - blockEdge : blockEdge - lineBoxEdge; |
| 108 if (logicalWidth() - delta < ellipsisWidth) | 108 if (logicalWidth() - delta < ellipsisWidth) |
| 109 return false; | 109 return false; |
| 110 | 110 |
| 111 // Next iterate over all the line boxes on the line. If we find a replaced
element that intersects | 111 // Next iterate over all the line boxes on the line. If we find a replaced
element that intersects |
| 112 // then we refuse to accommodate the ellipsis. Otherwise we're ok. | 112 // then we refuse to accommodate the ellipsis. Otherwise we're ok. |
| 113 return InlineFlowBox::canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth); | 113 return InlineFlowBox::canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth); |
| 114 } | 114 } |
| 115 | 115 |
| 116 FloatWillBeLayoutUnit RootInlineBox::placeEllipsis(const AtomicString& ellipsisS
tr, bool ltr, FloatWillBeLayoutUnit blockLeftEdge, FloatWillBeLayoutUnit blockR
ightEdge, FloatWillBeLayoutUnit ellipsisWidth, InlineBox* markupBox) | 116 FloatWillBeLayoutUnit RootInlineBox::placeEllipsis(const AtomicString& ellipsisS
tr, bool ltr, FloatWillBeLayoutUnit blockLeftEdge, FloatWillBeLayoutUnit blockR
ightEdge, FloatWillBeLayoutUnit ellipsisWidth) |
| 117 { | 117 { |
| 118 // Create an ellipsis box. | 118 // Create an ellipsis box. |
| 119 EllipsisBox* ellipsisBox = new EllipsisBox(layoutObject(), ellipsisStr, this
, | 119 EllipsisBox* ellipsisBox = new EllipsisBox(layoutObject(), ellipsisStr, this
, |
| 120 ellipsisWidth - (markupBox ? markupBox->logicalWidth().toFloat() : 0), l
ogicalHeight().toFloat(), | 120 ellipsisWidth, logicalHeight().toFloat(), x(), y(), !prevRootBox(), isHo
rizontal()); |
| 121 x(), y(), !prevRootBox(), isHorizontal(), markupBox); | |
| 122 | 121 |
| 123 if (!gEllipsisBoxMap) | 122 if (!gEllipsisBoxMap) |
| 124 gEllipsisBoxMap = new EllipsisBoxMap(); | 123 gEllipsisBoxMap = new EllipsisBoxMap(); |
| 125 gEllipsisBoxMap->add(this, ellipsisBox); | 124 gEllipsisBoxMap->add(this, ellipsisBox); |
| 126 setHasEllipsisBox(true); | 125 setHasEllipsisBox(true); |
| 127 | 126 |
| 128 // FIXME: Do we need an RTL version of this? | 127 // FIXME: Do we need an RTL version of this? |
| 129 if (ltr && (logicalLeft() + logicalWidth() + ellipsisWidth) <= blockRightEdg
e) { | 128 if (ltr && (logicalLeft() + logicalWidth() + ellipsisWidth) <= blockRightEdg
e) { |
| 130 ellipsisBox->setLogicalLeft(logicalLeft() + logicalWidth()); | 129 ellipsisBox->setLogicalLeft(logicalLeft() + logicalWidth()); |
| 131 return logicalWidth() + ellipsisWidth; | 130 return logicalWidth() + ellipsisWidth; |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 endBox = 0; | 847 endBox = 0; |
| 849 return 0; | 848 return 0; |
| 850 } | 849 } |
| 851 | 850 |
| 852 const char* RootInlineBox::boxName() const | 851 const char* RootInlineBox::boxName() const |
| 853 { | 852 { |
| 854 return "RootInlineBox"; | 853 return "RootInlineBox"; |
| 855 } | 854 } |
| 856 | 855 |
| 857 } // namespace blink | 856 } // namespace blink |
| OLD | NEW |