Changeset 187299 in webkit
- Timestamp:
- Jul 23, 2015, 11:29:28 PM (11 years ago)
- Location:
- branches/safari-601.1-branch/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (2 diffs)
-
WebProcess/WebPage/ios/WebPageIOS.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-601.1-branch/Source/WebKit2/ChangeLog
r187297 r187299 1 2015-07-23 Lucas Forschler <lforschler@apple.com> 2 3 Merge r187117 4 5 2015-07-21 Tim Horton <timothy_horton@apple.com> 6 7 [iOS] Avoid using a TextIndicator if there are non-text things to indicate 8 https://bugs.webkit.org/show_bug.cgi?id=147152 9 <rdar://problem/21921061> 10 11 Reviewed by Beth Dakin. 12 13 * UIProcess/ios/WKContentViewInteraction.mm: 14 (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): 15 * WebProcess/WebPage/ios/WebPageIOS.mm: 16 (WebKit::shouldUseTextIndicatorForLink): 17 (WebKit::WebPage::getPositionInformation): 18 Fall back to a rectangular area instead of a TextIndicator if there are any 19 non-inline elements inside the link. 20 1 21 2015-07-23 Lucas Forschler <lforschler@apple.com> 2 22 -
branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r187291 r187299 3322 3322 [_previewIndicatorView removeFromSuperview]; 3323 3323 3324 float deviceScaleFactor = _page->deviceScaleFactor(); 3325 3324 3326 RefPtr<Image> image = _positionInformation.linkIndicator.contentImage; 3325 3327 if (!image) { 3326 [[viewController presentationController] setSourceRect:_positionInformation.bounds]; 3328 IntRect sourceRect = _positionInformation.bounds; 3329 const float marginInPoints = 4; 3330 sourceRect.inflate(marginInPoints * deviceScaleFactor); 3331 [[viewController presentationController] setSourceRect:sourceRect]; 3327 3332 [[viewController presentationController] setSourceView:self]; 3328 3333 return; … … 3332 3337 _previewIndicatorView = adoptNS([[UIImageView alloc] initWithImage:indicatorImage.get()]); 3333 3338 3334 float deviceScaleFactor = _page->deviceScaleFactor();3335 3339 const float cornerRadiusInPoints = 5; 3336 3340 Path path = PathUtilities::pathWithShrinkWrappedRects(_positionInformation.linkIndicator.textRectsInBoundingRectCoordinates, cornerRadiusInPoints * deviceScaleFactor); -
branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r187070 r187299 64 64 #import <WebCore/HTMLElementTypeHelpers.h> 65 65 #import <WebCore/HTMLFormElement.h> 66 #import <WebCore/HTMLImageElement.h> 66 67 #import <WebCore/HTMLInputElement.h> 67 68 #import <WebCore/HTMLOptGroupElement.h> … … 2107 2108 } 2108 2109 2110 static bool shouldUseTextIndicatorForLink(Element& element) 2111 { 2112 if (element.renderer() && !element.renderer()->isInline()) 2113 return false; 2114 2115 for (auto& child : descendantsOfType<Element>(element)) { 2116 if (child.renderer() && !child.renderer()->isInline()) 2117 return false; 2118 } 2119 2120 return true; 2121 } 2122 2109 2123 void WebPage::getPositionInformation(const IntPoint& point, InteractionInformationAtPosition& info) 2110 2124 { … … 2158 2172 info.image = snapshot->bitmap(); 2159 2173 2160 RefPtr<Range> linkRange = rangeOfContents(*linkElement); 2161 if (linkRange) { 2162 float deviceScaleFactor = corePage()->deviceScaleFactor(); 2163 const float marginInPoints = 4; 2164 RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor); 2165 if (textIndicator) 2166 info.linkIndicator = textIndicator->data(); 2174 if (shouldUseTextIndicatorForLink(*linkElement)) { 2175 RefPtr<Range> linkRange = rangeOfContents(*linkElement); 2176 if (linkRange) { 2177 float deviceScaleFactor = corePage()->deviceScaleFactor(); 2178 const float marginInPoints = 4; 2179 RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor); 2180 if (textIndicator) 2181 info.linkIndicator = textIndicator->data(); 2182 } 2167 2183 } 2168 2184 } else if (element->renderer() && element->renderer()->isRenderImage()) {
Note:
See TracChangeset
for help on using the changeset viewer.