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

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

Issue 2425543003: Ensure clean layout for VisibleSelection::selectionFromContentsOfNode (Closed)
Patch Set: 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) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 m_granularity = other.m_granularity; 241 m_granularity = other.m_granularity;
242 m_hasTrailingWhitespace = other.m_hasTrailingWhitespace; 242 m_hasTrailingWhitespace = other.m_hasTrailingWhitespace;
243 return *this; 243 return *this;
244 } 244 }
245 245
246 template <typename Strategy> 246 template <typename Strategy>
247 VisibleSelectionTemplate<Strategy> 247 VisibleSelectionTemplate<Strategy>
248 VisibleSelectionTemplate<Strategy>::selectionFromContentsOfNode(Node* node) { 248 VisibleSelectionTemplate<Strategy>::selectionFromContentsOfNode(Node* node) {
249 DCHECK(!Strategy::editingIgnoresContent(node)); 249 DCHECK(!Strategy::editingIgnoresContent(node));
250 250
251 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
tkent 2016/10/17 07:08:16 We should add a DCHECK and/or a comment to ensure
Xiaocheng 2016/10/17 07:36:21 Done.
252 // needs to be audited. see http://crbug.com/590369 for more details.
253 node->document().updateStyleAndLayoutIgnorePendingStylesheets();
254
255 typename SelectionTemplate<Strategy>::Builder builder; 251 typename SelectionTemplate<Strategy>::Builder builder;
256 builder.collapse(PositionTemplate<Strategy>::firstPositionInNode(node)) 252 builder.collapse(PositionTemplate<Strategy>::firstPositionInNode(node))
257 .extend(PositionTemplate<Strategy>::lastPositionInNode(node)); 253 .extend(PositionTemplate<Strategy>::lastPositionInNode(node));
258 return VisibleSelectionTemplate::create(builder.build()); 254 return VisibleSelectionTemplate::create(builder.build());
259 } 255 }
260 256
261 template <typename Strategy> 257 template <typename Strategy>
262 void VisibleSelectionTemplate<Strategy>::setBase( 258 void VisibleSelectionTemplate<Strategy>::setBase(
263 const PositionTemplate<Strategy>& position) { 259 const PositionTemplate<Strategy>& position) {
264 DCHECK(!needsLayoutTreeUpdate(position)); 260 DCHECK(!needsLayoutTreeUpdate(position));
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 972
977 void showTree(const blink::VisibleSelectionInFlatTree& sel) { 973 void showTree(const blink::VisibleSelectionInFlatTree& sel) {
978 sel.showTreeForThis(); 974 sel.showTreeForThis();
979 } 975 }
980 976
981 void showTree(const blink::VisibleSelectionInFlatTree* sel) { 977 void showTree(const blink::VisibleSelectionInFlatTree* sel) {
982 if (sel) 978 if (sel)
983 sel->showTreeForThis(); 979 sel->showTreeForThis();
984 } 980 }
985 #endif 981 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698