Closed Bug 92618 Opened 23 years ago Closed 23 years ago

int -> roman number code in two places

Categories

(Core :: DOM: HTML Parser, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: bratell, Assigned: harishd)

References

Details

(Keywords: memory-footprint, Whiteboard: [fix in hand])

Attachments

(1 file)

There are code to convert between an integer and a roman number (7 -> VII) in 
both nsBulletFrame.cpp in layout and in nsDTDUtils.cpp in htmlparser. It seems 
to be the exact same code, though the code in nsBulletFrame is a little more 
evolved and uses more modern string apis.

For display, it's the nsBulletFrame code that is used. I don't know when, if 
ever, the nsDTDUtils code is used.

If not, it should be removed. If it's used, the code should be moved to a common 
place.
Keywords: footprint
RomanString is used by GetFormattedString which is used by GetNextValueAsString 
and GetValueAsString in CAbacus. CAbacus is used by 
nsDTDContext::IncrementCounter which is called by CNavDTD::DidHandleStartTag in 
the case of eHTMLTag_counter (what's that?) and by CCounterElement::OpenContext.

So it seems as if the method in htmlparser is used (though I don't know when). 
Left is to move the code to a common place. Where could that be? 
The code is nsDTDUtils got added ( by rickg ) a while back. I barely recall what
it's meant for.

My guess: The code should kick in if you use <counter></counter>. 

Suggestion: We probably need nsLayoutUtils.h under mozilla/layout/base/public
and nsLayoutUtils.cpp under mozilla/layout/base/src and move the common code there.

typo: "The code is nsDTDUtils" should be "The code in nsDTDUtils"
Target Milestone: --- → mozilla1.0
QA Contact: bsharma → moied
Blocks: 104669
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
harish, will this provide a good win for footprint?

asa mass changed milestone to post 1.0.1, but this is one of those bugs on my
footprint improvemnt list...
Cathleen: I doubt a big win. But still worth removing redundant code. Moving to
0.9.8.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: mozilla1.0.1 → mozilla0.9.8
Moved counter related code into DEBUG flag.
Whiteboard: [fix in hand]
Whats the purpose of the patch? Won't this break something?
Daniel: It shouldn't break anything. AFAIK this code shouldn't belong in the
optimized build.
Comment on attachment 61634 [details] [diff] [review]
Patch v1.0 [ Needs testing ]

r=heikki
Attachment #61634 - Flags: review+
Comment on attachment 61634 [details] [diff] [review]
Patch v1.0 [ Needs testing ]

sr=jst
Attachment #61634 - Flags: superreview+
FIXED
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Marking verified patch checked in CVS (Rev 3.368)

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: