Diff
Modified: trunk/Source/WebCore/ChangeLog (192089 => 192090)
--- trunk/Source/WebCore/ChangeLog 2015-11-06 00:38:32 UTC (rev 192089)
+++ trunk/Source/WebCore/ChangeLog 2015-11-06 04:25:39 UTC (rev 192090)
@@ -1,3 +1,18 @@
+2015-11-05 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r192089.
+ https://bugs.webkit.org/show_bug.cgi?id=150966
+
+ This change broke an existing layout test on Yosemite and
+ Mavericks (Requested by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Preview on apple.com/contact with all text selected shows a
+ map"
+ https://bugs.webkit.org/show_bug.cgi?id=150963
+ http://trac.webkit.org/changeset/192089
+
2015-11-05 Tim Horton <[email protected]>
Preview on apple.com/contact with all text selected shows a map
Modified: trunk/Source/WebCore/editing/mac/DictionaryLookup.h (192089 => 192090)
--- trunk/Source/WebCore/editing/mac/DictionaryLookup.h 2015-11-06 00:38:32 UTC (rev 192089)
+++ trunk/Source/WebCore/editing/mac/DictionaryLookup.h 2015-11-06 04:25:39 UTC (rev 192090)
@@ -48,12 +48,11 @@
class HitTestResult;
class Range;
-class VisiblePosition;
class VisibleSelection;
class DictionaryLookup {
public:
- WEBCORE_EXPORT static PassRefPtr<Range> rangeForSelection(const VisibleSelection&, const VisiblePosition& hitPosition, NSDictionary **options);
+ WEBCORE_EXPORT static PassRefPtr<Range> rangeForSelection(const VisibleSelection&, NSDictionary **options);
WEBCORE_EXPORT static PassRefPtr<Range> rangeAtHitTestResult(const HitTestResult&, NSDictionary **options);
WEBCORE_EXPORT static NSString *stringForPDFSelection(PDFSelection *, NSDictionary **options);
Modified: trunk/Source/WebCore/editing/mac/DictionaryLookup.mm (192089 => 192090)
--- trunk/Source/WebCore/editing/mac/DictionaryLookup.mm 2015-11-06 00:38:32 UTC (rev 192089)
+++ trunk/Source/WebCore/editing/mac/DictionaryLookup.mm 2015-11-06 04:25:39 UTC (rev 192090)
@@ -65,7 +65,7 @@
return selectedRange->contains(position);
}
-PassRefPtr<Range> DictionaryLookup::rangeForSelection(const VisibleSelection& selection, const VisiblePosition& hitPosition, NSDictionary **options)
+PassRefPtr<Range> DictionaryLookup::rangeForSelection(const VisibleSelection& selection, NSDictionary **options)
{
RefPtr<Range> selectedRange = selection.toNormalizedRange();
if (!selectedRange)
@@ -82,23 +82,12 @@
int lengthToSelectionEnd = TextIterator::rangeLength(makeRange(paragraphStart, selectionEnd).get());
NSRange rangeToPass = NSMakeRange(lengthToSelectionStart, lengthToSelectionEnd - lengthToSelectionStart);
- RefPtr<Range> fullRange = makeRange(paragraphStart, paragraphEnd);
- if (!fullRange)
- return nullptr;
+ String fullPlainTextString = plainText(makeRange(paragraphStart, paragraphEnd).get());
- String fullPlainTextString = plainText(fullRange.get());
-
BEGIN_BLOCK_OBJC_EXCEPTIONS;
// Since we already have the range we want, we just need to grab the returned options.
- if (Class luLookupDefinitionModule = getLULookupDefinitionModuleClass()) {
- NSRange extractedRange = [luLookupDefinitionModule tokenRangeForString:fullPlainTextString range:rangeToPass options:options];
- if (extractedRange.location == NSNotFound)
- return nullptr;
-
- RefPtr<Range> lookupRange = TextIterator::subrange(fullRange.get(), extractedRange.location, extractedRange.length);
- if (!lookupRange || (hitPosition.isNotNull() && !lookupRange->contains(hitPosition)))
- return nullptr;
- }
+ if (Class luLookupDefinitionModule = getLULookupDefinitionModuleClass())
+ [luLookupDefinitionModule tokenRangeForString:fullPlainTextString range:rangeToPass options:options];
END_BLOCK_OBJC_EXCEPTIONS;
return selectedRange.release();
@@ -129,10 +118,8 @@
// If we hit the selection, use that instead of letting Lookup decide the range.
VisibleSelection selection = frame->page()->focusController().focusedOrMainFrame().selection().selection();
- if (selectionContainsPosition(position, selection)) {
- if (auto rangeForSelection = DictionaryLookup::rangeForSelection(selection, position, options))
- return rangeForSelection;
- }
+ if (selectionContainsPosition(position, selection))
+ return DictionaryLookup::rangeForSelection(selection, options);
VisibleSelection selectionAccountingForLineRules = VisibleSelection(position);
selectionAccountingForLineRules.expandUsingGranularity(WordGranularity);
Modified: trunk/Source/WebKit2/ChangeLog (192089 => 192090)
--- trunk/Source/WebKit2/ChangeLog 2015-11-06 00:38:32 UTC (rev 192089)
+++ trunk/Source/WebKit2/ChangeLog 2015-11-06 04:25:39 UTC (rev 192090)
@@ -1,3 +1,18 @@
+2015-11-05 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r192089.
+ https://bugs.webkit.org/show_bug.cgi?id=150966
+
+ This change broke an existing layout test on Yosemite and
+ Mavericks (Requested by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Preview on apple.com/contact with all text selected shows a
+ map"
+ https://bugs.webkit.org/show_bug.cgi?id=150963
+ http://trac.webkit.org/changeset/192089
+
2015-11-05 Tim Horton <[email protected]>
Preview on apple.com/contact with all text selected shows a map
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (192089 => 192090)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2015-11-06 00:38:32 UTC (rev 192089)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm 2015-11-06 04:25:39 UTC (rev 192090)
@@ -519,7 +519,7 @@
void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection& selection, TextIndicatorPresentationTransition presentationTransition)
{
NSDictionary *options = nil;
- RefPtr<Range> selectedRange = DictionaryLookup::rangeForSelection(selection, { }, &options);
+ RefPtr<Range> selectedRange = DictionaryLookup::rangeForSelection(selection, &options);
if (selectedRange)
performDictionaryLookupForRange(frame, *selectedRange, options, presentationTransition);
}