| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } | 283 } |
| 284 | 284 |
| 285 template <typename Strategy> | 285 template <typename Strategy> |
| 286 void VisibleSelectionTemplate<Strategy>::appendTrailingWhitespace() | 286 void VisibleSelectionTemplate<Strategy>::appendTrailingWhitespace() |
| 287 { | 287 { |
| 288 DCHECK_EQ(m_granularity, WordGranularity); | 288 DCHECK_EQ(m_granularity, WordGranularity); |
| 289 const EphemeralRangeTemplate<Strategy> searchRange = makeSearchRange(end()); | 289 const EphemeralRangeTemplate<Strategy> searchRange = makeSearchRange(end()); |
| 290 if (searchRange.isNull()) | 290 if (searchRange.isNull()) |
| 291 return; | 291 return; |
| 292 | 292 |
| 293 // TODO(dglazkov): The use of updateLayoutIgnorePendingStylesheets needs to
be audited. |
| 294 // see http://crbug.com/590369 for more details. |
| 295 searchRange.startPosition().document()->updateLayoutIgnorePendingStylesheets
(); |
| 296 |
| 293 CharacterIteratorAlgorithm<Strategy> charIt(searchRange.startPosition(), sea
rchRange.endPosition(), TextIteratorEmitsCharactersBetweenAllVisiblePositions); | 297 CharacterIteratorAlgorithm<Strategy> charIt(searchRange.startPosition(), sea
rchRange.endPosition(), TextIteratorEmitsCharactersBetweenAllVisiblePositions); |
| 294 bool changed = false; | 298 bool changed = false; |
| 295 | 299 |
| 296 for (; charIt.length(); charIt.advance(1)) { | 300 for (; charIt.length(); charIt.advance(1)) { |
| 297 UChar c = charIt.characterAt(0); | 301 UChar c = charIt.characterAt(0); |
| 298 if ((!isSpaceOrNewline(c) && c != noBreakSpaceCharacter) || c == '\n') | 302 if ((!isSpaceOrNewline(c) && c != noBreakSpaceCharacter) || c == '\n') |
| 299 break; | 303 break; |
| 300 m_end = charIt.endPosition(); | 304 m_end = charIt.endPosition(); |
| 301 changed = true; | 305 changed = true; |
| 302 } | 306 } |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 { | 971 { |
| 968 sel.showTreeForThis(); | 972 sel.showTreeForThis(); |
| 969 } | 973 } |
| 970 | 974 |
| 971 void showTree(const blink::VisibleSelectionInFlatTree* sel) | 975 void showTree(const blink::VisibleSelectionInFlatTree* sel) |
| 972 { | 976 { |
| 973 if (sel) | 977 if (sel) |
| 974 sel->showTreeForThis(); | 978 sel->showTreeForThis(); |
| 975 } | 979 } |
| 976 #endif | 980 #endif |
| OLD | NEW |