Closed Bug 137686 Opened 24 years ago Closed 15 years ago

getPropertyPriority does not work for shorthand properties

Categories

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

x86
All
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: bzbarsky, Assigned: dbaron)

Details

(Keywords: testcase, Whiteboard: Spec clarification needed)

Attachments

(1 file)

nsDOMCSSDeclaration::GetPropertyPriority uses nsCSSDeclaration::GetValueIsImportant, which uses nsCSSDeclaration::GetValue, which does not handle shorthand properties. So the priority of a shorthand property always seems to be "normal". Since a shorthand can fail to have a well-defined priority, I feel that this part of the spec could use some clarification....
Keywords: qawanted
Attached file Simple testcase
Keywords: testcase
oops. This was supposed to go to glazou
Assignee: jst → glazman
Whiteboard: Spec clarification needed
> Since a shorthand can fail to have a well-defined priority, I feel that this > part of the spec could use some clarification.... I disagree with that. A shorthand is "specified" is all the corresponding longhands are set with all same priority. In that case, the priority is the common priority of the longhands. If all corresponding longhands are not set or have different priorities, then the shorthand is not set and its priority has no meaning. Anyway, accepting bug.
Status: NEW → ASSIGNED
Priority: -- → P4
> then the shorthand is not set and its priority has no meaning This is the case I was referring to. In this case, returning "" for the priority seems incorrect. Throwing an exception seems harsh. So the question is, "What is reasonable behavior, and is this something the DOM spec should address? Or should this be implementation-dependent?"
Bulk moving P1-P5 un-milestoned bugs to future.
Target Milestone: --- → Future
QA Contact: ian → general
QA Contact: general → style-system
This was fixed in https://hg.mozilla.org/mozilla-central/rev/7356c512e9e1 to what I consider a reasonable behavior -- we report "important" if all subproperties of the shorthand are set and important, and otherwise we report "". I don't think it's worth having an open bug on this unless there's a specification that says something to the contrary. It may, however, be worth opening a bug on the specification, which is currently http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertypriority
Assignee: daniel → dbaron
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: