New issue
Advanced search Search tips

Issue 706278 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 10
Components:
EstimatedDays: ----
NextAction: 2017-11-20
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

[Feature Request] Allow hit testing to support background-image with src(...)

Reported by ctengc...@gmail.com, Mar 29 2017

Issue description

UserAgent: 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
 
Labels: Needs-Milestone
Labels: -Type-Bug -Pri-2 -Needs-Milestone BugSource-User PaintTeamTriaged-20170329 Needs-Feedback OS-Android OS-Chrome OS-Linux OS-Mac Pri-3 Type-Feature
NextAction: 2017-04-10
Status: Untriaged (was: Unconfirmed)
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?

Comment 3 by ctengc...@gmail.com, 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>:

Comment 4 by ctengc...@gmail.com, 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>:
Components: -Blink>HitTesting Platform>Extensions>API
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.

Comment 6 by ctengc...@gmail.com, 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>:
Components: -Platform>Extensions>API
Not extensions related if this is android.  Removing label.
Components: Blink>HitTesting
NextAction: 2017-11-20
Status: Available (was: Untriaged)
Do any other browsers return the information you would like?
The NextAction date has arrived: 2017-11-20
Project Member

Comment 11 by sheriffbot@chromium.org, Nov 8

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Status: WontFix (was: Untriaged)
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