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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 85 |
86 // TODO(dglazkov): The use of updateLayoutIgnorePendingStylesheets needs to
be audited. | 86 // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets n
eeds to be audited. |
87 // see http://crbug.com/590369 for more details. | 87 // see http://crbug.com/590369 for more details. |
88 scope.document().updateLayoutIgnorePendingStylesheets(); | 88 scope.document().updateStyleAndLayoutIgnorePendingStylesheets(); |
89 | 89 |
90 TextIterator it(range.startPosition(), range.endPosition(), behaviorFlags); | 90 TextIterator it(range.startPosition(), range.endPosition(), behaviorFlags); |
91 | 91 |
92 // FIXME: the atEnd() check shouldn't be necessary, workaround for | 92 // FIXME: the atEnd() check shouldn't be necessary, workaround for |
93 // <http://bugs.webkit.org/show_bug.cgi?id=6289>. | 93 // <http://bugs.webkit.org/show_bug.cgi?id=6289>. |
94 if (!start() && !length() && it.atEnd()) | 94 if (!start() && !length() && it.atEnd()) |
95 return EphemeralRange(Position(it.currentContainer(), 0)); | 95 return EphemeralRange(Position(it.currentContainer(), 0)); |
96 | 96 |
97 Position resultStart = Position(&scope.document(), 0); | 97 Position resultStart = Position(&scope.document(), 0); |
98 Position resultEnd = resultStart; | 98 Position resultEnd = resultStart; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 return PlainTextRange(start, end); | 186 return PlainTextRange(start, end); |
187 } | 187 } |
188 | 188 |
189 PlainTextRange PlainTextRange::create(const ContainerNode& scope, const Range& r
ange) | 189 PlainTextRange PlainTextRange::create(const ContainerNode& scope, const Range& r
ange) |
190 { | 190 { |
191 return create(scope, EphemeralRange(&range)); | 191 return create(scope, EphemeralRange(&range)); |
192 } | 192 } |
193 | 193 |
194 } // namespace blink | 194 } // namespace blink |
OLD | NEW |