OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 }; | 67 }; |
68 | 68 |
69 COMPILE_ASSERT(sizeof(InlineTextBox) == sizeof(SameSizeAsInlineTextBox), InlineT
extBox_should_stay_small); | 69 COMPILE_ASSERT(sizeof(InlineTextBox) == sizeof(SameSizeAsInlineTextBox), InlineT
extBox_should_stay_small); |
70 | 70 |
71 typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap; | 71 typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap; |
72 static InlineTextBoxOverflowMap* gTextBoxesWithOverflow; | 72 static InlineTextBoxOverflowMap* gTextBoxesWithOverflow; |
73 | 73 |
74 typedef WTF::HashMap<const InlineTextBox*, TextBlobPtr> InlineTextBoxBlobCacheMa
p; | 74 typedef WTF::HashMap<const InlineTextBox*, TextBlobPtr> InlineTextBoxBlobCacheMa
p; |
75 static InlineTextBoxBlobCacheMap* gTextBlobCache; | 75 static InlineTextBoxBlobCacheMap* gTextBlobCache; |
76 | 76 |
| 77 static void removeFromTextBlobCache(InlineTextBox* textBox) |
| 78 { |
| 79 if (gTextBlobCache) |
| 80 gTextBlobCache->remove(textBox); |
| 81 } |
| 82 |
77 static const int misspellingLineThickness = 3; | 83 static const int misspellingLineThickness = 3; |
78 | 84 |
79 void InlineTextBox::destroy() | 85 void InlineTextBox::destroy() |
80 { | 86 { |
81 AbstractInlineTextBox::willDestroy(this); | 87 AbstractInlineTextBox::willDestroy(this); |
82 | 88 |
83 if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow) | 89 if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow) |
84 gTextBoxesWithOverflow->remove(this); | 90 gTextBoxesWithOverflow->remove(this); |
85 if (gTextBlobCache) | 91 removeFromTextBlobCache(this); |
86 gTextBlobCache->remove(this); | |
87 InlineBox::destroy(); | 92 InlineBox::destroy(); |
88 } | 93 } |
89 | 94 |
| 95 void InlineTextBox::offsetRun(int delta) |
| 96 { |
| 97 ASSERT(!isDirty()); |
| 98 removeFromTextBlobCache(this); |
| 99 m_start += delta; |
| 100 } |
| 101 |
90 void InlineTextBox::markDirty() | 102 void InlineTextBox::markDirty() |
91 { | 103 { |
92 // FIXME: Is it actually possible to try and paint a dirty InlineTextBox? | 104 // FIXME: Is it actually possible to try and paint a dirty InlineTextBox? |
93 if (gTextBlobCache) | 105 removeFromTextBlobCache(this); |
94 gTextBlobCache->remove(this); | |
95 | 106 |
96 m_len = 0; | 107 m_len = 0; |
97 m_start = 0; | 108 m_start = 0; |
98 InlineBox::markDirty(); | 109 InlineBox::markDirty(); |
99 } | 110 } |
100 | 111 |
101 LayoutRect InlineTextBox::logicalOverflowRect() const | 112 LayoutRect InlineTextBox::logicalOverflowRect() const |
102 { | 113 { |
103 if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) | 114 if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) |
104 return enclosingIntRect(logicalFrameRect()); | 115 return enclosingIntRect(logicalFrameRect()); |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); | 1325 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); |
1315 const int rendererCharacterOffset = 24; | 1326 const int rendererCharacterOffset = 24; |
1316 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) | 1327 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) |
1317 fputc(' ', stderr); | 1328 fputc(' ', stderr); |
1318 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); | 1329 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d
ata()); |
1319 } | 1330 } |
1320 | 1331 |
1321 #endif | 1332 #endif |
1322 | 1333 |
1323 } // namespace blink | 1334 } // namespace blink |
OLD | NEW |