Diff
Modified: branches/safari-600.3-branch/Source/WebCore/ChangeLog (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebCore/ChangeLog 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebCore/ChangeLog 2014-12-02 14:03:45 UTC (rev 176634)
@@ -1,3 +1,22 @@
+2014-12-02 Dana Burkart <[email protected]>
+
+ Merge r176412. rdar://problem/18904600
+
+ 2014-11-20 Beth Dakin <[email protected]>
+
+ Invalid message WebPageProxy.DidPerformDictionaryLookup on Google stocks result
+ https://bugs.webkit.org/show_bug.cgi?id=138568
+ -and corresponding-
+ rdar://problem/18904600
+
+ Reviewed by Tim Horton.
+
+ Add an optional parameter indicating whether or not to include images.
+ * WebCore.exp.in:
+ * editing/cocoa/HTMLConverter.h:
+ * editing/cocoa/HTMLConverter.mm:
+ (WebCore::editingAttributedStringFromRange):
+
2014-11-19 Dana Burkart <[email protected]>
Merge r176363. rdar://problem/18840128
Modified: branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in 2014-12-02 14:03:45 UTC (rev 176634)
@@ -2343,7 +2343,7 @@
__ZN7WebCore32applicationIsAOLInstantMessengerEv
__ZN7WebCore32contextMenuItemTagInspectElementEv
__ZN7WebCore32contextMenuItemTagSmartCopyPasteEv
-__ZN7WebCore32editingAttributedStringFromRangeERNS_5RangeE
+__ZN7WebCore32editingAttributedStringFromRangeERNS_5RangeENS_31IncludeImagesInAttributedStringE
__ZN7WebCore32useBlockedPlugInContextMenuTitleEv
__ZN7WebCore33contextMenuItemTagTextReplacementEv
__ZN7WebCore33postScriptDocumentTypeDescriptionEv
Modified: branches/safari-600.3-branch/Source/WebCore/editing/cocoa/HTMLConverter.h (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebCore/editing/cocoa/HTMLConverter.h 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebCore/editing/cocoa/HTMLConverter.h 2014-12-02 14:03:45 UTC (rev 176634)
@@ -31,10 +31,12 @@
namespace WebCore {
class Range;
+
+enum class IncludeImagesInAttributedString { Yes, No };
NSAttributedString *attributedStringFromRange(Range&);
#if !PLATFORM(IOS)
-NSAttributedString *editingAttributedStringFromRange(Range&);
+NSAttributedString *editingAttributedStringFromRange(Range&, IncludeImagesInAttributedString = IncludeImagesInAttributedString::Yes);
#endif
}
Modified: branches/safari-600.3-branch/Source/WebCore/editing/cocoa/HTMLConverter.mm (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebCore/editing/cocoa/HTMLConverter.mm 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebCore/editing/cocoa/HTMLConverter.mm 2014-12-02 14:03:45 UTC (rev 176634)
@@ -2552,7 +2552,7 @@
#if !PLATFORM(IOS)
// This function uses TextIterator, which makes offsets in its result compatible with HTML editing.
-NSAttributedString *editingAttributedStringFromRange(Range& range)
+NSAttributedString *editingAttributedStringFromRange(Range& range, IncludeImagesInAttributedString includeOrSkipImages)
{
NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init];
@@ -2565,14 +2565,16 @@
Node* endContainer = currentTextRange->endContainer();
int startOffset = currentTextRange->startOffset();
int endOffset = currentTextRange->endOffset();
-
- if (startContainer == endContainer && (startOffset == endOffset - 1)) {
- Node* node = startContainer->childNode(startOffset);
- if (node && node->hasTagName(imgTag)) {
- NSFileWrapper* fileWrapper = fileWrapperForElement(toElement(node));
- NSTextAttachment* attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper];
- [string appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];
- [attachment release];
+
+ if (includeOrSkipImages == IncludeImagesInAttributedString::Yes) {
+ if (startContainer == endContainer && (startOffset == endOffset - 1)) {
+ Node* node = startContainer->childNode(startOffset);
+ if (node && node->hasTagName(imgTag)) {
+ NSFileWrapper* fileWrapper = fileWrapperForElement(toElement(node));
+ NSTextAttachment* attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper];
+ [string appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]];
+ [attachment release];
+ }
}
}
Modified: branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog 2014-12-02 14:03:45 UTC (rev 176634)
@@ -1,3 +1,20 @@
+2014-12-02 Dana Burkart <[email protected]>
+
+ Merge r176412. rdar://problem/18904600
+
+ 2014-11-20 Beth Dakin <[email protected]>
+
+ Invalid message WebPageProxy.DidPerformDictionaryLookup on Google stocks result
+ https://bugs.webkit.org/show_bug.cgi?id=138568
+ -and corresponding-
+ rdar://problem/18904600
+
+ Reviewed by Tim Horton.
+
+ Skip images for lookup.
+ * WebView/WebActionMenuController.mm:
+ (performDictionaryLookupForRange):
+
2014-11-19 Dana Burkart <[email protected]>
Merge r176356. rdar://problem/18996776
Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm 2014-12-02 14:03:45 UTC (rev 176634)
@@ -665,7 +665,7 @@
popupInfo.origin = NSMakePoint(rangeRect.x(), rangeRect.y() + (style.fontMetrics().descent() * frame->page()->pageScaleFactor()));
popupInfo.options = options;
- NSAttributedString *nsAttributedString = editingAttributedStringFromRange(range);
+ NSAttributedString *nsAttributedString = editingAttributedStringFromRange(range, IncludeImagesInAttributedString::No);
RetainPtr<NSMutableAttributedString> scaledNSAttributedString = adoptNS([[NSMutableAttributedString alloc] initWithString:[nsAttributedString string]]);
NSFontManager *fontManager = [NSFontManager sharedFontManager];
Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog 2014-12-02 14:03:45 UTC (rev 176634)
@@ -1,3 +1,20 @@
+2014-12-02 Dana Burkart <[email protected]>
+
+ Merge r176412. rdar://problem/18904600
+
+ 2014-11-20 Beth Dakin <[email protected]>
+
+ Invalid message WebPageProxy.DidPerformDictionaryLookup on Google stocks result
+ https://bugs.webkit.org/show_bug.cgi?id=138568
+ -and corresponding-
+ rdar://problem/18904600
+
+ Reviewed by Tim Horton.
+
+ Skip images for lookup.
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::performDictionaryLookupForRange):
+
2014-11-19 Dana Burkart <[email protected]>
Merge r176374. rdar://problem/18840128
Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (176633 => 176634)
--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2014-12-02 13:33:55 UTC (rev 176633)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2014-12-02 14:03:45 UTC (rev 176634)
@@ -525,7 +525,7 @@
dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y() + (style.fontMetrics().ascent() * pageScaleFactor()));
dictionaryPopupInfo.options = (CFDictionaryRef)options;
- NSAttributedString *nsAttributedString = editingAttributedStringFromRange(range);
+ NSAttributedString *nsAttributedString = editingAttributedStringFromRange(range, IncludeImagesInAttributedString::No);
RetainPtr<NSMutableAttributedString> scaledNSAttributedString = adoptNS([[NSMutableAttributedString alloc] initWithString:[nsAttributedString string]]);