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

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

Issue 1994043002: Get rid of a redundant function alias lastPositionInNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-19T14:50:30 Created 4 years, 7 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 Text* endContainer = toText(end.computeContainerNode()); 242 Text* endContainer = toText(end.computeContainerNode());
243 splitTextNode(endContainer, end.offsetInContainerNode()); 243 splitTextNode(endContainer, end.offsetInContainerNode());
244 if (isStartAndEndOnSameNode) 244 if (isStartAndEndOnSameNode)
245 start = firstPositionInOrBeforeNode(endContainer->previousSiblin g()); 245 start = firstPositionInOrBeforeNode(endContainer->previousSiblin g());
246 if (isEndAndEndOfLastParagraphOnSameNode) { 246 if (isEndAndEndOfLastParagraphOnSameNode) {
247 if (m_endOfLastParagraph.offsetInContainerNode() == end.offsetIn ContainerNode()) 247 if (m_endOfLastParagraph.offsetInContainerNode() == end.offsetIn ContainerNode())
248 m_endOfLastParagraph = lastPositionInOrAfterNode(endContaine r->previousSibling()); 248 m_endOfLastParagraph = lastPositionInOrAfterNode(endContaine r->previousSibling());
249 else 249 else
250 m_endOfLastParagraph = Position(endContainer, m_endOfLastPar agraph.offsetInContainerNode() - end.offsetInContainerNode()); 250 m_endOfLastParagraph = Position(endContainer, m_endOfLastPar agraph.offsetInContainerNode() - end.offsetInContainerNode());
251 } 251 }
252 end = lastPositionInNode(endContainer->previousSibling()); 252 end = Position::lastPositionInNode(endContainer->previousSibling());
253 } 253 }
254 } 254 }
255 } 255 }
256 256
257 VisiblePosition ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfN eeded(VisiblePosition& endOfCurrentParagraph, Position& start, Position& end) 257 VisiblePosition ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfN eeded(VisiblePosition& endOfCurrentParagraph, Position& start, Position& end)
258 { 258 {
259 VisiblePosition endOfNextParagraph = endOfParagraph(nextPositionOf(endOfCurr entParagraph)); 259 VisiblePosition endOfNextParagraph = endOfParagraph(nextPositionOf(endOfCurr entParagraph));
260 Position position = endOfNextParagraph.deepEquivalent(); 260 Position position = endOfNextParagraph.deepEquivalent();
261 const ComputedStyle* style = computedStyleOfEnclosingTextNode(position); 261 const ComputedStyle* style = computedStyleOfEnclosingTextNode(position);
262 if (!style) 262 if (!style)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return element; 301 return element;
302 } 302 }
303 303
304 DEFINE_TRACE(ApplyBlockElementCommand) 304 DEFINE_TRACE(ApplyBlockElementCommand)
305 { 305 {
306 visitor->trace(m_endOfLastParagraph); 306 visitor->trace(m_endOfLastParagraph);
307 CompositeEditCommand::trace(visitor); 307 CompositeEditCommand::trace(visitor);
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698