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

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

Issue 1971393003: Revert of [Editing][Stability] Recanonicalize m_originalbase in FrameSelection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/FrameSelection.cpp ('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 reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 } 1919 }
1920 1920
1921 template <typename Strategy> 1921 template <typename Strategy>
1922 static InlineBoxPosition computeInlineBoxPositionTemplate(const PositionTemplate <Strategy>& position, TextAffinity affinity, TextDirection primaryDirection) 1922 static InlineBoxPosition computeInlineBoxPositionTemplate(const PositionTemplate <Strategy>& position, TextAffinity affinity, TextDirection primaryDirection)
1923 { 1923 {
1924 InlineBox* inlineBox = nullptr; 1924 InlineBox* inlineBox = nullptr;
1925 int caretOffset = position.computeEditingOffset(); 1925 int caretOffset = position.computeEditingOffset();
1926 Node* const anchorNode = position.anchorNode(); 1926 Node* const anchorNode = position.anchorNode();
1927 LayoutObject* layoutObject = anchorNode->isShadowRoot() ? toShadowRoot(ancho rNode)->host()->layoutObject() : anchorNode->layoutObject(); 1927 LayoutObject* layoutObject = anchorNode->isShadowRoot() ? toShadowRoot(ancho rNode)->host()->layoutObject() : anchorNode->layoutObject();
1928 1928
1929 DCHECK(layoutObject) << position;
1930
1931 if (!layoutObject->isText()) { 1929 if (!layoutObject->isText()) {
1932 inlineBox = 0; 1930 inlineBox = 0;
1933 if (canHaveChildrenForEditing(anchorNode) && layoutObject->isLayoutBlock Flow() && hasRenderedNonAnonymousDescendantsWithHeight(layoutObject)) { 1931 if (canHaveChildrenForEditing(anchorNode) && layoutObject->isLayoutBlock Flow() && hasRenderedNonAnonymousDescendantsWithHeight(layoutObject)) {
1934 // Try a visually equivalent position with possibly opposite 1932 // Try a visually equivalent position with possibly opposite
1935 // editability. This helps in case |this| is in an editable block 1933 // editability. This helps in case |this| is in an editable block
1936 // but surrounded by non-editable positions. It acts to negate the 1934 // but surrounded by non-editable positions. It acts to negate the
1937 // logic at the beginning of 1935 // logic at the beginning of
1938 // |LayoutObject::createPositionWithAffinity()|. 1936 // |LayoutObject::createPositionWithAffinity()|.
1939 PositionTemplate<Strategy> equivalent = downstreamIgnoringEditingBou ndaries(position); 1937 PositionTemplate<Strategy> equivalent = downstreamIgnoringEditingBou ndaries(position);
1940 if (equivalent == position) { 1938 if (equivalent == position) {
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
3253 { 3251 {
3254 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3255 } 3253 }
3256 3254
3257 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3258 { 3256 {
3259 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3260 } 3258 }
3261 3259
3262 } // namespace blink 3260 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698