Closed Bug 154755 Opened 23 years ago Closed 22 years ago

[FIX] Require all values in CSS RGB color rules to be of the same, valid data type

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.2alpha

People

(Reporter: bugmail, Assigned: bzbarsky)

References

()

Details

(Keywords: css1, testcase)

Attachments

(3 files, 2 obsolete files)

In strict mode, only CSS numerical RGB specifications whose three values are of the same data type should be treated as valid. That is, three numbers, or three percentages. Mixtures of numbers and percentages should not be treated as valid CSS.
Blocks: 153699
Keywords: css1
Status: NEW → ASSIGNED
OS: MacOS X → All
Priority: -- → P2
Hardware: Macintosh → All
Target Milestone: --- → Future
Moreover, invalid data types (real numbers) should not be treated as valid values for numberical RGB specifications. For example, color: rgb(250.5, 0, 0) is not valid CSS and should not result in red text. (David, let me know if I should file a separate bug about this.)
Summary: In strict mode, require all values in CSS RGB color rules to be of the same data type → In strict mode, require all values in CSS RGB color rules to be of the same, valid data type
Attached patch Proposed patch (obsolete) — Splinter Review
This fixes both issues (mixed types and rgb(255.0, 0, 0))
Attached file quirks mode testcase
I guess I'd better take this. ;)
Assignee: dbaron → bzbarsky
Status: ASSIGNED → NEW
Target Milestone: Future → mozilla1.1beta
Summary: In strict mode, require all values in CSS RGB color rules to be of the same, valid data type → [FIX]In strict mode, require all values in CSS RGB color rules to be of the same, valid data type
Should we just say "Expected an integer..." everywhere instead of saying "Expected a number..."?
Keywords: review
Do those English-language strings need to be taken out and put in some localizable strings file?
No. Right now CSS error reporting is a DEBUG-only feature. I plan to make it localizable before it is turned on in release builds (if ever).
I think 1.2alpha is more appropriate milestone.
Target Milestone: mozilla1.1beta → mozilla1.2alpha
Keywords: testcase
Comment on attachment 89677 [details] [diff] [review] Fix some of that error reporting to not report the reverse of what it means. ;) r=glazman
Attachment #89677 - Flags: review+
Can someone give this an sr?
Why should this be only for strict mode? Shouldn't we do this for all modes, and then find out if it actually causes problems (which I somewhat doubt, actually, with the possible exception of 0 vs. % confusion). What do WinIE and MacIE do?
Summary: [FIX]In strict mode, require all values in CSS RGB color rules to be of the same, valid data type → [FIX]In standards mode, require all values in CSS RGB color rules to be of the same, valid data type
MacIE and WinIE behave just like we do (get it wrong in both modes). I would be perfectly happy with doing this in both modes myself. glazou?
Be strict in all modes. I doubt any important pages are being affected by this.
Attachment #89677 - Attachment is obsolete: true
Comment on attachment 97934 [details] [diff] [review] So let it be written. seriously, this should carry forward r= from the previous patch. r=glazman anyway
Attachment #97934 - Flags: review+
Comment on attachment 97934 [details] [diff] [review] So let it be written. sr=dbaron
Attachment #97934 - Flags: superreview+
Keywords: reviewapproval
Summary: [FIX]In standards mode, require all values in CSS RGB color rules to be of the same, valid data type → [FIX] Require all values in CSS RGB color rules to be of the same, valid data type
checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: