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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 2 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) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 { 178 {
179 } 179 }
180 180
181 void ApplyStyleCommand::updateStartEnd(const Position& newStart, const Position& newEnd) 181 void ApplyStyleCommand::updateStartEnd(const Position& newStart, const Position& newEnd)
182 { 182 {
183 DCHECK_GE(comparePositions(newEnd, newStart), 0); 183 DCHECK_GE(comparePositions(newEnd, newStart), 0);
184 184
185 if (!m_useEndingSelection && (newStart != m_start || newEnd != m_end)) 185 if (!m_useEndingSelection && (newStart != m_start || newEnd != m_end))
186 m_useEndingSelection = true; 186 m_useEndingSelection = true;
187 187
188 setEndingSelection(VisibleSelection(newStart, newEnd, VP_DEFAULT_AFFINITY, e ndingSelection().isDirectional())); 188 setEndingSelection(createVisibleSelectionDeprecated(newStart, newEnd, VP_DEF AULT_AFFINITY, endingSelection().isDirectional()));
189 m_start = newStart; 189 m_start = newStart;
190 m_end = newEnd; 190 m_end = newEnd;
191 } 191 }
192 192
193 Position ApplyStyleCommand::startPosition() 193 Position ApplyStyleCommand::startPosition()
194 { 194 {
195 if (m_useEndingSelection) 195 if (m_useEndingSelection)
196 return endingSelection().start(); 196 return endingSelection().start();
197 197
198 return m_start; 198 return m_start;
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 DEFINE_TRACE(ApplyStyleCommand) 1756 DEFINE_TRACE(ApplyStyleCommand)
1757 { 1757 {
1758 visitor->trace(m_style); 1758 visitor->trace(m_style);
1759 visitor->trace(m_start); 1759 visitor->trace(m_start);
1760 visitor->trace(m_end); 1760 visitor->trace(m_end);
1761 visitor->trace(m_styledInlineElement); 1761 visitor->trace(m_styledInlineElement);
1762 CompositeEditCommand::trace(visitor); 1762 CompositeEditCommand::trace(visitor);
1763 } 1763 }
1764 1764
1765 } // namespace blink 1765 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698