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

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

Issue 2315223002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in FrameSelection::selectedText (Closed)
Patch Set: Created 4 years, 3 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/html/HTMLTextAreaElement.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) 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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 1064
1065 String FrameSelection::selectedHTMLForClipboard() const 1065 String FrameSelection::selectedHTMLForClipboard() const
1066 { 1066 {
1067 const VisibleSelectionInFlatTree& visibleSelection = this->visibleSelection< EditingInFlatTreeStrategy>(); 1067 const VisibleSelectionInFlatTree& visibleSelection = this->visibleSelection< EditingInFlatTreeStrategy>();
1068 const EphemeralRangeInFlatTree& range = visibleSelection.toNormalizedEphemer alRange(); 1068 const EphemeralRangeInFlatTree& range = visibleSelection.toNormalizedEphemer alRange();
1069 return createMarkup(range.startPosition(), range.endPosition(), AnnotateForI nterchange, ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 1069 return createMarkup(range.startPosition(), range.endPosition(), AnnotateForI nterchange, ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
1070 } 1070 }
1071 1071
1072 String FrameSelection::selectedText(TextIteratorBehavior behavior) const 1072 String FrameSelection::selectedText(TextIteratorBehavior behavior) const
1073 { 1073 {
1074 if (!isAvailable())
yosin_UTC9 2016/09/07 09:58:25 Could you have |DCHECK(isAvailable())|, just in ca
Xiaocheng 2016/09/07 10:01:56 This |isAvailable()| check was added by myself a f
1075 return emptyString();
1076
1077 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1078 // needs to be audited. See http://crbug.com/590369 for more details.
1079 m_document->updateStyleAndLayoutIgnorePendingStylesheets();
1080
1081 return extractSelectedText(*this, behavior); 1074 return extractSelectedText(*this, behavior);
1082 } 1075 }
1083 1076
1084 String FrameSelection::selectedTextForClipboard() const 1077 String FrameSelection::selectedTextForClipboard() const
1085 { 1078 {
1086 if (m_frame->settings() && m_frame->settings()->selectionIncludesAltImageTex t()) 1079 if (m_frame->settings() && m_frame->settings()->selectionIncludesAltImageTex t())
1087 return extractSelectedText(*this, TextIteratorEmitsImageAltText); 1080 return extractSelectedText(*this, TextIteratorEmitsImageAltText);
1088 return extractSelectedText(*this, TextIteratorDefaultBehavior); 1081 return extractSelectedText(*this, TextIteratorDefaultBehavior);
1089 } 1082 }
1090 1083
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 1372
1380 void showTree(const blink::FrameSelection* sel) 1373 void showTree(const blink::FrameSelection* sel)
1381 { 1374 {
1382 if (sel) 1375 if (sel)
1383 sel->showTreeForThis(); 1376 sel->showTreeForThis();
1384 else 1377 else
1385 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1378 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1386 } 1379 }
1387 1380
1388 #endif 1381 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698