Closed
Bug 555711
Opened 15 years ago
Closed 15 years ago
nsAttrValue::ParseNonNegativeIntValue should return PR_FALSE when the value is not valid
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: mounir, Assigned: mounir)
Details
Attachments
(1 file, 2 obsolete files)
1.94 KB,
patch
|
Details | Diff | Splinter Review |
At the moment, if the value could not be parsed, it returns PR_FALSE but if the value is not valid (< 0), it is returning PR_TRUE. This can lead to issues like we got in bug 551846 (see comments 27 and 29).
NS_IMPL_NON_NEGATIVE_INT_ATTR_DEFAULT_VALUE should manage the default value alone we do not need to manage that in the parsing function.
"content/html/content/test/test_bug536891.html" is the test to check regressions.
Attachment #435613 -
Flags: review?(Olli.Pettay)
Comment 1•15 years ago
|
||
Comment on attachment 435613 [details] [diff] [review]
Patch v0.1
Could you update test_bug536891.html to test also that getAttribute does the right thing.
Something like :
>+ var nonNumericValue = 'non-numerical-value';
>+ element.setAttribute('maxLength', nonNumericValue);
>- element.setAttribute('maxLength', 'non-numerical-value');
> is(element.maxLength, -1, "non-numerical value should be considered invalid and represented as -1");
>+ is(element.getAttribute('maxlength'), nonNumericValue, "getAttribute should ");
If you add that to the test, r=me.
Attachment #435613 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 2•15 years ago
|
||
r=smaug
Boris, may you sr this small patch ?
Attachment #435613 -
Attachment is obsolete: true
Attachment #435957 -
Flags: superreview?(bzbarsky)
Assignee | ||
Comment 3•15 years ago
|
||
Olli, can we consider your previous review as an sr or I need to wait from a sr even for a so small patch ? It looks like everyone is busy with reviews....
Comment 4•15 years ago
|
||
Comment on attachment 435957 [details] [diff] [review]
Patch v0.1.1
I don't think this small patches (which aren't really API changes) need sr.
Attachment #435957 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 5•15 years ago
|
||
Comment on attachment 435957 [details] [diff] [review]
Patch v0.1.1
fwiw, the test changes don't make sense. The getAttribute test should be for -2147483648, not for "non-numerical-value". The code change looks fine to me, though.
Assignee | ||
Comment 6•15 years ago
|
||
r=smaug
I think no additional tests was actually needed. The change has been made for negative value and the tests are already checking getAttribute for '-15'. No need to use PR_INT32_MIN.
Still waiting for checkin.
Attachment #435957 -
Attachment is obsolete: true
Assignee | ||
Comment 7•15 years ago
|
||
Could someone checkin this patch before it bitrots ?
Comment 8•15 years ago
|
||
Updated•15 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 9•15 years ago
|
||
Status hasn't been updated.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•