Open Bug 903239 Opened 11 years ago Updated 2 years ago

No way to avoid having to set priority of style properties

Categories

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

24 Branch
Other
Other
defect

Tracking

()

REOPENED

People

(Reporter: pjs.nl, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (masking-agent; rv:17.0) Gecko/17.0 Firefox/17.0 (Nightly/Aurora)
Build ID: 20130804004006

Steps to reproduce:

It is not possible to set a CSSStyleDeclaration property value without setting its property priority. To retrieve this priority an additional function call is normally needed.



Actual results:

The current situation leads to unnecessarily slow low level style transformations in cases where only the property values need to be changed.


Expected results:

For symmetry and speed, the CSSStyleDeclaration interface should be extended with the functions 'setPropertyValue' and 'setPropertyPriority'. (Don't remind me that www.w3.org does not specify these - the point is that they should have).
I recommend mailing www-style@w3.org and making the suggestion there.  Yes, I know you said to not remind you, but that's the right venue for suggesting additions to the behavior here.
Yes, that is the right venue, it just takes one to ten years that way. My recommendation for Mozilla would be to go on pushing for DOM improvements, because its methods can be fast since they are native. (Or perhaps we should be drawing our web content directly on a canvas in order to avoid the DOM altogether).
> it just takes one to ten years that way

It takes as long as UAs will take to implement.

We do not plan to unilaterally ship things like this without coordinating with other UA vendors to make sure they plan to ship as well, so we'd have to bring it up on www-style no matter what.  You're better positioned than I am to do it, because any such discussion will ask for specific use cases, and presumably you have some.
I have brought the issue up on www-style@w3.org - hopefully it will turn up in a new spec some day.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: WONTFIX → ---
The Editor's Draft at http://dev.w3.org/csswg/cssom/ has been changed in response to my requests. It now reads:

> If priority is not specified, let priority action be "leave as is". 

Acceptance of the new spec will resolve this bug.
Assignee: nobody → bzbarsky
Attachment #793695 - Flags: superreview?(dbaron)
I think this is crazy.  The mental mode of setProperty() is equivalent to appending a declaration to the end of the declaration block.  Preserving !important is an obscure use case, and we shouldn't add this footgun.
Comment on attachment 793695 [details] [diff] [review]
part 2.  Make the priority argument to CSSStyleDeclaration.setProperty optional, and treat lack of the argument as preserving the current priority.   s

Also, having asemantic difference between omission andempty string is a really bad idea and likely to confuse authors.
Attachment #793695 - Flags: superreview?(dbaron) → superreview-
Attachment #793694 - Flags: review?(cam)
Attachment #793695 - Flags: review?(cam)
Assignee: bzbarsky → nobody
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

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.

Attachment

General

Created:
Updated:
Size: