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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 continue; // Positioned objects are only participating to figure out
their | 673 continue; // Positioned objects are only participating to figure out
their |
674 // correct static x position. They have no effect on the
width. | 674 // correct static x position. They have no effect on the
width. |
675 // Similarly, line break boxes have no effect on the width
. | 675 // Similarly, line break boxes have no effect on the width
. |
676 if (r->m_object->isText()) { | 676 if (r->m_object->isText()) { |
677 RenderText* rt = toRenderText(r->m_object); | 677 RenderText* rt = toRenderText(r->m_object); |
678 if (textAlign == JUSTIFY && r != trailingSpaceRun && textJustify !=
TextJustifyNone) { | 678 if (textAlign == JUSTIFY && r != trailingSpaceRun && textJustify !=
TextJustifyNone) { |
679 if (!isAfterExpansion) | 679 if (!isAfterExpansion) |
680 toInlineTextBox(r->m_box)->setCanHaveLeadingExpansion(true); | 680 toInlineTextBox(r->m_box)->setCanHaveLeadingExpansion(true); |
681 unsigned opportunitiesInRun; | 681 unsigned opportunitiesInRun; |
682 if (rt->is8Bit()) | 682 if (rt->is8Bit()) |
683 opportunitiesInRun = Font::expansionOpportunityCount(rt->cha
racters8() + r->m_start, r->m_stop - r->m_start, r->m_box->direction(), isAfterE
xpansion, (textJustify == TextJustifyDistribute)); | 683 opportunitiesInRun = Font::expansionOpportunityCount(rt->cha
racters8() + r->m_start, r->m_stop - r->m_start, r->m_box->direction(), isAfterE
xpansion); |
684 else | 684 else |
685 opportunitiesInRun = Font::expansionOpportunityCount(rt->cha
racters16() + r->m_start, r->m_stop - r->m_start, r->m_box->direction(), isAfter
Expansion, (textJustify == TextJustifyDistribute)); | 685 opportunitiesInRun = Font::expansionOpportunityCount(rt->cha
racters16() + r->m_start, r->m_stop - r->m_start, r->m_box->direction(), isAfter
Expansion); |
686 expansionOpportunities.append(opportunitiesInRun); | 686 expansionOpportunities.append(opportunitiesInRun); |
687 expansionOpportunityCount += opportunitiesInRun; | 687 expansionOpportunityCount += opportunitiesInRun; |
688 } | 688 } |
689 | 689 |
690 if (int length = rt->textLength()) { | 690 if (int length = rt->textLength()) { |
691 if (!r->m_start && needsWordSpacing && isSpaceOrNewline(rt->char
acterAt(r->m_start))) | 691 if (!r->m_start && needsWordSpacing && isSpaceOrNewline(rt->char
acterAt(r->m_start))) |
692 totalLogicalWidth += rt->style(lineInfo.isFirstLine())->font
().wordSpacing(); | 692 totalLogicalWidth += rt->style(lineInfo.isFirstLine())->font
().wordSpacing(); |
693 needsWordSpacing = !isSpaceOrNewline(rt->characterAt(r->m_stop -
1)) && r->m_stop == length; | 693 needsWordSpacing = !isSpaceOrNewline(rt->characterAt(r->m_stop -
1)) && r->m_stop == length; |
694 } | 694 } |
695 | 695 |
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); | 2076 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); |
2077 | 2077 |
2078 setLineGridBox(lineGridBox); | 2078 setLineGridBox(lineGridBox); |
2079 | 2079 |
2080 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying | 2080 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying |
2081 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping | 2081 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping |
2082 // to this grid. | 2082 // to this grid. |
2083 } | 2083 } |
2084 | 2084 |
2085 } | 2085 } |
OLD | NEW |