DevTools - Image tooltip shows with -moz-binding urls

NEW
Unassigned

Status

()

Firefox
Developer Tools: Inspector
P3
normal
4 years ago
2 years ago

People

(Reporter: ntim, Unassigned)

Tracking

29 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
Seems understandable this way.
(Reporter)

Updated

4 years ago
Flags: needinfo?(pbrosset)
Tim, detailed STR would be nice.

STR:
- Open the Browser Toolbox
- Switch to the inspector
- Locate and select the element with ID="titlebar"
- See in the rule-view that the #titlebar{} selector has a -moz-binding: url('...'); declaration
- Hover over the URL part
=> A tooltip is displayed with "could not load image"
=> No image tooltip should be shown.

Our image URL detection mechanism should be made smarter.
Flags: needinfo?(pbrosset)
The way the image tooltip is attached to URIs in the rule-view today works with mouse-move.
If the hovered target is found to have class "theme-link" and its parent has "ruleview-propertyvalue", then we attach a tooltip.

So it obviously doesn't check if the resource is indeed an image.

I don't see any way, on the client-side, of checking if the URI provided is an image type or not. So one option would be to maintain a black list of CSS properties that should never receive an image tooltip, and then, on top of checking the 2 classNames mentioned earlier, we would also check the property name against this list.

Another option, which avoids having to maintain a list, is to fix bug 932896. With this approach, the client side would remain the same, simply attaching the tooltip to anything that resembles a URI, but then, at mouse-over time, when the image is indeed loaded, the server-side would check the resource type and only return the preview if it is an image.

I think option 2 makes more sense.
Paul? What do you think?
Flags: needinfo?(paul)
Confirmed comment 1 in 29.0a1 (2014-01-21), win 7 x64.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Another type of URL were this is a problem: filter: url('#f5');

Comment 5

4 years ago
(In reply to Patrick Brosset [:pbrosset] [:patrick] from comment #2)
> The way the image tooltip is attached to URIs in the rule-view today works
> with mouse-move.
> If the hovered target is found to have class "theme-link" and its parent has
> "ruleview-propertyvalue", then we attach a tooltip.
> 
> So it obviously doesn't check if the resource is indeed an image.
> 
> I don't see any way, on the client-side, of checking if the URI provided is
> an image type or not. So one option would be to maintain a black list of CSS
> properties that should never receive an image tooltip, and then, on top of
> checking the 2 classNames mentioned earlier, we would also check the
> property name against this list.
> 
> Another option, which avoids having to maintain a list, is to fix bug
> 932896. With this approach, the client side would remain the same, simply
> attaching the tooltip to anything that resembles a URI, but then, at
> mouse-over time, when the image is indeed loaded, the server-side would
> check the resource type and only return the preview if it is an image.
> 
> I think option 2 makes more sense.
> Paul? What do you think?

You fixed bug 932896, so I guess option 2 :)
Flags: needinfo?(paul)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.