WebView: Make hit test results consistent for a failed image
WebView: Make hit test results consistent for a failed image

WebView uses two mechanisms to computing hit test results: focus
change notifications and explicit hit test queries. Both paths use
slightly different logic for computing the final hit test result, which
makes two unit tests fail when the renderer scheduler is enabled.

The main reasons for the failures are: 1) the two hit testing paths
return different results and 2) both paths are being used
simultaneously and the scheduler changes which result 'wins'.

This patch fixes a problem where the two paths diverge if the user
clicked on an image that failed to load. Before, the logic that walks
the DOM finds the URL for the image, while the logic that relies on
Blink's hit testing does not.

With this patch, if Blink fails to give us a valid image URL, we fall
back to walking the DOM to see if there is an image tag under the node
that was hit. This makes the results consistent for both paths.

BUG=444572
TEST=WebKitHitTestTest#testSrcImgeAnchorType*

Review URL: https://codereview.chromium.org/832413002

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#310515}

mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,dednal/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,ltilve/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,M4sse/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,ltilve/chromium,Just-D/chromium-1,dushu1203/chromium.src,dednal/chromium.src,M4sse/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,ltilve/chromium,dednal/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,Just-D/chromium-1,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,ltilve/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,jaruba/chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,dednal/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,jaruba/chromium.src,Just-D/chromium-1,jaruba/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,Just-D/chromium-1