Open Bug 714757 Opened 13 years ago Updated 2 years ago

Need a way to access components of -moz-image-rect values from script


(Core :: DOM: CSS Object Model, defect, P5)





(Reporter: iorsh, Unassigned)



User Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:9.0) Gecko/20100101 Firefox/9.0
Build ID: 20111217093222

Steps to reproduce:

Style: <div style="background-image:-moz-image-rect(url(firefox.jpg), 0%, 50%, 50%, 0%);">test</div>

getComputedStyle(element).getPropertyCSSValue("background-image") returns CSSPrimitiveValue with type CSS_STRING and value "-moz-image-rect(url(firefox.jpg), 0%, 50%, 50%, 0%)", which needs to be further parsed

Expected results:

Expected: return CSSValue with type CSS_CUSTOM (possibly), which gives additional tools. For example CSSCustomValue.subType = CSS_FUNCTION, CSSCustomValue.args = CSSValueList etc.
Component: DOM: Mozilla Extensions → DOM: CSS Object Model
QA Contact: general → style-system
I would rather not make unilateral spec extensions here; please make proposals for how this stuff should work to the CSSOM spec maintainer?

At the moment, the CSSOM spec has no getPropertyCSSValue at all, for what it's worth.  It may be better to remove it and do the sorts of object model stuff people have been talking about for years than making the terrible CSSValue interface limp along.
Summary: -moz-image-rect doesn't produce reasonable CSSValue → -moz-image-rect is not scriptable
I was not really meaning to propose something specific. I only wish to have an interface which would allow direct access to the arguments of -moz-image-rect.
Summary: -moz-image-rect is not scriptable → Need a way to access components of -moz-image-rect values from script
OS: Solaris → All
Hardware: x86 → All
I am confirming this bug, since I recommended it be filed in the first place, and agree that it should be fixed somehow (and at sometime in the future).

bz: Since this sounds more and more like a non-trivial fix--to say the least, I think we should consider making changes to the CSSOM spec, but I don't know how we would start going about that or who we should CC on this bug to start discussing that--or if there is a better forum for this discussion altogether.  Any suggestions?  The only name I can come up with so far on the W3C page for CCSOM is Anne van Kesterel at Opera.
Blocks: 460146
Ever confirmed: true
The right place for CSSOM discussion is probably
Okay, when I have more time, I will draft something and send it off to them.

Maxim: you're welcome to start the discussion before me if I don't get around to it (which is sadly likely).  If you do, just put the w3c mailing archive link ( from here ) in a comment for this bug so all of us can track the discussion: I will do the same if I get around to it first.

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.