Changeset 187117 in webkit
- Timestamp:
- Jul 21, 2015, 12:58:02 PM (11 years ago)
- Location:
- trunk/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
-
trunk/Source/WebKit2/ChangeLog
r187115 r187117 1 2015-07-21 Tim Horton <timothy_horton@apple.com> 2 3 [iOS] Avoid using a TextIndicator if there are non-text things to indicate 4 https://bugs.webkit.org/show_bug.cgi?id=147152 5 <rdar://problem/21921061> 6 7 Reviewed by Beth Dakin. 8 9 * UIProcess/ios/WKContentViewInteraction.mm: 10 (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): 11 * WebProcess/WebPage/ios/WebPageIOS.mm: 12 (WebKit::shouldUseTextIndicatorForLink): 13 (WebKit::WebPage::getPositionInformation): 14 Fall back to a rectangular area instead of a TextIndicator if there are any 15 non-inline elements inside the link. 16 1 17 2015-07-21 Andreas Kling <akling@apple.com> 2 18 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r186977 r187117 3332 3332 [_previewIndicatorView removeFromSuperview]; 3333 3333 3334 float deviceScaleFactor = _page->deviceScaleFactor(); 3335 3334 3336 RefPtr<Image> image = _positionInformation.linkIndicator.contentImage; 3335 3337 if (!image) { 3336 [[viewController presentationController] setSourceRect:_positionInformation.bounds]; 3338 IntRect sourceRect = _positionInformation.bounds; 3339 const float marginInPoints = 4; 3340 sourceRect.inflate(marginInPoints * deviceScaleFactor); 3341 [[viewController presentationController] setSourceRect:sourceRect]; 3337 3342 [[viewController presentationController] setSourceView:self]; 3338 3343 return; … … 3342 3347 _previewIndicatorView = adoptNS([[UIImageView alloc] initWithImage:indicatorImage.get()]); 3343 3348 3344 float deviceScaleFactor = _page->deviceScaleFactor();3345 3349 const float cornerRadiusInPoints = 5; 3346 3350 Path path = PathUtilities::pathWithShrinkWrappedRects(_positionInformation.linkIndicator.textRectsInBoundingRectCoordinates, cornerRadiusInPoints * deviceScaleFactor); -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r186978 r187117 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> … … 2144 2145 } 2145 2146 2147 static bool shouldUseTextIndicatorForLink(Element& element) 2148 { 2149 if (element.renderer() && !element.renderer()->isInline()) 2150 return false; 2151 2152 for (auto& child : descendantsOfType<Element>(element)) { 2153 if (child.renderer() && !child.renderer()->isInline()) 2154 return false; 2155 } 2156 2157 return true; 2158 } 2159 2146 2160 void WebPage::getPositionInformation(const IntPoint& point, InteractionInformationAtPosition& info) 2147 2161 { … … 2195 2209 info.image = snapshot->bitmap(); 2196 2210 2197 RefPtr<Range> linkRange = rangeOfContents(*linkElement); 2198 if (linkRange) { 2199 float deviceScaleFactor = corePage()->deviceScaleFactor(); 2200 const float marginInPoints = 4; 2201 RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor); 2202 if (textIndicator) 2203 info.linkIndicator = textIndicator->data(); 2211 if (shouldUseTextIndicatorForLink(*linkElement)) { 2212 RefPtr<Range> linkRange = rangeOfContents(*linkElement); 2213 if (linkRange) { 2214 float deviceScaleFactor = corePage()->deviceScaleFactor(); 2215 const float marginInPoints = 4; 2216 RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor); 2217 if (textIndicator) 2218 info.linkIndicator = textIndicator->data(); 2219 } 2204 2220 } 2205 2221 } else if (element->renderer() && element->renderer()->isRenderImage()) {
Note:
See TracChangeset
for help on using the changeset viewer.