Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Force dictionary popup to use overlay type
<rdar://problem/9052483>
https://bugs.webkit.org/show_bug.cgi?id=55337

Reviewed by Dan Bernstein.

* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup): As this is only
used for the hot key version of the dictionary popup, force the overlay
style.



Canonical link: https://commits.webkit.org/69756@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
weinig committed Feb 28, 2011
1 parent fffc71e commit 472f906
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,16 @@
2011-02-27 Sam Weinig <sam@webkit.org>

Reviewed by Dan Bernstein.

Force dictionary popup to use overlay type
<rdar://problem/9052483>
https://bugs.webkit.org/show_bug.cgi?id=55337

* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup): As this is only
used for the hot key version of the dictionary popup, force the overlay
style.

2011-02-27 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Kenneth Rohde Christiansen.
Expand Down
5 changes: 4 additions & 1 deletion Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Expand Up @@ -421,7 +421,10 @@ - (void)redoEditing:(id)sender
RetainPtr<NSMutableAttributedString> attributedString(AdoptNS, [[NSMutableAttributedString alloc] initWithString:nsStringFromWebCoreString(text)]);
[attributedString.get() addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, [attributedString.get() length])];

[m_wkView showDefinitionForAttributedString:attributedString.get() atPoint:textInfo.baselineOrigin];
NSPoint textBaselineOrigin = textInfo.baselineOrigin;

NSDictionary *options = [NSDictionary dictionaryWithObject:NSDefinitionPresentationTypeOverlay forKey:NSDefinitionPresentationTypeKey];
[m_wkView showDefinitionForAttributedString:attributedString.get() range:NSMakeRange(0, [attributedString.get() length]) options:options baselineOriginProvider:^(NSRange adjustedRange) { return (NSPoint)textBaselineOrigin; }];
}

} // namespace WebKit

0 comments on commit 472f906

Please sign in to comment.