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

Side by Side Diff: third_party/WebKit/Source/core/clipboard/DataTransfer.cpp

Issue 2702403004: Expand FrameSeleciton::start() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T12:32:36 Created 3 years, 10 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/Editor.cpp » ('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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 // The URL can also be used as an HTML fragment. 316 // The URL can also be used as an HTML fragment.
317 m_dataObject->setHTMLAndBaseURL( 317 m_dataObject->setHTMLAndBaseURL(
318 createMarkup(node, IncludeNode, ResolveAllURLs), url); 318 createMarkup(node, IncludeNode, ResolveAllURLs), url);
319 } 319 }
320 320
321 void DataTransfer::writeSelection(const FrameSelection& selection) { 321 void DataTransfer::writeSelection(const FrameSelection& selection) {
322 if (!m_dataObject) 322 if (!m_dataObject)
323 return; 323 return;
324 324
325 if (!enclosingTextControl(selection.start())) { 325 if (!enclosingTextControl(
326 selection.computeVisibleSelectionInDOMTreeDeprecated().start())) {
326 m_dataObject->setHTMLAndBaseURL(selection.selectedHTMLForClipboard(), 327 m_dataObject->setHTMLAndBaseURL(selection.selectedHTMLForClipboard(),
327 selection.frame()->document()->url()); 328 selection.frame()->document()->url());
328 } 329 }
329 330
330 String str = selection.selectedTextForClipboard(); 331 String str = selection.selectedTextForClipboard();
331 #if OS(WIN) 332 #if OS(WIN)
332 replaceNewlinesWithWindowsStyleNewlines(str); 333 replaceNewlinesWithWindowsStyleNewlines(str);
333 #endif 334 #endif
334 replaceNBSPWithSpace(str); 335 replaceNBSPWithSpace(str);
335 m_dataObject->setData(mimeTypeTextPlain, str); 336 m_dataObject->setData(mimeTypeTextPlain, str);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 477 }
477 } 478 }
478 479
479 DEFINE_TRACE(DataTransfer) { 480 DEFINE_TRACE(DataTransfer) {
480 visitor->trace(m_dataObject); 481 visitor->trace(m_dataObject);
481 visitor->trace(m_dragImage); 482 visitor->trace(m_dragImage);
482 visitor->trace(m_dragImageElement); 483 visitor->trace(m_dragImageElement);
483 } 484 }
484 485
485 } // namespace blink 486 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698