OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |