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

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

Issue 2442673002: Get rid of createVisibleSelection() taking one Position (Closed)
Patch Set: 2016-10-24T17:42:38 Created 4 years, 1 month 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, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 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 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 1325
1326 Element* documentElement = document->documentElement(); 1326 Element* documentElement = document->documentElement();
1327 if (!documentElement) 1327 if (!documentElement)
1328 return; 1328 return;
1329 if (HTMLBodyElement* body = 1329 if (HTMLBodyElement* body =
1330 Traversal<HTMLBodyElement>::firstChild(*documentElement)) { 1330 Traversal<HTMLBodyElement>::firstChild(*documentElement)) {
1331 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 1331 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1332 // needs to be audited. See http://crbug.com/590369 for more details. 1332 // needs to be audited. See http://crbug.com/590369 for more details.
1333 document->updateStyleAndLayoutIgnorePendingStylesheets(); 1333 document->updateStyleAndLayoutIgnorePendingStylesheets();
1334 1334
1335 setSelection(createVisibleSelection(firstPositionInOrBeforeNode(body), 1335 setSelection(SelectionInDOMTree::Builder()
1336 TextAffinity::Downstream)); 1336 .collapse(firstPositionInOrBeforeNode(body))
1337 .build());
1337 } 1338 }
1338 } 1339 }
1339 1340
1340 // TODO(yoichio): We should have LocalFrame having FrameCaret, 1341 // TODO(yoichio): We should have LocalFrame having FrameCaret,
1341 // Editor and PendingSelection using FrameCaret directly 1342 // Editor and PendingSelection using FrameCaret directly
1342 // and get rid of this. 1343 // and get rid of this.
1343 bool FrameSelection::shouldShowBlockCursor() const { 1344 bool FrameSelection::shouldShowBlockCursor() const {
1344 return m_frameCaret->shouldShowBlockCursor(); 1345 return m_frameCaret->shouldShowBlockCursor();
1345 } 1346 }
1346 1347
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 } 1486 }
1486 1487
1487 void showTree(const blink::FrameSelection* sel) { 1488 void showTree(const blink::FrameSelection* sel) {
1488 if (sel) 1489 if (sel)
1489 sel->showTreeForThis(); 1490 sel->showTreeForThis();
1490 else 1491 else
1491 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1492 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1492 } 1493 }
1493 1494
1494 #endif 1495 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698