Pull "!" inverting operator out of logic in SVG-image rejection code, to make it clearer that it matches the comment

RESOLVED FIXED in Firefox 43

Status

()

Core
SVG
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
mozilla43
Points:
---

Firefox Tracking Flags

(firefox43 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
As noted in bug 693940 comment 37, and bug 693940 comment 39, we've got some code for rejecting SVG images which is the inverse of the comment that describes it.

(The comment describes what's accepted; the code tests for what's rejected.)

This could be made clearer by pulling the "!" out of the code, so that we effectively have:
 if (!(accepted)) {
   reject;

Then it's easier to audit that the code matches the comment.
(Assignee)

Comment 1

2 years ago
[er, somehow ended up with an arbitrary component. Sorry; --> SVG]
Component: Audio/Video: Playback → SVG
(Assignee)

Comment 2

2 years ago
Created attachment 8648503 [details] [diff] [review]
fix v1

So this patch changes:
 if (!A || (!B && !C))
...to:
 if (!(A && (B || C))
...which are be equivalent by the laws of logic and how "!" is applied to a complex expression.
Attachment #8648503 - Flags: review?(longsonr)
(Assignee)

Comment 3

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f3c16ab74123
Attachment #8648503 - Flags: review?(longsonr) → review+

Comment 4

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/1563c2cabdc8
https://hg.mozilla.org/mozilla-central/rev/1563c2cabdc8
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox43: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.