| 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1124     return m_firstTextBox ? m_firstTextBox->x() : 0; |  1124     return m_firstTextBox ? m_firstTextBox->x() : 0; | 
|  1125 } |  1125 } | 
|  1126  |  1126  | 
|  1127 float RenderText::firstRunY() const |  1127 float RenderText::firstRunY() const | 
|  1128 { |  1128 { | 
|  1129     return m_firstTextBox ? m_firstTextBox->y() : 0; |  1129     return m_firstTextBox ? m_firstTextBox->y() : 0; | 
|  1130 } |  1130 } | 
|  1131      |  1131      | 
|  1132 void RenderText::setSelectionState(SelectionState state) |  1132 void RenderText::setSelectionState(SelectionState state) | 
|  1133 { |  1133 { | 
|  1134     InlineTextBox* box; |  1134     RenderObject::setSelectionState(state); | 
|  1135  |  1135  | 
|  1136     RenderObject::setSelectionState(state); |  1136     if (canUpdateSelectionOnRootLineBoxes()) { | 
|  1137     if (state == SelectionStart || state == SelectionEnd || state == SelectionBo
      th) { |  1137         if (state == SelectionStart || state == SelectionEnd || state == Selecti
      onBoth) { | 
|  1138         int startPos, endPos; |  1138             int startPos, endPos; | 
|  1139         selectionStartEnd(startPos, endPos); |  1139             selectionStartEnd(startPos, endPos); | 
|  1140         if (selectionState() == SelectionStart) { |  1140             if (selectionState() == SelectionStart) { | 
|  1141             endPos = textLength(); |  1141                 endPos = textLength(); | 
|  1142  |  1142  | 
|  1143             // to handle selection from end of text to end of line |  1143                 // to handle selection from end of text to end of line | 
|  1144             if (startPos != 0 && startPos == endPos) |  1144                 if (startPos && startPos == endPos) | 
|  1145                 startPos = endPos - 1; |  1145                     startPos = endPos - 1; | 
|  1146         } else if (selectionState() == SelectionEnd) |  1146             } else if (selectionState() == SelectionEnd) | 
|  1147             startPos = 0; |  1147                 startPos = 0; | 
|  1148  |  1148  | 
|  1149         for (box = firstTextBox(); box; box = box->nextTextBox()) { |  1149             for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBo
      x()) { | 
|  1150             if (box->isSelected(startPos, endPos)) { |  1150                 if (box->isSelected(startPos, endPos)) { | 
|  1151                 RootInlineBox* line = box->root(); |  1151                     RootInlineBox* root = box->root(); | 
|  1152                 if (line) |  1152                     if (root) | 
|  1153                     line->setHasSelectedChildren(true); |  1153                         root->setHasSelectedChildren(true); | 
 |  1154                 } | 
|  1154             } |  1155             } | 
|  1155         } |  1156         } else { | 
|  1156     } else { |  1157             for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBo
      x()) { | 
|  1157         for (box = firstTextBox(); box; box = box->nextTextBox()) { |  1158                 RootInlineBox* root = box->root(); | 
|  1158             RootInlineBox* line = box->root(); |  1159                 if (root) | 
|  1159             if (line) |  1160                     root->setHasSelectedChildren(state == SelectionInside); | 
|  1160                 line->setHasSelectedChildren(state == SelectionInside); |  1161             } | 
|  1161         } |  1162         } | 
|  1162     } |  1163     } | 
|  1163  |  1164  | 
|  1164     // The returned value can be null in case of an orphaned tree. |  1165     // The containing block can be null in case of an orphaned tree. | 
|  1165     if (RenderBlock* cb = containingBlock()) |  1166     RenderBlock* containingBlock = this->containingBlock(); | 
|  1166         cb->setSelectionState(state); |  1167     if (containingBlock && !containingBlock->isRenderView()) | 
 |  1168         containingBlock->setSelectionState(state); | 
|  1167 } |  1169 } | 
|  1168  |  1170  | 
|  1169 void RenderText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset,
       unsigned len, bool force) |  1171 void RenderText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset,
       unsigned len, bool force) | 
|  1170 { |  1172 { | 
|  1171     unsigned oldLen = textLength(); |  1173     unsigned oldLen = textLength(); | 
|  1172     unsigned newLen = text->length(); |  1174     unsigned newLen = text->length(); | 
|  1173     int delta = newLen - oldLen; |  1175     int delta = newLen - oldLen; | 
|  1174     unsigned end = len ? offset + len - 1 : offset; |  1176     unsigned end = len ? offset + len - 1 : offset; | 
|  1175  |  1177  | 
|  1176     RootInlineBox* firstRootBox = 0; |  1178     RootInlineBox* firstRootBox = 0; | 
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1808  |  1810  | 
|  1809     SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); |  1811     SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); | 
|  1810     if (!secureTextTimer) { |  1812     if (!secureTextTimer) { | 
|  1811         secureTextTimer = new SecureTextTimer(this); |  1813         secureTextTimer = new SecureTextTimer(this); | 
|  1812         gSecureTextTimers->add(this, secureTextTimer); |  1814         gSecureTextTimers->add(this, secureTextTimer); | 
|  1813     } |  1815     } | 
|  1814     secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |  1816     secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 
|  1815 } |  1817 } | 
|  1816  |  1818  | 
|  1817 } // namespace WebCore |  1819 } // namespace WebCore | 
| OLD | NEW |