| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1608 | 1608 |
| 1609 Range* Editor::FindStringAndScrollToVisible(const String& target, | 1609 Range* Editor::FindStringAndScrollToVisible(const String& target, |
| 1610 Range* previous_match, | 1610 Range* previous_match, |
| 1611 FindOptions options) { | 1611 FindOptions options) { |
| 1612 Range* next_match = FindRangeOfString( | 1612 Range* next_match = FindRangeOfString( |
| 1613 target, EphemeralRangeInFlatTree(previous_match), options); | 1613 target, EphemeralRangeInFlatTree(previous_match), options); |
| 1614 if (!next_match) | 1614 if (!next_match) |
| 1615 return nullptr; | 1615 return nullptr; |
| 1616 | 1616 |
| 1617 Node* first_node = next_match->FirstNode(); | 1617 Node* first_node = next_match->FirstNode(); |
| 1618 | |
| 1619 first_node->GetLayoutObject()->ScrollRectToVisible( | 1618 first_node->GetLayoutObject()->ScrollRectToVisible( |
| 1620 LayoutRect(next_match->BoundingBox()), | 1619 LayoutRect(next_match->BoundingBox()), |
| 1621 ScrollAlignment::kAlignCenterIfNeeded, | 1620 ScrollAlignment::kAlignCenterIfNeeded, |
| 1622 ScrollAlignment::kAlignCenterIfNeeded, kProgrammaticScroll, true, | 1621 ScrollAlignment::kAlignCenterIfNeeded, kUserScroll); |
| 1623 kScrollBehaviorSmooth); | |
| 1624 | |
| 1625 first_node->GetDocument().SetSequentialFocusNavigationStartingPoint( | 1622 first_node->GetDocument().SetSequentialFocusNavigationStartingPoint( |
| 1626 first_node); | 1623 first_node); |
| 1627 | 1624 |
| 1628 return next_match; | 1625 return next_match; |
| 1629 } | 1626 } |
| 1630 | 1627 |
| 1631 // TODO(yosin) We should return |EphemeralRange| rather than |Range|. We use | 1628 // TODO(yosin) We should return |EphemeralRange| rather than |Range|. We use |
| 1632 // |Range| object for checking whether start and end position crossing shadow | 1629 // |Range| object for checking whether start and end position crossing shadow |
| 1633 // boundaries, however we can do it without |Range| object. | 1630 // boundaries, however we can do it without |Range| object. |
| 1634 template <typename Strategy> | 1631 template <typename Strategy> |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 | 1841 |
| 1845 DEFINE_TRACE(Editor) { | 1842 DEFINE_TRACE(Editor) { |
| 1846 visitor->Trace(frame_); | 1843 visitor->Trace(frame_); |
| 1847 visitor->Trace(last_edit_command_); | 1844 visitor->Trace(last_edit_command_); |
| 1848 visitor->Trace(undo_stack_); | 1845 visitor->Trace(undo_stack_); |
| 1849 visitor->Trace(mark_); | 1846 visitor->Trace(mark_); |
| 1850 visitor->Trace(typing_style_); | 1847 visitor->Trace(typing_style_); |
| 1851 } | 1848 } |
| 1852 | 1849 |
| 1853 } // namespace blink | 1850 } // namespace blink |
| OLD | NEW |