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

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

Issue 2706163002: Add clean layout DCHECK to mostForwardCaretPosition() (Closed)
Patch Set: 2017-02-21T17:13:25 Created 3 years, 10 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/commands/ApplyStyleCommand.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) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights 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 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 if (m_smartReplace || fragment.hasInterchangeNewlineAtStart() || 1970 if (m_smartReplace || fragment.hasInterchangeNewlineAtStart() ||
1971 fragment.hasInterchangeNewlineAtEnd()) 1971 fragment.hasInterchangeNewlineAtEnd())
1972 return false; 1972 return false;
1973 1973
1974 // e.g. when "bar" is inserted after "foo" in <div><u>foo</u></div>, "bar" 1974 // e.g. when "bar" is inserted after "foo" in <div><u>foo</u></div>, "bar"
1975 // should not be underlined. 1975 // should not be underlined.
1976 if (elementToSplitToAvoidPastingIntoInlineElementsWithStyle( 1976 if (elementToSplitToAvoidPastingIntoInlineElementsWithStyle(
1977 endingSelection().start())) 1977 endingSelection().start()))
1978 return false; 1978 return false;
1979 1979
1980 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets
1981 // needs to be audited. See http://crbug.com/590369 for more details.
1982 document().updateStyleAndLayoutIgnorePendingStylesheets();
1983
1980 Node* nodeAfterInsertionPos = 1984 Node* nodeAfterInsertionPos =
1981 mostForwardCaretPosition(endingSelection().end()).anchorNode(); 1985 mostForwardCaretPosition(endingSelection().end()).anchorNode();
1982 Text* textNode = toText(fragment.firstChild()); 1986 Text* textNode = toText(fragment.firstChild());
1983 // Our fragment creation code handles tabs, spaces, and newlines, so we don't 1987 // Our fragment creation code handles tabs, spaces, and newlines, so we don't
1984 // have to worry about those here. 1988 // have to worry about those here.
1985 1989
1986 Position start = endingSelection().start(); 1990 Position start = endingSelection().start();
1987 Position end = replaceSelectedTextInNode(textNode->data()); 1991 Position end = replaceSelectedTextInNode(textNode->data());
1988 if (end.isNull()) 1992 if (end.isNull())
1989 return false; 1993 return false;
(...skipping 30 matching lines...) Expand all
2020 visitor->trace(m_startOfInsertedContent); 2024 visitor->trace(m_startOfInsertedContent);
2021 visitor->trace(m_endOfInsertedContent); 2025 visitor->trace(m_endOfInsertedContent);
2022 visitor->trace(m_insertionStyle); 2026 visitor->trace(m_insertionStyle);
2023 visitor->trace(m_documentFragment); 2027 visitor->trace(m_documentFragment);
2024 visitor->trace(m_startOfInsertedRange); 2028 visitor->trace(m_startOfInsertedRange);
2025 visitor->trace(m_endOfInsertedRange); 2029 visitor->trace(m_endOfInsertedRange);
2026 CompositeEditCommand::trace(visitor); 2030 CompositeEditCommand::trace(visitor);
2027 } 2031 }
2028 2032
2029 } // namespace blink 2033 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698