| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 template <typename Strategy> | 198 template <typename Strategy> |
| 199 void FrameSelection::setNonDirectionalSelectionIfNeededAlgorithm(const VisibleSe
lection& passedNewSelection, TextGranularity granularity, | 199 void FrameSelection::setNonDirectionalSelectionIfNeededAlgorithm(const VisibleSe
lection& passedNewSelection, TextGranularity granularity, |
| 200 EndPointsAdjustmentMode endpointsAdjustmentMode) | 200 EndPointsAdjustmentMode endpointsAdjustmentMode) |
| 201 { | 201 { |
| 202 VisibleSelection newSelection = passedNewSelection; | 202 VisibleSelection newSelection = passedNewSelection; |
| 203 bool isDirectional = shouldAlwaysUseDirectionalSelection(m_frame) || newSele
ction.isDirectional(); | 203 bool isDirectional = shouldAlwaysUseDirectionalSelection(m_frame) || newSele
ction.isDirectional(); |
| 204 | 204 |
| 205 VisiblePosition base = m_originalBase.isNotNull() ? m_originalBase : Visible
Position(Strategy::selectionBase(newSelection)); | 205 VisiblePosition base = m_originalBase.isNotNull() ? m_originalBase : visible
PositionOf(Strategy::selectionBase(newSelection)); |
| 206 VisiblePosition newBase = base; | 206 VisiblePosition newBase = base; |
| 207 VisiblePosition extent(Strategy::selectionExtent(newSelection)); | 207 VisiblePosition extent = visiblePositionOf(Strategy::selectionExtent(newSele
ction)); |
| 208 VisiblePosition newExtent = extent; | 208 VisiblePosition newExtent = extent; |
| 209 if (endpointsAdjustmentMode == AdjustEndpointsAtBidiBoundary) | 209 if (endpointsAdjustmentMode == AdjustEndpointsAtBidiBoundary) |
| 210 adjustEndpointsAtBidiBoundary(newBase, newExtent); | 210 adjustEndpointsAtBidiBoundary(newBase, newExtent); |
| 211 | 211 |
| 212 if (newBase.deepEquivalent() != base.deepEquivalent() || newExtent.deepEquiv
alent() != extent.deepEquivalent()) { | 212 if (newBase.deepEquivalent() != base.deepEquivalent() || newExtent.deepEquiv
alent() != extent.deepEquivalent()) { |
| 213 m_originalBase = base; | 213 m_originalBase = base; |
| 214 newSelection.setBase(newBase); | 214 newSelection.setBase(newBase); |
| 215 newSelection.setExtent(newExtent); | 215 newSelection.setExtent(newExtent); |
| 216 } else if (m_originalBase.isNotNull()) { | 216 } else if (m_originalBase.isNotNull()) { |
| 217 if (Strategy::selectionBase(m_selection) == Strategy::selectionBase(newS
election)) | 217 if (Strategy::selectionBase(m_selection) == Strategy::selectionBase(newS
election)) |
| (...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2069 | 2069 |
| 2070 void showTree(const blink::FrameSelection* sel) | 2070 void showTree(const blink::FrameSelection* sel) |
| 2071 { | 2071 { |
| 2072 if (sel) | 2072 if (sel) |
| 2073 sel->showTreeForThis(); | 2073 sel->showTreeForThis(); |
| 2074 else | 2074 else |
| 2075 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 2075 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 2076 } | 2076 } |
| 2077 | 2077 |
| 2078 #endif | 2078 #endif |
| OLD | NEW |