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

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: Created 4 years, 9 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 | « no previous file | 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 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 } 1920 }
1921 1921
1922 template <typename Strategy> 1922 template <typename Strategy>
1923 static InlineBoxPosition computeInlineBoxPositionTemplate(const PositionTemplate <Strategy>& position, TextAffinity affinity, TextDirection primaryDirection) 1923 static InlineBoxPosition computeInlineBoxPositionTemplate(const PositionTemplate <Strategy>& position, TextAffinity affinity, TextDirection primaryDirection)
1924 { 1924 {
1925 InlineBox* inlineBox = nullptr; 1925 InlineBox* inlineBox = nullptr;
1926 int caretOffset = position.computeEditingOffset(); 1926 int caretOffset = position.computeEditingOffset();
1927 Node* const anchorNode = position.anchorNode(); 1927 Node* const anchorNode = position.anchorNode();
1928 LayoutObject* layoutObject = anchorNode->isShadowRoot() ? toShadowRoot(ancho rNode)->host()->layoutObject() : anchorNode->layoutObject(); 1928 LayoutObject* layoutObject = anchorNode->isShadowRoot() ? toShadowRoot(ancho rNode)->host()->layoutObject() : anchorNode->layoutObject();
1929 1929
1930 if (!layoutObject)
yosin_UTC9 2016/03/15 06:20:40 We should assume |computeInlineBoxPosition()| call
1931 return InlineBoxPosition();
1932
1930 if (!layoutObject->isText()) { 1933 if (!layoutObject->isText()) {
1931 inlineBox = 0; 1934 inlineBox = 0;
1932 if (canHaveChildrenForEditing(anchorNode) && layoutObject->isLayoutBlock Flow() && hasRenderedNonAnonymousDescendantsWithHeight(layoutObject)) { 1935 if (canHaveChildrenForEditing(anchorNode) && layoutObject->isLayoutBlock Flow() && hasRenderedNonAnonymousDescendantsWithHeight(layoutObject)) {
1933 // Try a visually equivalent position with possibly opposite 1936 // Try a visually equivalent position with possibly opposite
1934 // editability. This helps in case |this| is in an editable block 1937 // editability. This helps in case |this| is in an editable block
1935 // but surrounded by non-editable positions. It acts to negate the 1938 // but surrounded by non-editable positions. It acts to negate the
1936 // logic at the beginning of 1939 // logic at the beginning of
1937 // |LayoutObject::createPositionWithAffinity()|. 1940 // |LayoutObject::createPositionWithAffinity()|.
1938 PositionTemplate<Strategy> equivalent = downstreamIgnoringEditingBou ndaries(position); 1941 PositionTemplate<Strategy> equivalent = downstreamIgnoringEditingBou ndaries(position);
1939 if (equivalent == position) { 1942 if (equivalent == position) {
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
3252 { 3255 {
3253 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3256 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3254 } 3257 }
3255 3258
3256 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3259 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3257 { 3260 {
3258 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3261 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3259 } 3262 }
3260 3263
3261 } // namespace blink 3264 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698