| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 LayoutUnit hyphenWidth = 0; | 357 LayoutUnit hyphenWidth = 0; |
| 358 if (toInlineTextBox(run->m_box)->hasHyphen()) { | 358 if (toInlineTextBox(run->m_box)->hasHyphen()) { |
| 359 const Font& font = renderer->style(lineInfo.isFirstLine())->font(); | 359 const Font& font = renderer->style(lineInfo.isFirstLine())->font(); |
| 360 hyphenWidth = measureHyphenWidth(renderer, font, run->direction()); | 360 hyphenWidth = measureHyphenWidth(renderer, font, run->direction()); |
| 361 } | 361 } |
| 362 float measuredWidth = 0; | 362 float measuredWidth = 0; |
| 363 | 363 |
| 364 bool kerningIsEnabled = font.fontDescription().typesettingFeatures() & Kerni
ng; | 364 bool kerningIsEnabled = font.fontDescription().typesettingFeatures() & Kerni
ng; |
| 365 | 365 |
| 366 #if OS(MACOSX) | |
| 367 // FIXME: Having any font feature settings enabled can lead to selection gap
s on | |
| 368 // Chromium-mac. https://bugs.webkit.org/show_bug.cgi?id=113418 | |
| 369 bool canUseSimpleFontCodePath = renderer->canUseSimpleFontCodePath() && !fon
t.fontDescription().featureSettings(); | |
| 370 #else | |
| 371 bool canUseSimpleFontCodePath = renderer->canUseSimpleFontCodePath(); | 366 bool canUseSimpleFontCodePath = renderer->canUseSimpleFontCodePath(); |
| 372 #endif | |
| 373 | 367 |
| 374 // Since we don't cache glyph overflows, we need to re-measure the run if | 368 // Since we don't cache glyph overflows, we need to re-measure the run if |
| 375 // the style is linebox-contain: glyph. | 369 // the style is linebox-contain: glyph. |
| 376 | 370 |
| 377 if (!lineBox->fitsToGlyphs() && canUseSimpleFontCodePath) { | 371 if (!lineBox->fitsToGlyphs() && canUseSimpleFontCodePath) { |
| 378 int lastEndOffset = run->m_start; | 372 int lastEndOffset = run->m_start; |
| 379 for (size_t i = 0, size = wordMeasurements.size(); i < size && lastEndOf
fset < run->m_stop; ++i) { | 373 for (size_t i = 0, size = wordMeasurements.size(); i < size && lastEndOf
fset < run->m_stop; ++i) { |
| 380 const WordMeasurement& wordMeasurement = wordMeasurements[i]; | 374 const WordMeasurement& wordMeasurement = wordMeasurements[i]; |
| 381 if (wordMeasurement.width <=0 || wordMeasurement.startOffset == word
Measurement.endOffset) | 375 if (wordMeasurement.width <=0 || wordMeasurement.startOffset == word
Measurement.endOffset) |
| 382 continue; | 376 continue; |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); | 1590 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); |
| 1597 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; | 1591 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; |
| 1598 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 1592 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
| 1599 | 1593 |
| 1600 if (!style()->isLeftToRightDirection()) | 1594 if (!style()->isLeftToRightDirection()) |
| 1601 return logicalWidth() - logicalLeft; | 1595 return logicalWidth() - logicalLeft; |
| 1602 return logicalLeft; | 1596 return logicalLeft; |
| 1603 } | 1597 } |
| 1604 | 1598 |
| 1605 } | 1599 } |
| OLD | NEW |