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/VisibleUnitsLine.cpp

Issue 2952563002: Make PreviousRootInlineBoxCandidatePosition() to ignore nodes without layout object (Closed)
Patch Set: 2017-06-20T18:32:03 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 root->BlockDirectionPointInLine()); 246 root->BlockDirectionPointInLine());
247 } 247 }
248 248
249 return LayoutPoint( 249 return LayoutPoint(
250 root->BlockDirectionPointInLine(), 250 root->BlockDirectionPointInLine(),
251 LayoutUnit(line_direction_point - absolute_block_point.Y())); 251 LayoutUnit(line_direction_point - absolute_block_point.Y()));
252 } 252 }
253 253
254 bool InSameLine(const Node& node, const VisiblePosition& visible_position) { 254 bool InSameLine(const Node& node, const VisiblePosition& visible_position) {
255 if (!node.GetLayoutObject()) 255 if (!node.GetLayoutObject())
256 return false; 256 return true;
257 return InSameLine(CreateVisiblePosition( 257 return InSameLine(CreateVisiblePosition(
258 FirstPositionInOrBeforeNode(const_cast<Node*>(&node))), 258 FirstPositionInOrBeforeNode(const_cast<Node*>(&node))),
259 visible_position); 259 visible_position);
260 } 260 }
261 261
262 Node* FindNodeInPreviousLine(const Node& start_node, 262 Node* FindNodeInPreviousLine(const Node& start_node,
263 const VisiblePosition& visible_position, 263 const VisiblePosition& visible_position,
264 EditableType editable_type) { 264 EditableType editable_type) {
265 // TODO(editing-dev): We should make |PreviousLeafWithSameEditability()| to 265 // TODO(editing-dev): We should make |PreviousLeafWithSameEditability()| to
266 // take |const Node&|. 266 // take |const Node&|.
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 // to the end of the line we're on. 741 // to the end of the line we're on.
742 Element* root_element = HasEditableStyle(*node, editable_type) 742 Element* root_element = HasEditableStyle(*node, editable_type)
743 ? RootEditableElement(*node, editable_type) 743 ? RootEditableElement(*node, editable_type)
744 : node->GetDocument().documentElement(); 744 : node->GetDocument().documentElement();
745 if (!root_element) 745 if (!root_element)
746 return VisiblePosition(); 746 return VisiblePosition();
747 return VisiblePosition::LastPositionInNode(root_element); 747 return VisiblePosition::LastPositionInNode(root_element);
748 } 748 }
749 749
750 } // namespace blink 750 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.h ('k') | third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698