Link preview doesn't work on XHTML pages with Content-Type header as
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 22:34:01 +0000 (22:34 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 22:34:01 +0000 (22:34 +0000)
commitab9141df4e42043a085ad680f2e48cc31cd524d0
treedb22658c925c503010a1b00d34f74b110badff9b
parent4103b5ef1433fb56fc891ab16f71d22738da2ba8
Link preview doesn't work on XHTML pages with Content-Type header as
`application/xhtml+xml`
https://bugs.webkit.org/show_bug.cgi?id=150740
-and corresponding-
rdar://problem/23063585

Reviewed by Darin Adler.

My original fix for this bug was incorrect in the presence of non-HTML
elements that happen to have the same local name as HTML elements. Since it
seems silly to have all of this logic in the UI process to determine whether
to treat something as a link or an image, this patch fixes the bug by adding
isLink and isImage to InteractionInformationAtPosition in order to simplify
everything. The only remaining uses of clickableElementName just use it to
compare against isNull and isEmpty, so that can be a bool too.

Add isLink and isImage, and turn clickableElementName into isClickableElement
* Shared/InteractionInformationAtPosition.cpp:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* Shared/InteractionInformationAtPosition.h:

Use the new isLink, isImage, and isClickableElement
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _actionForLongPress]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):

Set everything correctly.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/InteractionInformationAtPosition.cpp
Source/WebKit2/Shared/InteractionInformationAtPosition.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm