OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1020 } | 1020 } |
1021 | 1021 |
1022 PassRefPtrWillBeRawPtr<Range> Internals::rangeFromLocationAndLength(Element* sco pe, int rangeLocation, int rangeLength) | 1022 PassRefPtrWillBeRawPtr<Range> Internals::rangeFromLocationAndLength(Element* sco pe, int rangeLocation, int rangeLength) |
1023 { | 1023 { |
1024 ASSERT(scope); | 1024 ASSERT(scope); |
1025 | 1025 |
1026 // TextIterator depends on Layout information, make sure layout it up to dat e. | 1026 // TextIterator depends on Layout information, make sure layout it up to dat e. |
1027 scope->document().updateLayoutIgnorePendingStylesheets(); | 1027 scope->document().updateLayoutIgnorePendingStylesheets(); |
1028 | 1028 |
1029 const EphemeralRange range = PlainTextRange(rangeLocation, rangeLocation + r angeLength).createRange(*scope); | 1029 const EphemeralRange range = PlainTextRange(rangeLocation, rangeLocation + r angeLength).createRange(*scope); |
1030 if (range.isNull()) | 1030 if (range.isNull()) |
tkent
2015/08/24 09:38:05
We can remove these two lines.
yosin_UTC9
2015/08/24 13:19:22
Done
| |
1031 return nullptr; | 1031 return nullptr; |
1032 return Range::create(range.document(), range.startPosition(), range.endPosit ion()); | 1032 return createRange(range); |
1033 } | 1033 } |
1034 | 1034 |
1035 unsigned Internals::locationFromRange(Element* scope, const Range* range) | 1035 unsigned Internals::locationFromRange(Element* scope, const Range* range) |
1036 { | 1036 { |
1037 ASSERT(scope && range); | 1037 ASSERT(scope && range); |
1038 // PlainTextRange depends on Layout information, make sure layout it up to d ate. | 1038 // PlainTextRange depends on Layout information, make sure layout it up to d ate. |
1039 scope->document().updateLayoutIgnorePendingStylesheets(); | 1039 scope->document().updateLayoutIgnorePendingStylesheets(); |
1040 | 1040 |
1041 return PlainTextRange::create(*scope, *range).start(); | 1041 return PlainTextRange::create(*scope, *range).start(); |
1042 } | 1042 } |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2482 | 2482 |
2483 return animator->setScrollbarsVisibleForTesting(visible); | 2483 return animator->setScrollbarsVisibleForTesting(visible); |
2484 } | 2484 } |
2485 | 2485 |
2486 void Internals::forceRestrictIFramePermissions() | 2486 void Internals::forceRestrictIFramePermissions() |
2487 { | 2487 { |
2488 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); | 2488 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); |
2489 } | 2489 } |
2490 | 2490 |
2491 } // namespace blink | 2491 } // namespace blink |
OLD | NEW |