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

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

Issue 2953683004: Make Position::AfterNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-22T12:37:16 Created 3 years, 6 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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
3 * reserved. 3 * 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 template <typename Strategy> 154 template <typename Strategy>
155 PositionTemplate<Strategy> EndOfParagraphAlgorithm( 155 PositionTemplate<Strategy> EndOfParagraphAlgorithm(
156 const PositionTemplate<Strategy>& position, 156 const PositionTemplate<Strategy>& position,
157 EditingBoundaryCrossingRule boundary_crossing_rule) { 157 EditingBoundaryCrossingRule boundary_crossing_rule) {
158 Node* const start_node = position.AnchorNode(); 158 Node* const start_node = position.AnchorNode();
159 159
160 if (!start_node) 160 if (!start_node)
161 return PositionTemplate<Strategy>(); 161 return PositionTemplate<Strategy>();
162 162
163 if (IsRenderedAsNonInlineTableImageOrHR(start_node)) 163 if (IsRenderedAsNonInlineTableImageOrHR(start_node))
164 return PositionTemplate<Strategy>::AfterNode(start_node); 164 return PositionTemplate<Strategy>::AfterNode(*start_node);
165 165
166 Element* const start_block = EnclosingBlock( 166 Element* const start_block = EnclosingBlock(
167 PositionTemplate<Strategy>::FirstPositionInOrBeforeNode(start_node), 167 PositionTemplate<Strategy>::FirstPositionInOrBeforeNode(start_node),
168 kCannotCrossEditingBoundary); 168 kCannotCrossEditingBoundary);
169 ContainerNode* const highest_root = HighestEditableRoot(position); 169 ContainerNode* const highest_root = HighestEditableRoot(position);
170 const bool start_node_is_editable = HasEditableStyle(*start_node); 170 const bool start_node_is_editable = HasEditableStyle(*start_node);
171 171
172 Node* candidate_node = start_node; 172 Node* candidate_node = start_node;
173 PositionAnchorType candidate_type = position.AnchorType(); 173 PositionAnchorType candidate_type = position.AnchorType();
174 int candidate_offset = position.ComputeEditingOffset(); 174 int candidate_offset = position.ComputeEditingOffset();
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 ? paragraph_start 399 ? paragraph_start
400 : range.StartPosition(); 400 : range.StartPosition();
401 const Position& result_end = 401 const Position& result_end =
402 paragraph_end.IsNotNull() && paragraph_end >= range.EndPosition() 402 paragraph_end.IsNotNull() && paragraph_end >= range.EndPosition()
403 ? paragraph_end 403 ? paragraph_end
404 : range.EndPosition(); 404 : range.EndPosition();
405 return EphemeralRange(result_start, result_end); 405 return EphemeralRange(result_start, result_end);
406 } 406 }
407 407
408 } // namespace blink 408 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698