| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
| 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
| 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) | 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 m_text = ListMarkerText::text(style()->listStyleType(), m_listItem->valu
e()); | 197 m_text = ListMarkerText::text(style()->listStyleType(), m_listItem->valu
e()); |
| 198 break; | 198 break; |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 LayoutUnit LayoutListMarker::getWidthOfTextWithSuffix() const | 202 LayoutUnit LayoutListMarker::getWidthOfTextWithSuffix() const |
| 203 { | 203 { |
| 204 if (m_text.isEmpty()) | 204 if (m_text.isEmpty()) |
| 205 return LayoutUnit(); | 205 return LayoutUnit(); |
| 206 const Font& font = style()->font(); | 206 const Font& font = style()->font(); |
| 207 LayoutUnit itemWidth = LayoutUnit(font.width(TextRun(m_text))); | 207 LayoutUnit itemWidth = LayoutUnit(font.width(m_text)); |
| 208 // TODO(wkorman): Look into constructing a text run for both text and suffix | 208 // TODO(wkorman): Look into constructing a text run for both text and suffix |
| 209 // and painting them together. | 209 // and painting them together. |
| 210 UChar suffix[2] = { ListMarkerText::suffix(style()->listStyleType(), m_listI
tem->value()), ' ' }; | 210 UChar suffix[2] = { ListMarkerText::suffix(style()->listStyleType(), m_listI
tem->value()), ' ' }; |
| 211 TextRun run = constructTextRun(font, suffix, 2, styleRef(), style()->directi
on()); | 211 TextRun run = constructTextRun(font, suffix, 2, styleRef(), style()->directi
on()); |
| 212 LayoutUnit suffixSpaceWidth = LayoutUnit(font.width(run)); | 212 LayoutUnit suffixSpaceWidth = LayoutUnit(font.width(run)); |
| 213 return itemWidth + suffixSpaceWidth; | 213 return itemWidth + suffixSpaceWidth; |
| 214 } | 214 } |
| 215 | 215 |
| 216 void LayoutListMarker::computePreferredLogicalWidths() | 216 void LayoutListMarker::computePreferredLogicalWidths() |
| 217 { | 217 { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 if (style()) { | 448 if (style()) { |
| 449 // Reuse the current margins. Otherwise resetting the margins to initial
values | 449 // Reuse the current margins. Otherwise resetting the margins to initial
values |
| 450 // would trigger unnecessary layout. | 450 // would trigger unnecessary layout. |
| 451 newStyle->setMarginStart(style()->marginStart()); | 451 newStyle->setMarginStart(style()->marginStart()); |
| 452 newStyle->setMarginEnd(style()->marginRight()); | 452 newStyle->setMarginEnd(style()->marginRight()); |
| 453 } | 453 } |
| 454 setStyle(newStyle.release()); | 454 setStyle(newStyle.release()); |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace blink | 457 } // namespace blink |
| OLD | NEW |