| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 rect = LayoutRect(AbsoluteCaretBounds()); | 976 rect = LayoutRect(AbsoluteCaretBounds()); |
| 977 break; | 977 break; |
| 978 case kRangeSelection: | 978 case kRangeSelection: |
| 979 rect = LayoutRect(reveal_extent_option == kRevealExtent | 979 rect = LayoutRect(reveal_extent_option == kRevealExtent |
| 980 ? AbsoluteCaretBoundsOf(CreateVisiblePosition( | 980 ? AbsoluteCaretBoundsOf(CreateVisiblePosition( |
| 981 ComputeVisibleSelectionInDOMTree().Extent())) | 981 ComputeVisibleSelectionInDOMTree().Extent())) |
| 982 : EnclosingIntRect(UnclippedBounds())); | 982 : EnclosingIntRect(UnclippedBounds())); |
| 983 break; | 983 break; |
| 984 } | 984 } |
| 985 | 985 |
| 986 Position start = ComputeVisibleSelectionInDOMTreeDeprecated().Start(); | 986 Position start = ComputeVisibleSelectionInDOMTree().Start(); |
| 987 DCHECK(start.AnchorNode()); | 987 DCHECK(start.AnchorNode()); |
| 988 if (start.AnchorNode() && start.AnchorNode()->GetLayoutObject()) { | 988 if (start.AnchorNode() && start.AnchorNode()->GetLayoutObject()) { |
| 989 // FIXME: This code only handles scrolling the startContainer's layer, but | 989 // FIXME: This code only handles scrolling the startContainer's layer, but |
| 990 // the selection rect could intersect more than just that. | 990 // the selection rect could intersect more than just that. |
| 991 if (DocumentLoader* document_loader = frame_->Loader().GetDocumentLoader()) | 991 if (DocumentLoader* document_loader = frame_->Loader().GetDocumentLoader()) |
| 992 document_loader->GetInitialScrollState().was_scrolled_by_user = true; | 992 document_loader->GetInitialScrollState().was_scrolled_by_user = true; |
| 993 if (start.AnchorNode()->GetLayoutObject()->ScrollRectToVisible( | 993 if (start.AnchorNode()->GetLayoutObject()->ScrollRectToVisible( |
| 994 rect, alignment, alignment)) | 994 rect, alignment, alignment)) |
| 995 UpdateAppearance(LayoutSelection::PaintHint::kPaint); | 995 UpdateAppearance(LayoutSelection::PaintHint::kPaint); |
| 996 } | 996 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 void showTree(const blink::FrameSelection* sel) { | 1186 void showTree(const blink::FrameSelection* sel) { |
| 1187 if (sel) | 1187 if (sel) |
| 1188 sel->ShowTreeForThis(); | 1188 sel->ShowTreeForThis(); |
| 1189 else | 1189 else |
| 1190 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1190 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 #endif | 1193 #endif |
| OLD | NEW |