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

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

Issue 1317053004: Make VisiblePosition constructor private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-02T12:44:47 Rebase Created 5 years, 3 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 // get positions we want to use for applying style 244 // get positions we want to use for applying style
245 Position start = startPosition(); 245 Position start = startPosition();
246 Position end = endPosition(); 246 Position end = endPosition();
247 if (comparePositions(end, start) < 0) { 247 if (comparePositions(end, start) < 0) {
248 Position swap = start; 248 Position swap = start;
249 start = end; 249 start = end;
250 end = swap; 250 end = swap;
251 } 251 }
252 252
253 VisiblePosition visibleStart(start); 253 VisiblePosition visibleStart = createVisiblePosition(start);
254 VisiblePosition visibleEnd(end); 254 VisiblePosition visibleEnd = createVisiblePosition(end);
255 255
256 if (visibleStart.isNull() || visibleStart.isOrphan() || visibleEnd.isNull() || visibleEnd.isOrphan()) 256 if (visibleStart.isNull() || visibleStart.isOrphan() || visibleEnd.isNull() || visibleEnd.isOrphan())
257 return; 257 return;
258 258
259 // Save and restore the selection endpoints using their indices in the docum ent, since 259 // Save and restore the selection endpoints using their indices in the docum ent, since
260 // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoint s. 260 // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoint s.
261 // Calculate start and end indices from the start of the tree that they're i n. 261 // Calculate start and end indices from the start of the tree that they're i n.
262 Node& scope = NodeTraversal::highestAncestorOrSelf(*visibleStart.deepEquival ent().anchorNode()); 262 Node& scope = NodeTraversal::highestAncestorOrSelf(*visibleStart.deepEquival ent().anchorNode());
263 RefPtrWillBeRawPtr<Range> startRange = Range::create(document(), firstPositi onInNode(&scope), visibleStart.deepEquivalent().parentAnchoredEquivalent()); 263 RefPtrWillBeRawPtr<Range> startRange = Range::create(document(), firstPositi onInNode(&scope), visibleStart.deepEquivalent().parentAnchoredEquivalent());
264 RefPtrWillBeRawPtr<Range> endRange = Range::create(document(), firstPosition InNode(&scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); 264 RefPtrWillBeRawPtr<Range> endRange = Range::create(document(), firstPosition InNode(&scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent());
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 DEFINE_TRACE(ApplyStyleCommand) 1594 DEFINE_TRACE(ApplyStyleCommand)
1595 { 1595 {
1596 visitor->trace(m_style); 1596 visitor->trace(m_style);
1597 visitor->trace(m_start); 1597 visitor->trace(m_start);
1598 visitor->trace(m_end); 1598 visitor->trace(m_end);
1599 visitor->trace(m_styledInlineElement); 1599 visitor->trace(m_styledInlineElement);
1600 CompositeEditCommand::trace(visitor); 1600 CompositeEditCommand::trace(visitor);
1601 } 1601 }
1602 1602
1603 } 1603 }
OLDNEW
« no previous file with comments | « Source/core/editing/commands/ApplyBlockElementCommand.cpp ('k') | Source/core/editing/commands/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698