Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: Source/core/rendering/RenderText.cpp

Issue 622253002: Pass start/length at InlineTextBox construction time. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderText.h ('k') | Source/core/rendering/svg/RenderSVGInlineText.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 { 1429 {
1430 if (fullLayout) 1430 if (fullLayout)
1431 deleteTextBoxes(); 1431 deleteTextBoxes();
1432 else if (!m_linesDirty) { 1432 else if (!m_linesDirty) {
1433 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 1433 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
1434 box->dirtyLineBoxes(); 1434 box->dirtyLineBoxes();
1435 } 1435 }
1436 m_linesDirty = false; 1436 m_linesDirty = false;
1437 } 1437 }
1438 1438
1439 InlineTextBox* RenderText::createTextBox() 1439 InlineTextBox* RenderText::createTextBox(int start, unsigned short length)
1440 { 1440 {
1441 return new InlineTextBox(*this); 1441 return new InlineTextBox(*this, start, length);
1442 } 1442 }
1443 1443
1444 InlineTextBox* RenderText::createInlineTextBox() 1444 InlineTextBox* RenderText::createInlineTextBox(int start, unsigned short length)
1445 { 1445 {
1446 InlineTextBox* textBox = createTextBox(); 1446 InlineTextBox* textBox = createTextBox(start, length);
1447 if (!m_firstTextBox) 1447 if (!m_firstTextBox)
1448 m_firstTextBox = m_lastTextBox = textBox; 1448 m_firstTextBox = m_lastTextBox = textBox;
1449 else { 1449 else {
1450 m_lastTextBox->setNextTextBox(textBox); 1450 m_lastTextBox->setNextTextBox(textBox);
1451 textBox->setPreviousTextBox(m_lastTextBox); 1451 textBox->setPreviousTextBox(m_lastTextBox);
1452 m_lastTextBox = textBox; 1452 m_lastTextBox = textBox;
1453 } 1453 }
1454 textBox->setIsText(true);
1455 return textBox; 1454 return textBox;
1456 } 1455 }
1457 1456
1458 void RenderText::positionLineBox(InlineBox* box) 1457 void RenderText::positionLineBox(InlineBox* box)
1459 { 1458 {
1460 InlineTextBox* s = toInlineTextBox(box); 1459 InlineTextBox* s = toInlineTextBox(box);
1461 1460
1462 // FIXME: should not be needed!!! 1461 // FIXME: should not be needed!!!
1463 if (!s->len()) { 1462 if (!s->len()) {
1464 // We want the box to be destroyed. 1463 // We want the box to be destroyed.
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 } 1861 }
1863 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); 1862 secureTextTimer->restartWithNewText(lastTypedCharacterOffset);
1864 } 1863 }
1865 1864
1866 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() 1865 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox()
1867 { 1866 {
1868 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); 1867 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox);
1869 } 1868 }
1870 1869
1871 } // namespace blink 1870 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderText.h ('k') | Source/core/rendering/svg/RenderSVGInlineText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698