Closed Bug 5818 Opened 25 years ago Closed 25 years ago

problems setting properties via DOM over other properties

Categories

(Core :: DOM: Core & HTML, defect, P3)

Other
Other
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: dbaron, Assigned: peterl-retired)

References

()

Details

Attachments

(3 files)

This is DOM Level 2 (but that's not an official Component): If the font property is set in a given ruleset in the stylesheet, and then I set font-family through the DOM, the change doesn't do anything. If I instead set font-family (and other longhand properties), things are fine. As I said on www-dom, I think the statement now in Interface CSS2Properties on shorthand properties should really be in setProperty and getPropertyValue. If you go with that statement, this behavior is wrong. Examples to be attached, both working and broken, since I'm going to change the original page.
Aargh. It has nothing to do with the shorthand properties. I didn't do what I thought I did when I was testing. It just doesn't work if the property is already set in the element, whether shorthand or longhand. Once this is fixed, you might want to use these examples to test the shorthand properties, though. I'll still make the other attachments.
Summary: problems setting longhand properties over shorthand properties → problems setting properties via DOM over other properties
One last thing - to see the problem, type in a font name that is on your system, and hit the "Display" button.
Status: NEW → ASSIGNED
Cc:ing Peter Linss. I'll take a look at it and see if there's anything I can do before passing it on to Peter (who's away for the next 2 weeks).
Assignee: vidur → peterl
Status: ASSIGNED → NEW
Passing this along to Peter since it's a style system problem and I swamped with my own.
QA Contact: 4015 → 4120
Status: NEW → ASSIGNED
Target Milestone: M9
Component: DOM Level 1 → DOM Level 2
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
The bug here is in the test case's script. The section: var j = 0; while ( ( i < styleSheet.cssRules.length ) && (styleSheet.cssRules.item(j).type == 1) && (styleSheet.cssRules.item(j).selectorText == cssSelector)) { j++; } should really be: var j = 0; while ( ( j < styleSheet.cssRules.length ) && (styleSheet.cssRules.item(j).type == 1) && (styleSheet.cssRules.item(j).selectorText != cssSelector)) { j++; } Note the wrong index variable and reversed equality test of selectors. The script is simply setting the font on the wrong style rule "div.contain" rather than "div.contain p" so the setting is being overridden by the "div.contain p" rule. This can be verified by dumping the style sheets in viewer
Status: RESOLVED → VERIFIED
Verified invalid, including the original report on shorthand properties.
Component: DOM Level 2 → DOM Other
Component: DOM Other → DOM Level 1
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: