[Feature Request] Allow hit testing to support background-image with src(...)
Reported by
ctengc...@gmail.com,
Mar 29 2017
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce the problem: 1. When do hit testing to a dom <img> element, its src url will be given back as a result, but if the image is displayed by applying CSS background-image:src(...) to any DOM elements, hit testing will not be able to get the image's url 2. 3. What is the expected behavior? What went wrong? This drawback mainly affects extensions which depends on src url detecting, such as content blocking/filtering extensions... Did this work before? N/A Does this work in other browsers? N/A Chrome version: 55.0.2883.87 Channel: n/a OS Version: 10.0 Flash Version: Shockwave Flash 24.0 r0
,
Mar 29 2017
Why can you not get the image url from the background-image attribute of "this" inside the onclick handler? Or do you mean something else?
,
Mar 30 2017
I mean the "ContextMenu" & the HitTestResult data structure. Sure, by injecting js, the background-image:src(...) url can be got, but that's not i'm intending for. 2017-03-30 3:01 GMT+08:00 schen… via monorail < monorail+v2.2717106261@chromium.org>:
,
Mar 30 2017
As with existing hit testing, only elements' src attributes (usually an image) can be retrieved. It cannot return the element's absolute serialized xpath or css selector string. 2017-03-30 13:39 GMT+08:00 小鱼儿 <ctengctsh@gmail.com>:
,
Mar 30 2017
Are you referring to the onclick info parameter for context menu entries in the extensions API, described here: https://developer.chrome.com/extensions/contextMenus? It's up to the extensions team, and probably also security, as to whether we expose the background image. It's also ill-defined, in that there could be multiple background images, or SVG.
,
Mar 31 2017
extensions API is used for desktop version, but i'm here mean chromium on android. The use scenario is: user long presses an position:fixed; ad item on a page, and if the item use background-image:src(...) to display ads, then HitTestResult can return the image's url. No, I don't think this is ill-defined, since <picture> may occupy multiple image definitions, but at runtime can only choose one, and this is just a runtime feedback mechanism... 2017-03-30 22:46 GMT+08:00 schen… via monorail < monorail+v2.2717106261@chromium.org>:
,
Apr 7 2017
Not extensions related if this is android. Removing label.
,
Nov 8 2017
,
Nov 8 2017
Do any other browsers return the information you would like?
,
Nov 20 2017
The NextAction date has arrived: 2017-11-20
,
Nov 8
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 10
Closing this. For further action, we would need explicit spec changes or an example of how it works on another browser. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by ranjitkan@chromium.org
, Mar 29 2017