| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 3 * reserved. | 3 * 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 * 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/editing/Editor.h" | 30 #include "core/editing/Editor.h" |
| 31 #include "core/editing/VisibleUnits.h" | 31 #include "core/editing/VisibleUnits.h" |
| 32 #include "core/frame/LocalFrame.h" | 32 #include "core/frame/LocalFrame.h" |
| 33 #include "core/frame/Settings.h" | 33 #include "core/frame/Settings.h" |
| 34 #include "core/layout/LayoutBlock.h" | 34 #include "core/layout/LayoutBlock.h" |
| 35 #include "core/layout/line/InlineTextBox.h" | 35 #include "core/layout/line/InlineTextBox.h" |
| 36 #include "core/page/SpatialNavigation.h" | 36 #include "core/page/SpatialNavigation.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 namespace { |
| 41 |
| 42 VisiblePosition LeftBoundaryOfLine(const VisiblePosition& c, |
| 43 TextDirection direction) { |
| 44 DCHECK(c.IsValid()) << c; |
| 45 return direction == TextDirection::kLtr ? LogicalStartOfLine(c) |
| 46 : LogicalEndOfLine(c); |
| 47 } |
| 48 |
| 49 VisiblePosition RightBoundaryOfLine(const VisiblePosition& c, |
| 50 TextDirection direction) { |
| 51 DCHECK(c.IsValid()) << c; |
| 52 return direction == TextDirection::kLtr ? LogicalEndOfLine(c) |
| 53 : LogicalStartOfLine(c); |
| 54 } |
| 55 |
| 56 } // namespace |
| 57 |
| 40 LayoutUnit NoXPosForVerticalArrowNavigation() { | 58 LayoutUnit NoXPosForVerticalArrowNavigation() { |
| 41 return LayoutUnit::Min(); | 59 return LayoutUnit::Min(); |
| 42 } | 60 } |
| 43 | 61 |
| 44 bool SelectionModifier::ShouldAlwaysUseDirectionalSelection(LocalFrame* frame) { | 62 bool SelectionModifier::ShouldAlwaysUseDirectionalSelection(LocalFrame* frame) { |
| 45 return !frame || | 63 return !frame || |
| 46 frame->GetEditor().Behavior().ShouldConsiderSelectionAsDirectional(); | 64 frame->GetEditor().Behavior().ShouldConsiderSelectionAsDirectional(); |
| 47 } | 65 } |
| 48 | 66 |
| 49 SelectionModifier::SelectionModifier( | 67 SelectionModifier::SelectionModifier( |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 x = LineDirectionPointForBlockDirectionNavigationOf(visible_position); | 861 x = LineDirectionPointForBlockDirectionNavigationOf(visible_position); |
| 844 x_pos_for_vertical_arrow_navigation_ = x; | 862 x_pos_for_vertical_arrow_navigation_ = x; |
| 845 } else { | 863 } else { |
| 846 x = x_pos_for_vertical_arrow_navigation_; | 864 x = x_pos_for_vertical_arrow_navigation_; |
| 847 } | 865 } |
| 848 | 866 |
| 849 return x; | 867 return x; |
| 850 } | 868 } |
| 851 | 869 |
| 852 } // namespace blink | 870 } // namespace blink |
| OLD | NEW |