Closed Bug 397620 Opened 17 years ago Closed 17 years ago

Validate boolean arguments

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: longsonr, Assigned: longsonr)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) (deleted) — Splinter Review
Should only allow true and false as boolean arguments. 
Add validation along the lines of bug 383685 to catch things like

filter.preserveAlpha.baseVal = 56;
Attachment #282378 - Flags: review?(tor)
Attachment #282378 - Flags: review?(tor) → review+
Attachment #282378 - Flags: superreview?(roc)
Well hang on, XPConnect should not be allowing scripts to set boolean attributes to non-boolean values. That's the real bug here. Right Blake?
Looking at the code, this patch should be unnecessary. Robert (Longson), can you test (e.g. by adding an assertion to nsSVGBoolean::SetBaseValue) to see if that's the case. If not, then XPConnect should be fixed.

It looks to me that bug 383685 arises because the xpidl+XPConnect type system isn't strong enough to catch invalid enumeration values. Boolean values are much easier to validate, however.
Comment on attachment 282378 [details] [diff] [review]
patch

withdrawing sr request while testing
Attachment #282378 - Flags: superreview?(roc)
Attached patch updated patch (deleted) — Splinter Review
I have to admit that despite my best efforts I can't break it :-) If we have the assert then others can try.
Attachment #282378 - Attachment is obsolete: true
Attachment #282539 - Flags: superreview?(roc)
Attachment #282539 - Flags: review?(roc)
Attachment #282539 - Flags: superreview?(roc)
Attachment #282539 - Flags: superreview+
Attachment #282539 - Flags: review?(roc)
Attachment #282539 - Flags: review+
Attachment #282539 - Flags: approval1.9+
checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: