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

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

Issue 1793093006: [Editing][Stability] Recanonicalize m_originalbase in FrameSelection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 8 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
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 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 } 1922 }
1923 1923
1924 template <typename Strategy> 1924 template <typename Strategy>
1925 static InlineBoxPosition computeInlineBoxPositionTemplate(const PositionTemplate <Strategy>& position, TextAffinity affinity, TextDirection primaryDirection) 1925 static InlineBoxPosition computeInlineBoxPositionTemplate(const PositionTemplate <Strategy>& position, TextAffinity affinity, TextDirection primaryDirection)
1926 { 1926 {
1927 InlineBox* inlineBox = nullptr; 1927 InlineBox* inlineBox = nullptr;
1928 int caretOffset = position.computeEditingOffset(); 1928 int caretOffset = position.computeEditingOffset();
1929 Node* const anchorNode = position.anchorNode(); 1929 Node* const anchorNode = position.anchorNode();
1930 LayoutObject* layoutObject = anchorNode->isShadowRoot() ? toShadowRoot(ancho rNode)->host()->layoutObject() : anchorNode->layoutObject(); 1930 LayoutObject* layoutObject = anchorNode->isShadowRoot() ? toShadowRoot(ancho rNode)->host()->layoutObject() : anchorNode->layoutObject();
1931 1931
1932 DCHECK(layoutObject);
1933
1932 if (!layoutObject->isText()) { 1934 if (!layoutObject->isText()) {
1933 inlineBox = 0; 1935 inlineBox = 0;
1934 if (canHaveChildrenForEditing(anchorNode) && layoutObject->isLayoutBlock Flow() && hasRenderedNonAnonymousDescendantsWithHeight(layoutObject)) { 1936 if (canHaveChildrenForEditing(anchorNode) && layoutObject->isLayoutBlock Flow() && hasRenderedNonAnonymousDescendantsWithHeight(layoutObject)) {
1935 // Try a visually equivalent position with possibly opposite 1937 // Try a visually equivalent position with possibly opposite
1936 // editability. This helps in case |this| is in an editable block 1938 // editability. This helps in case |this| is in an editable block
1937 // but surrounded by non-editable positions. It acts to negate the 1939 // but surrounded by non-editable positions. It acts to negate the
1938 // logic at the beginning of 1940 // logic at the beginning of
1939 // |LayoutObject::createPositionWithAffinity()|. 1941 // |LayoutObject::createPositionWithAffinity()|.
1940 PositionTemplate<Strategy> equivalent = downstreamIgnoringEditingBou ndaries(position); 1942 PositionTemplate<Strategy> equivalent = downstreamIgnoringEditingBou ndaries(position);
1941 if (equivalent == position) { 1943 if (equivalent == position) {
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
3254 { 3256 {
3255 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3257 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3256 } 3258 }
3257 3259
3258 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3260 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3259 { 3261 {
3260 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3262 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3261 } 3263 }
3262 3264
3263 } // namespace blink 3265 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698