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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 fallbackFonts.clear(); | 481 fallbackFonts.clear(); |
482 } | 482 } |
483 } | 483 } |
484 | 484 |
485 if (!measuredWidth) | 485 if (!measuredWidth) |
486 measuredWidth = renderer->width(run->m_start, run->m_stop - run->m_start
, xPos, run->direction(), lineInfo.isFirstLine(), &fallbackFonts, &glyphOverflow
); | 486 measuredWidth = renderer->width(run->m_start, run->m_stop - run->m_start
, xPos, run->direction(), lineInfo.isFirstLine(), &fallbackFonts, &glyphOverflow
); |
487 | 487 |
488 run->m_box->setLogicalWidth(measuredWidth + hyphenWidth); | 488 run->m_box->setLogicalWidth(measuredWidth + hyphenWidth); |
489 if (!fallbackFonts.isEmpty()) { | 489 if (!fallbackFonts.isEmpty()) { |
490 ASSERT(run->m_box->isText()); | 490 ASSERT(run->m_box->isText()); |
491 GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(toInl
ineTextBox(run->m_box), make_pair(Vector<const SimpleFontData*>(), GlyphOverflow
())).iterator; | 491 GlyphOverflowAndFallbackFontsMap::ValueType* it = textBoxDataMap.add(toI
nlineTextBox(run->m_box), make_pair(Vector<const SimpleFontData*>(), GlyphOverfl
ow())).storedValue; |
492 ASSERT(it->value.first.isEmpty()); | 492 ASSERT(it->value.first.isEmpty()); |
493 copyToVector(fallbackFonts, it->value.first); | 493 copyToVector(fallbackFonts, it->value.first); |
494 run->m_box->parent()->clearDescendantsHaveSameLineHeightAndBaseline(); | 494 run->m_box->parent()->clearDescendantsHaveSameLineHeightAndBaseline(); |
495 } | 495 } |
496 if ((glyphOverflow.top || glyphOverflow.bottom || glyphOverflow.left || glyp
hOverflow.right)) { | 496 if ((glyphOverflow.top || glyphOverflow.bottom || glyphOverflow.left || glyp
hOverflow.right)) { |
497 ASSERT(run->m_box->isText()); | 497 ASSERT(run->m_box->isText()); |
498 GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(toInl
ineTextBox(run->m_box), make_pair(Vector<const SimpleFontData*>(), GlyphOverflow
())).iterator; | 498 GlyphOverflowAndFallbackFontsMap::ValueType* it = textBoxDataMap.add(toI
nlineTextBox(run->m_box), make_pair(Vector<const SimpleFontData*>(), GlyphOverfl
ow())).storedValue; |
499 it->value.second = glyphOverflow; | 499 it->value.second = glyphOverflow; |
500 run->m_box->clearKnownToHaveNoOverflow(); | 500 run->m_box->clearKnownToHaveNoOverflow(); |
501 } | 501 } |
502 } | 502 } |
503 | 503 |
504 static inline void computeExpansionForJustifiedText(BidiRun* firstRun, BidiRun*
trailingSpaceRun, Vector<unsigned, 16>& expansionOpportunities, unsigned expansi
onOpportunityCount, float& totalLogicalWidth, float availableLogicalWidth) | 504 static inline void computeExpansionForJustifiedText(BidiRun* firstRun, BidiRun*
trailingSpaceRun, Vector<unsigned, 16>& expansionOpportunities, unsigned expansi
onOpportunityCount, float& totalLogicalWidth, float availableLogicalWidth) |
505 { | 505 { |
506 if (!expansionOpportunityCount || availableLogicalWidth <= totalLogicalWidth
) | 506 if (!expansionOpportunityCount || availableLogicalWidth <= totalLogicalWidth
) |
507 return; | 507 return; |
508 | 508 |
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2037 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false); | 2037 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false); |
2038 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; | 2038 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; |
2039 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 2039 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
2040 | 2040 |
2041 if (!style()->isLeftToRightDirection()) | 2041 if (!style()->isLeftToRightDirection()) |
2042 return logicalWidth() - logicalLeft; | 2042 return logicalWidth() - logicalLeft; |
2043 return logicalLeft; | 2043 return logicalLeft; |
2044 } | 2044 } |
2045 | 2045 |
2046 } | 2046 } |
OLD | NEW |