https://bugs.webkit.org/show_bug.cgi?id=126946
Reviewed by Enrica Casucci.
Using the Services menu has a slightly different codepath than Editor::copy() does. This
patch duplicates the canCopy() check that Editor::copy() does.
Testing is not possible because the Services menu is not accessible to our tests.
* editing/mac/EditorMac.mm:
(WebCore::Editor::stringSelectionForPasteboard):
(WebCore::Editor::stringSelectionForPasteboardWithImageAltText):
(WebCore::Editor::dataSelectionForPasteboard):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161925
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-01-13 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Highlighting password field then making a Sticky Note via Safari Services exposes password
+ https://bugs.webkit.org/show_bug.cgi?id=126946
+
+ Reviewed by Enrica Casucci.
+
+ Using the Services menu has a slightly different codepath than Editor::copy() does. This
+ patch duplicates the canCopy() check that Editor::copy() does.
+
+ Testing is not possible because the Services menu is not accessible to our tests.
+
+ * editing/mac/EditorMac.mm:
+ (WebCore::Editor::stringSelectionForPasteboard):
+ (WebCore::Editor::stringSelectionForPasteboardWithImageAltText):
+ (WebCore::Editor::dataSelectionForPasteboard):
+
2014-01-13 Brent Fulgham <bfulgham@apple.com>
[WebGL] Crash due to forceLostContext
2014-01-13 Brent Fulgham <bfulgham@apple.com>
[WebGL] Crash due to forceLostContext
// This was left in a bad state when selectedTextForClipboard was added. Need to look over clients and fix this.
String Editor::stringSelectionForPasteboard()
{
// This was left in a bad state when selectedTextForClipboard was added. Need to look over clients and fix this.
String Editor::stringSelectionForPasteboard()
{
+ if (!canCopy())
+ return "";
String text = selectedText();
text.replace(noBreakSpace, ' ');
return text;
String text = selectedText();
text.replace(noBreakSpace, ' ');
return text;
String Editor::stringSelectionForPasteboardWithImageAltText()
{
String Editor::stringSelectionForPasteboardWithImageAltText()
{
+ if (!canCopy())
+ return "";
String text = selectedTextForClipboard();
text.replace(noBreakSpace, ' ');
return text;
String text = selectedTextForClipboard();
text.replace(noBreakSpace, ' ');
return text;
// which is only used to support OS X services.
// FIXME: Does this function really need to use adjustedSelectionRange()? Because writeSelectionToPasteboard() just uses selectedRange().
// which is only used to support OS X services.
// FIXME: Does this function really need to use adjustedSelectionRange()? Because writeSelectionToPasteboard() just uses selectedRange().
+ if (!canCopy())
+ return nullptr;
if (pasteboardType == WebArchivePboardType)
return selectionInWebArchiveFormat();
if (pasteboardType == WebArchivePboardType)
return selectionInWebArchiveFormat();