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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 : m_totalOpportunities(0) | 52 : m_totalOpportunities(0) |
53 { } | 53 { } |
54 | 54 |
55 void addRunWithExpansions(BidiRun& run, bool& isAfterExpansion, TextJustify
textJustify) | 55 void addRunWithExpansions(BidiRun& run, bool& isAfterExpansion, TextJustify
textJustify) |
56 { | 56 { |
57 LineLayoutText text = LineLayoutText(run.m_lineLayoutItem); | 57 LineLayoutText text = LineLayoutText(run.m_lineLayoutItem); |
58 unsigned opportunitiesInRun; | 58 unsigned opportunitiesInRun; |
59 if (text.is8Bit()) { | 59 if (text.is8Bit()) { |
60 opportunitiesInRun = Character::expansionOpportunityCount(text.chara
cters8() + run.m_start, | 60 opportunitiesInRun = Character::expansionOpportunityCount(text.chara
cters8() + run.m_start, |
61 run.m_stop - run.m_start, run.m_box->direction(), isAfterExpansi
on, textJustify); | 61 run.m_stop - run.m_start, run.m_box->direction(), isAfterExpansi
on, textJustify); |
| 62 } else if (run.m_lineLayoutItem.isCombineText()) { |
| 63 // Justfication applies to before and after the combined text as if |
| 64 // it is an ideographic character, and is prohibited inside the |
| 65 // combined text. |
| 66 opportunitiesInRun = isAfterExpansion ? 1 : 2; |
| 67 isAfterExpansion = true; |
62 } else { | 68 } else { |
63 opportunitiesInRun = Character::expansionOpportunityCount(text.chara
cters16() + run.m_start, | 69 opportunitiesInRun = Character::expansionOpportunityCount(text.chara
cters16() + run.m_start, |
64 run.m_stop - run.m_start, run.m_box->direction(), isAfterExpansi
on, textJustify); | 70 run.m_stop - run.m_start, run.m_box->direction(), isAfterExpansi
on, textJustify); |
65 } | 71 } |
66 m_runsWithExpansions.append(opportunitiesInRun); | 72 m_runsWithExpansions.append(opportunitiesInRun); |
67 m_totalOpportunities += opportunitiesInRun; | 73 m_totalOpportunities += opportunitiesInRun; |
68 } | 74 } |
69 void removeTrailingExpansion() | 75 void removeTrailingExpansion() |
70 { | 76 { |
71 if (!m_totalOpportunities || !m_runsWithExpansions.last()) | 77 if (!m_totalOpportunities || !m_runsWithExpansions.last()) |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2073 | 2079 |
2074 PaintInvalidationReason LayoutBlockFlow::invalidatePaintIfNeeded(const PaintInva
lidationState& paintInvalidationState) | 2080 PaintInvalidationReason LayoutBlockFlow::invalidatePaintIfNeeded(const PaintInva
lidationState& paintInvalidationState) |
2075 { | 2081 { |
2076 if (containsFloats()) | 2082 if (containsFloats()) |
2077 paintInvalidationState.paintingLayer().setNeedsPaintPhaseFloat(); | 2083 paintInvalidationState.paintingLayer().setNeedsPaintPhaseFloat(); |
2078 | 2084 |
2079 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 2085 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
2080 } | 2086 } |
2081 | 2087 |
2082 } // namespace blink | 2088 } // namespace blink |
OLD | NEW |