Closed
Bug 274698
Opened 20 years ago
Closed 19 years ago
Improve nsSVGLength.cpp
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(1 file, 3 obsolete files)
19.32 KB,
patch
|
tor
:
review+
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•20 years ago
|
||
these are some changes that I'd like to make to this file
Attachment #168752 -
Flags: review?(tor)
Comment on attachment 168752 [details] [diff] [review] patch > /* void newValueSpecifiedUnits (in unsigned short unitType, in float valueInSpecifiedUnits); */ > NS_IMETHODIMP > nsSVGLength::NewValueSpecifiedUnits(PRUint16 unitType, float valueInSpecifiedUnits) > { >+ // We assume unitType != mSpecifiedUnitType since the consumer should use >+ // SetValueInSpecifiedUnits in that case. > >- bool observer_change = (unitType != mSpecifiedUnitType); > /* void convertToSpecifiedUnits (in unsigned short unitType); */ > NS_IMETHODIMP > nsSVGLength::ConvertToSpecifiedUnits(PRUint16 unitType) > { >- if (!IsValidUnitType(unitType)) return NS_ERROR_FAILURE; >- >- bool observer_change = (unitType != mSpecifiedUnitType); I don't think these optimizations should be removed. > float nsSVGLength::AxisLength() > { >- if (d == 0.0f) >- d = 1e-20f; >+ if (d == 0.0f) { >+ NS_ASSERTION(d!=0.0f, "invalid axis length"); >+ d = 1.0f; >+ } >+ > return d; > } Not comfortable with this, as zero is a valid axis length.
Attachment #168752 -
Flags: review?(tor) → review-
Assignee | ||
Comment 3•20 years ago
|
||
Okay, this is what I'd like to do before trying to fix bz's bug. The utility functions that were only called from one place I've moved inline which makes for better error reporting.
Assignee | ||
Updated•20 years ago
|
Attachment #173501 -
Flags: review?(tor)
Assignee | ||
Comment 4•20 years ago
|
||
let's try that again
Attachment #168752 -
Attachment is obsolete: true
Attachment #173501 -
Attachment is obsolete: true
Attachment #173503 -
Flags: review?(tor)
Assignee | ||
Updated•20 years ago
|
Attachment #173501 -
Flags: review?(tor)
Assignee | ||
Updated•20 years ago
|
Attachment #173503 -
Attachment is obsolete: true
Attachment #173503 -
Flags: review?(tor)
Assignee | ||
Comment 5•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #173767 -
Flags: review?(tor)
Attachment #173767 -
Flags: review?(tor) → review+
Assignee | ||
Comment 6•19 years ago
|
||
Checked in. Checking in mozilla/content/svg/content/src/nsSVGLength.cpp; /cvsroot/mozilla/content/svg/content/src/nsSVGLength.cpp,v <-- nsSVGLength.cpp new revision: 1.19; previous revision: 1.18 done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•