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

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

Issue 2425543003: Ensure clean layout for VisibleSelection::selectionFromContentsOfNode (Closed)
Patch Set: 201610171619 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 if (selectStartTarget) { 962 if (selectStartTarget) {
963 const Document& expectedDocument = document(); 963 const Document& expectedDocument = document();
964 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble( 964 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble(
965 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled) 965 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled)
966 return; 966 return;
967 // |root| may be detached due to selectstart event. 967 // |root| may be detached due to selectstart event.
968 if (!root->isConnected() || expectedDocument != root->document()) 968 if (!root->isConnected() || expectedDocument != root->document())
969 return; 969 return;
970 } 970 }
971 971
972 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
973 // needs to be audited. See http://crbug.com/590369 for more details.
974 document().updateStyleAndLayoutIgnorePendingStylesheets();
975
972 VisibleSelection newSelection( 976 VisibleSelection newSelection(
973 VisibleSelection::selectionFromContentsOfNode(root)); 977 VisibleSelection::selectionFromContentsOfNode(root));
974 setSelection(newSelection); 978 setSelection(newSelection);
975 selectFrameElementInParentIfFullySelected(); 979 selectFrameElementInParentIfFullySelected();
976 notifyLayoutObjectOfSelectionChange(UserTriggered); 980 notifyLayoutObjectOfSelectionChange(UserTriggered);
977 } 981 }
978 982
979 bool FrameSelection::setSelectedRange(Range* range, 983 bool FrameSelection::setSelectedRange(Range* range,
980 TextAffinity affinity, 984 TextAffinity affinity,
981 SelectionDirectionalMode directional, 985 SelectionDirectionalMode directional,
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 } 1484 }
1481 1485
1482 void showTree(const blink::FrameSelection* sel) { 1486 void showTree(const blink::FrameSelection* sel) {
1483 if (sel) 1487 if (sel)
1484 sel->showTreeForThis(); 1488 sel->showTreeForThis();
1485 else 1489 else
1486 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1490 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1487 } 1491 }
1488 1492
1489 #endif 1493 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698