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

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

Powered by Google App Engine
This is Rietveld 408576698