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 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 box->nextTextBox()->setPreviousTextBox(box->prevTextBox()); | 291 box->nextTextBox()->setPreviousTextBox(box->prevTextBox()); |
292 if (box->prevTextBox()) | 292 if (box->prevTextBox()) |
293 box->prevTextBox()->setNextTextBox(box->nextTextBox()); | 293 box->prevTextBox()->setNextTextBox(box->nextTextBox()); |
294 | 294 |
295 checkConsistency(); | 295 checkConsistency(); |
296 } | 296 } |
297 | 297 |
298 void RenderText::deleteTextBoxes() | 298 void RenderText::deleteTextBoxes() |
299 { | 299 { |
300 if (firstTextBox()) { | 300 if (firstTextBox()) { |
301 RenderArena* arena = renderArena(); | |
302 InlineTextBox* next; | 301 InlineTextBox* next; |
303 for (InlineTextBox* curr = firstTextBox(); curr; curr = next) { | 302 for (InlineTextBox* curr = firstTextBox(); curr; curr = next) { |
304 next = curr->nextTextBox(); | 303 next = curr->nextTextBox(); |
305 curr->destroy(arena); | 304 curr->destroy(); |
306 } | 305 } |
307 m_firstTextBox = m_lastTextBox = 0; | 306 m_firstTextBox = m_lastTextBox = 0; |
308 } | 307 } |
309 } | 308 } |
310 | 309 |
311 PassRefPtr<StringImpl> RenderText::originalText() const | 310 PassRefPtr<StringImpl> RenderText::originalText() const |
312 { | 311 { |
313 Node* e = node(); | 312 Node* e = node(); |
314 return (e && e->isTextNode()) ? toText(e)->dataImpl() : 0; | 313 return (e && e->isTextNode()) ? toText(e)->dataImpl() : 0; |
315 } | 314 } |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 deleteTextBoxes(); | 1488 deleteTextBoxes(); |
1490 else if (!m_linesDirty) { | 1489 else if (!m_linesDirty) { |
1491 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) | 1490 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) |
1492 box->dirtyLineBoxes(); | 1491 box->dirtyLineBoxes(); |
1493 } | 1492 } |
1494 m_linesDirty = false; | 1493 m_linesDirty = false; |
1495 } | 1494 } |
1496 | 1495 |
1497 InlineTextBox* RenderText::createTextBox() | 1496 InlineTextBox* RenderText::createTextBox() |
1498 { | 1497 { |
1499 return new (renderArena()) InlineTextBox(this); | 1498 return new InlineTextBox(this); |
1500 } | 1499 } |
1501 | 1500 |
1502 InlineTextBox* RenderText::createInlineTextBox() | 1501 InlineTextBox* RenderText::createInlineTextBox() |
1503 { | 1502 { |
1504 InlineTextBox* textBox = createTextBox(); | 1503 InlineTextBox* textBox = createTextBox(); |
1505 if (!m_firstTextBox) | 1504 if (!m_firstTextBox) |
1506 m_firstTextBox = m_lastTextBox = textBox; | 1505 m_firstTextBox = m_lastTextBox = textBox; |
1507 else { | 1506 else { |
1508 m_lastTextBox->setNextTextBox(textBox); | 1507 m_lastTextBox->setNextTextBox(textBox); |
1509 textBox->setPreviousTextBox(m_lastTextBox); | 1508 textBox->setPreviousTextBox(m_lastTextBox); |
(...skipping 12 matching lines...) Expand all Loading... |
1522 // We want the box to be destroyed. | 1521 // We want the box to be destroyed. |
1523 s->remove(); | 1522 s->remove(); |
1524 if (m_firstTextBox == s) | 1523 if (m_firstTextBox == s) |
1525 m_firstTextBox = s->nextTextBox(); | 1524 m_firstTextBox = s->nextTextBox(); |
1526 else | 1525 else |
1527 s->prevTextBox()->setNextTextBox(s->nextTextBox()); | 1526 s->prevTextBox()->setNextTextBox(s->nextTextBox()); |
1528 if (m_lastTextBox == s) | 1527 if (m_lastTextBox == s) |
1529 m_lastTextBox = s->prevTextBox(); | 1528 m_lastTextBox = s->prevTextBox(); |
1530 else | 1529 else |
1531 s->nextTextBox()->setPreviousTextBox(s->prevTextBox()); | 1530 s->nextTextBox()->setPreviousTextBox(s->prevTextBox()); |
1532 s->destroy(renderArena()); | 1531 s->destroy(); |
1533 return; | 1532 return; |
1534 } | 1533 } |
1535 | 1534 |
1536 m_containsReversedText |= !s->isLeftToRightDirection(); | 1535 m_containsReversedText |= !s->isLeftToRightDirection(); |
1537 } | 1536 } |
1538 | 1537 |
1539 float RenderText::width(unsigned from, unsigned len, float xPos, bool firstLine,
HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) co
nst | 1538 float RenderText::width(unsigned from, unsigned len, float xPos, bool firstLine,
HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) co
nst |
1540 { | 1539 { |
1541 if (from >= textLength()) | 1540 if (from >= textLength()) |
1542 return 0; | 1541 return 0; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 | 1929 |
1931 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); | 1930 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); |
1932 if (!secureTextTimer) { | 1931 if (!secureTextTimer) { |
1933 secureTextTimer = new SecureTextTimer(this); | 1932 secureTextTimer = new SecureTextTimer(this); |
1934 gSecureTextTimers->add(this, secureTextTimer); | 1933 gSecureTextTimers->add(this, secureTextTimer); |
1935 } | 1934 } |
1936 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1935 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
1937 } | 1936 } |
1938 | 1937 |
1939 } // namespace WebCore | 1938 } // namespace WebCore |
OLD | NEW |