Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 2912303002: Limit visibility {Left,Right}BoundaryOfLine() to SelectionModifier only (Closed)
Patch Set: 2017-05-31T17:14:49 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 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 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 if (next_position.IsNull()) 1933 if (next_position.IsNull())
1934 return true; 1934 return true;
1935 // In DOM version, following condition, the last position of inner editor 1935 // In DOM version, following condition, the last position of inner editor
1936 // of INPUT/TEXTAREA element, by |nextPosition().isNull()|, because of 1936 // of INPUT/TEXTAREA element, by |nextPosition().isNull()|, because of
1937 // an inner editor is an only leaf node. 1937 // an inner editor is an only leaf node.
1938 if (!next_position.DeepEquivalent().IsAfterAnchor()) 1938 if (!next_position.DeepEquivalent().IsAfterAnchor())
1939 return false; 1939 return false;
1940 return IsTextControlElement(next_position.DeepEquivalent().AnchorNode()); 1940 return IsTextControlElement(next_position.DeepEquivalent().AnchorNode());
1941 } 1941 }
1942 1942
1943 VisiblePosition LeftBoundaryOfLine(const VisiblePosition& c,
1944 TextDirection direction) {
1945 DCHECK(c.IsValid()) << c;
1946 return direction == TextDirection::kLtr ? LogicalStartOfLine(c)
1947 : LogicalEndOfLine(c);
1948 }
1949
1950 VisiblePosition RightBoundaryOfLine(const VisiblePosition& c,
1951 TextDirection direction) {
1952 DCHECK(c.IsValid()) << c;
1953 return direction == TextDirection::kLtr ? LogicalEndOfLine(c)
1954 : LogicalStartOfLine(c);
1955 }
1956
1957 static bool IsNonTextLeafChild(LayoutObject* object) { 1943 static bool IsNonTextLeafChild(LayoutObject* object) {
1958 if (object->SlowFirstChild()) 1944 if (object->SlowFirstChild())
1959 return false; 1945 return false;
1960 if (object->IsText()) 1946 if (object->IsText())
1961 return false; 1947 return false;
1962 return true; 1948 return true;
1963 } 1949 }
1964 1950
1965 static InlineTextBox* SearchAheadForBetterMatch(LayoutObject* layout_object) { 1951 static InlineTextBox* SearchAheadForBetterMatch(LayoutObject* layout_object) {
1966 LayoutBlock* container = layout_object->ContainingBlock(); 1952 LayoutBlock* container = layout_object->ContainingBlock();
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
3770 3756
3771 IntRect ComputeTextRect(const EphemeralRangeInFlatTree& range) { 3757 IntRect ComputeTextRect(const EphemeralRangeInFlatTree& range) {
3772 return EnclosingIntRect(ComputeTextRectTemplate(range)); 3758 return EnclosingIntRect(ComputeTextRectTemplate(range));
3773 } 3759 }
3774 3760
3775 FloatRect ComputeTextFloatRect(const EphemeralRange& range) { 3761 FloatRect ComputeTextFloatRect(const EphemeralRange& range) {
3776 return ComputeTextRectTemplate(range); 3762 return ComputeTextRectTemplate(range);
3777 } 3763 }
3778 3764
3779 } // namespace blink 3765 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698