Open Bug 120943 Opened 23 years ago Updated 2 years ago

style.borderColor: reading/writing the same string can return a different value to the one written

Categories

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

defect

Tracking

()

People

(Reporter: matt, Unassigned)

References

Details

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC) BuildID: 2001122106 Attempting to read and write to the border-color of an element through style.borderColor is odd. You can write a new colour successfully, but you can't read the same value back. Mozilla returns a string with all four sides in: borderColor = "red" returns "red red red red" instead of "red" Reproducible: Always Steps to Reproduce: 1. Set borderColor with a script 2. Attempt to read the value you just set Actual Results: borderColor returns "my_color my_color my_color my_color" where my_color is the color you just specified Expected Results: borderColor should have returned "my_color" since the color of all four sides is identical. Having tried with several short-hand attributes (borderWidth, margin etc.) it seems to be the mozilla standard way of returning these values. The question is whether always returning all four is the sensible thing to do given the discrepancy between setting and reading the attribute. In the testcase essentially identical code produces very different results. This example works as I expected in IE5.1/Mac, so there may be a compatibility issue as well.
Attached file testcase (deleted) —
Related to bug 58638. glazou, your shorthand stuff needs to work for individual properties as well, not just for GetCssText.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: MacOS X → All
Hardware: Macintosh → All
Depends on: 160403
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
Assignee: general → nobody
QA Contact: ian → general
QA Contact: general → style-system
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

Creator:
Created:
Updated:
Size: