Closed Bug 172199 Opened 22 years ago Closed 22 years ago

properties set to system colors return inconsistent values

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: vladimire, Assigned: glazou)

Details

Attachments

(2 files)

If you set color property to "activeborder" color it will return "activeborder"
in dom.
If you set border-top-color property to the same color it will return "12".
Attached file testcase
glazou, this is all you.  ;)
Assignee: jst → glazman
OS: Windows 2000 → All
Hardware: PC → All
Status: NEW → ASSIGNED
Attached patch patch v1.0Splinter Review
This patch (a) fixes the reported bug
	   (b) adds support for -moz-border-*-colors that were never output

reviews please ?
Comment on attachment 103169 [details] [diff] [review]
patch v1.0

>+      if ((nsnull != theMargin) && (nsnull != theMargin->mBorderColors) &&
>+          (nsnull != theMargin->mBorderColors[index])) {

You don't really need the second level of parentheses there since != has higher
precendence than &&.  However I can see why that would not be clear, but in
this case you can even get rid of the comparisons:

    if (theMargin && theMargin->mBorderColors &&
theMargin->mBorderColors[index])

But since that seems to be the style (ick) then roll with it...

r=caillon
Attachment #103169 - Flags: review+
Comment on attachment 103169 [details] [diff] [review]
patch v1.0

sr=peterv
Attachment #103169 - Flags: superreview+
checked in (trunk, 1.3a)
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
This checkin have added a warning on brad TBox:

+content/html/style/src/nsCSSDeclaration.cpp:5392
+ `PRUint8 index' might be used uninitialized in this function
That's because the compiler is somewhat stupid.
> That's because the compiler is somewhat stupid.

No, not in this case. In this case it's CSS_BOGUS_DEFAULT not being strong
enough - it should do "return NS_ERROR_UNEXPECTED" (or similar) instead of just
"break" - then there would be no warning...
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: