Skip to content

Commit

Permalink
Handle (0, 0) ranges from Lookup
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=159062
rdar://problem/26960385

Reviewed by Tim Horton.

Source/WebCore:

* editing/mac/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeAtHitTestResult):
Paper over <https://bugs.webkit.org/show_bug.cgi?id=159063>, which seems too involved
to fix now.

LayoutTests:

* platform/mac/TestExpectations: Unmark the test that was broken due to this.



Canonical link: https://commits.webkit.org/177152@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aproskuryakov committed Jun 23, 2016
1 parent 40bf937 commit 155278c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2016-06-23 Alexey Proskuryakov <ap@apple.com>

Handle (0, 0) ranges from Lookup
https://bugs.webkit.org/show_bug.cgi?id=159062
rdar://problem/26960385

Reviewed by Tim Horton.

* platform/mac/TestExpectations: Unmark the test that was broken due to this.

2016-06-23 Joseph Pecoraro <pecoraro@apple.com>

CSSComputedStyleDeclaration::length should recalculate styles if needed to provide the correct value
Expand Down
3 changes: 0 additions & 3 deletions LayoutTests/platform/mac/TestExpectations
Expand Up @@ -1440,6 +1440,3 @@ webkit.org/b/158889 media/video-controls-show-on-kb-or-ax-event.html [ Pass Fail

# rdar://problem/26950065
[ Sierra+ ] editing/mac/input/unconfirmed-text-navigation-with-page-cache.html [ Skip ]

# rdar://problem/26960385
[ Sierra+ ] editing/mac/dictionary-lookup/dictionary-lookup-input.html [ Failure ]
12 changes: 12 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,15 @@
2016-06-23 Alexey Proskuryakov <ap@apple.com>

Handle (0, 0) ranges from Lookup
https://bugs.webkit.org/show_bug.cgi?id=159062
rdar://problem/26960385

Reviewed by Tim Horton.

* editing/mac/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeAtHitTestResult):
Paper over <https://bugs.webkit.org/show_bug.cgi?id=159063>, which seems too involved
to fix now.

2016-06-23 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: first heap snapshot taken when a page is reloaded happens before the reload navigation
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/editing/mac/DictionaryLookup.mm
Expand Up @@ -141,7 +141,8 @@ static bool selectionContainsPosition(const VisiblePosition& position, const Vis
extractedRange = [luLookupDefinitionModule tokenRangeForString:fullPlainTextString range:rangeToPass options:options];

// This function sometimes returns {NSNotFound, 0} if it was unable to determine a good string.
if (extractedRange.location == NSNotFound)
// FIXME (159063): We shouldn't need to check for zero length here.
if (extractedRange.location == NSNotFound || extractedRange.length == 0)
return nullptr;

return TextIterator::subrange(fullCharacterRange.get(), extractedRange.location, extractedRange.length);
Expand Down

0 comments on commit 155278c

Please sign in to comment.