| 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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 mainFrame->scrollableArea()->scrollIntoRect(LayoutRect(boundsInRootContent),
FloatRect(x, y, w, h)); | 1019 mainFrame->scrollableArea()->scrollIntoRect(LayoutRect(boundsInRootContent),
FloatRect(x, y, w, h)); |
| 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 return createRange(PlainTextRange(rangeLocation, rangeLocation + rangeLength
).createRange(*scope)); |
| 1030 if (range.isNull()) | |
| 1031 return nullptr; | |
| 1032 return Range::create(range.document(), range.startPosition(), range.endPosit
ion()); | |
| 1033 } | 1030 } |
| 1034 | 1031 |
| 1035 unsigned Internals::locationFromRange(Element* scope, const Range* range) | 1032 unsigned Internals::locationFromRange(Element* scope, const Range* range) |
| 1036 { | 1033 { |
| 1037 ASSERT(scope && range); | 1034 ASSERT(scope && range); |
| 1038 // PlainTextRange depends on Layout information, make sure layout it up to d
ate. | 1035 // PlainTextRange depends on Layout information, make sure layout it up to d
ate. |
| 1039 scope->document().updateLayoutIgnorePendingStylesheets(); | 1036 scope->document().updateLayoutIgnorePendingStylesheets(); |
| 1040 | 1037 |
| 1041 return PlainTextRange::create(*scope, *range).start(); | 1038 return PlainTextRange::create(*scope, *range).start(); |
| 1042 } | 1039 } |
| (...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 | 2479 |
| 2483 return animator->setScrollbarsVisibleForTesting(visible); | 2480 return animator->setScrollbarsVisibleForTesting(visible); |
| 2484 } | 2481 } |
| 2485 | 2482 |
| 2486 void Internals::forceRestrictIFramePermissions() | 2483 void Internals::forceRestrictIFramePermissions() |
| 2487 { | 2484 { |
| 2488 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); | 2485 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); |
| 2489 } | 2486 } |
| 2490 | 2487 |
| 2491 } // namespace blink | 2488 } // namespace blink |
| OLD | NEW |