| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 3 * Copyright (C) 2005 Alexey Proskuryakov. | 3 * Copyright (C) 2005 Alexey Proskuryakov. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 size_t docTextPosition = 0; | 75 size_t docTextPosition = 0; |
| 76 bool startRangeFound = false; | 76 bool startRangeFound = false; |
| 77 | 77 |
| 78 Position textRunStartPosition; | 78 Position textRunStartPosition; |
| 79 Position textRunEndPosition; | 79 Position textRunEndPosition; |
| 80 | 80 |
| 81 TextIteratorBehaviorFlags behaviorFlags = TextIteratorEmitsObjectReplacement
Character; | 81 TextIteratorBehaviorFlags behaviorFlags = TextIteratorEmitsObjectReplacement
Character; |
| 82 if (getRangeFor == ForSelection) | 82 if (getRangeFor == ForSelection) |
| 83 behaviorFlags |= TextIteratorEmitsCharactersBetweenAllVisiblePositions; | 83 behaviorFlags |= TextIteratorEmitsCharactersBetweenAllVisiblePositions; |
| 84 auto range = EphemeralRange::rangeOfContents(scope); | 84 auto range = EphemeralRange::rangeOfContents(scope); |
| 85 | |
| 86 // TODO(dglazkov): The use of updateLayoutIgnorePendingStylesheets needs to
be audited. | |
| 87 // see http://crbug.com/590369 for more details. | |
| 88 scope.document().updateLayoutIgnorePendingStylesheets(); | |
| 89 | |
| 90 TextIterator it(range.startPosition(), range.endPosition(), behaviorFlags); | 85 TextIterator it(range.startPosition(), range.endPosition(), behaviorFlags); |
| 91 | 86 |
| 92 // FIXME: the atEnd() check shouldn't be necessary, workaround for | 87 // FIXME: the atEnd() check shouldn't be necessary, workaround for |
| 93 // <http://bugs.webkit.org/show_bug.cgi?id=6289>. | 88 // <http://bugs.webkit.org/show_bug.cgi?id=6289>. |
| 94 if (!start() && !length() && it.atEnd()) | 89 if (!start() && !length() && it.atEnd()) |
| 95 return EphemeralRange(Position(it.currentContainer(), 0)); | 90 return EphemeralRange(Position(it.currentContainer(), 0)); |
| 96 | 91 |
| 97 Position resultStart = Position(&scope.document(), 0); | 92 Position resultStart = Position(&scope.document(), 0); |
| 98 Position resultEnd = resultStart; | 93 Position resultEnd = resultStart; |
| 99 | 94 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 180 |
| 186 return PlainTextRange(start, end); | 181 return PlainTextRange(start, end); |
| 187 } | 182 } |
| 188 | 183 |
| 189 PlainTextRange PlainTextRange::create(const ContainerNode& scope, const Range& r
ange) | 184 PlainTextRange PlainTextRange::create(const ContainerNode& scope, const Range& r
ange) |
| 190 { | 185 { |
| 191 return create(scope, EphemeralRange(&range)); | 186 return create(scope, EphemeralRange(&range)); |
| 192 } | 187 } |
| 193 | 188 |
| 194 } // namespace blink | 189 } // namespace blink |
| OLD | NEW |