Closed
Bug 1448120
Opened 7 years ago
Closed 7 years ago
Can't use 0 as minimum or maximum integer in schema
Categories
(WebExtensions :: General, enhancement, P3)
WebExtensions
General
Tracking
(firefox61 fixed)
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: Oriol, Assigned: Oriol)
References
Details
Attachments
(2 files)
In `browser.tabs.query`, the index parameter is defined with
"index": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "The position of the tabs within their windows."
},
https://searchfox.org/mozilla-central/rev/c217fbde244344fedfd07b57a740c694a456dbca/browser/components/extensions/schemas/tabs.json#715-720
But the minimum restriction is not enforced due to
return new this(schema, schema.minimum || -Infinity, schema.maximum || Infinity);
https://searchfox.org/mozilla-central/rev/c217fbde244344fedfd07b57a740c694a456dbca/toolkit/components/extensions/Schemas.jsm#1801
Comment hidden (mozreview-request) |
Assignee | ||
Comment 3•7 years ago
|
||
By the way, StringType's maxLength and ArrayType's maxItems are also affected. But since string and array lengths can't be negative, enforcing a maximum of 0 seems pointless. So they might not be worth fixing.
https://searchfox.org/mozilla-central/rev/c217fbde244344fedfd07b57a740c694a456dbca/toolkit/components/extensions/Schemas.jsm#1391
https://searchfox.org/mozilla-central/rev/c217fbde244344fedfd07b57a740c694a456dbca/toolkit/components/extensions/Schemas.jsm#1860
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8961525 [details]
Bug 1448120 - Allow 0 as minimum or maximum integer in webextension schema
https://reviewboard.mozilla.org/r/230298/#review235908
Attachment #8961525 -
Flags: review?(mixedpuppy) → review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/75aaafadfe9d
Allow 0 as minimum or maximum integer in webextension schema r=mixedpuppy
Keywords: checkin-needed
Comment 6•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Is manual testing required on this bug? If yes, please provide some STR and the proper extension(if required) or set the “qe-verify -“ flag.
Thanks!
Flags: needinfo?(oriol-bugzilla)
Assignee | ||
Comment 8•7 years ago
|
||
(In reply to CosminB from comment #7)
> Is manual testing required on this bug? If yes, please provide some STR and
> the proper extension(if required) or set the “qe-verify -“ flag.
1. Open browser console
2. Install attached extension in about:debugging
In the console you should see a "TEST PASS - got an error" saying that the index -1 should at least be 0.
Before this bug you would get "TEST FAIL - didn't throw".
Flags: needinfo?(oriol-bugzilla)
Updated•7 years ago
|
Flags: qe-verify-
Assignee | ||
Comment 10•7 years ago
|
||
I guess bug 1451334 comment 1 belongs here:
> Unnecessary to have QA, it's covered by a test.
Updated•7 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•