[Webkit-unassigned] [Bug 150740] Link preview doesn't work on XHTML pages with Content-Type header as `application/xhtml+xml`

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 3 16:55:20 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=150740

--- Comment #16 from Beth Dakin <bdakin at apple.com> ---
(In reply to comment #15)
> Comment on attachment 264713 [details]
> Patch to fix remaining bug, clean things
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=264713&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:2182
> > +            info.clickableElementName = element->localName();
> 
> Can we remove clickableElementName entirely? If not, what code is using it?

Good question. I did consider this, and it is used in two places still. It is not necessarily perfect for either of those places, but isLink() and isImage() are not sufficient substitutes either.

First, it is used very when the _highlightLongPressGestureRecognizer begins to recognize. So long as the clickableElementName is not null, the gesture is allowed. 

Second it is used when the _highlightLongPressGestureRecognizer ends before a normal long press recognizes. At that time, if clickableElementName is not empty, then we will attempt a click at the location. So it is a minor optimization to prevent attempting a click 

> Is the localName usable without knowing that it’s in the HTML namespace, SVG
> namespace, or another? I’d expect it would not be sufficient on its own.

Since it is only used at this time as a way to determine if an element was hit, I believe that the lack of a namespace is not a problem. However, it does bug me that this might not be right if it was used for another purpose, and it bugs me that we store a string to decide whether or not something is an element. Is there ever a time that you could HitTest an Element but it's localName would be null or empty? I don't think there is. Maybe clickableElement should be a bool too.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151104/f45ebd33/attachment.html>


More information about the webkit-unassigned mailing list