Closed Bug 107453 Opened 23 years ago Closed 14 years ago

Rarely used HTML element classes should be combined...

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.3final

People

(Reporter: jst, Assigned: jst)

Details

(Whiteboard: [HAVE FIX])

Attachments

(5 files)

There's quite a few HTML element classes in the mozilla code that's not used at
all when loading jrgm's pageload tests, this involves loading 40 top 100 pages,
and should give us a reasonable (but of course not perfect) picture of what code
is commonly used and what's not. When running these tests we don't use any of
these elements:

nsHTMLAppletElement
nsHTMLButtonElement
nsHTMLDelElement
nsHTMLDirectoryElement
nsHTMLEmbedElement
nsHTMLFieldsetElement
nsHTMLInsElement
nsHTMLLabelElement
nsHTMLLegendElement
nsHTMLMenuElement
nsHTMLModElement
nsHTMLObjectElement
nsHTMLOlistElement
nsHTMLOptGroupElement
nsHTMLParamElement
nsHTMLQuoteElement
nsHTMLTableCaptionElement
nsHTMLTableColGroupElement
nsHTMLTableRowElement
nsHTMLTablecolElement
nsHTMLTextareaElement
nsHTMLWbrElement

I've started working on collapsing these unused elements into a few shared
classes that when used will work exactly like the current code at the expence of
a few more vtables on the rarely used element objects.

Patch coming up that collapses nsHTMLTableColGroupElement.cpp and
nsHTMLTableColElement.cpp into nsHTMLTableColElement.cpp, and also
nsTHMLBaseElement.cpp, nsHTMLEmbedElement.cpp, nsHTMLIsIndexElement.cpp,
nsHTMLParamElement.cpp, nsHTMLSpacerElement.cpp and nsHTMLWBRElement.cpp into
nsHTMLSharedLeafElement.cpp. The result of this first step is that we can remove
6 files from the project.
sr=waterson! Go Johnny go!
Dbaron, would you review this (second and last patch)?
Status: NEW → ASSIGNED
Comment on attachment 55649 [details] [diff] [review]
Same as above, excluding deleted files.

>Index: content/html/content/src/nsHTMLInputElement.cpp
>+  nsresult rv = ((nsGenericHTMLElement *)it)->Init(aNodeInfo);
>+  nsresult rv = ((nsGenericHTMLElement *)it)->Init(mNodeInfo);

Could you use NS_STATIC_CAST, like you did in nsHTMLSelectElement.cpp?

r=dbaron (on the last 2 attachments)
Yup, will do. Thanks for the review.
Above patches checked in, more to come...
Is it possible the check-in to this bug is causing the blocker bug 107627?
Yes, this fix caused bug 107627 (which is now fixed).
Target Milestone: --- → mozilla0.9.8
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Keywords: nsbeta1
Fixed, or do we want to keep it open for future similar improvements?
There's more to do here...
Pushing to mozilla1.0
Target Milestone: mozilla0.9.9 → mozilla1.0
Priority: -- → P3
Comment on attachment 89166 [details] [diff] [review]
Combine rarely used container classes...

This patch looks fine, and comparing the methods in the old classes to the new
combined class looks correct as well.

r=caillon with the additional caveat of removing (or actually using) the XXX
comment here:
http://lxr.mozilla.org/mozilla/source/content/html/content/src/nsHTMLSharedCont
ainerElem.cpp#344
Attachment #89166 - Flags: review+
Whiteboard: [HAVE FIX]
Comment on attachment 89166 [details] [diff] [review]
Combine rarely used container classes...

>Index: content/html/content/src/Makefile.in
>===================================================================
>-		nsHTMLDelElement.cpp \
>-		nsHTMLDirectoryElement.cpp \
>-		nsHTMLInsElement.cpp \
>-		nsHTMLMenuElement.cpp \
>-		nsHTMLModElement.cpp \
>-		nsHTMLQuoteElement.cpp \
>+		nsHTMLSharedContainerElem.cpp \
>-		nsHTMLTableCaptionElement.cpp \
>Index: content/html/content/src/makefile.win
>===================================================================
>-	.\$(OBJDIR)\nsHTMLDelElement.obj		\
>-	.\$(OBJDIR)\nsHTMLDirectoryElement.obj		\
>-	.\$(OBJDIR)\nsHTMLInsElement.obj		\
>-	.\$(OBJDIR)\nsHTMLMenuElement.obj		\
>-	.\$(OBJDIR)\nsHTMLModElement.obj		\
>-	.\$(OBJDIR)\nsHTMLOListElement.obj		\
>-	.\$(OBJDIR)\nsHTMLQuoteElement.obj		\
>+	.\$(OBJDIR)\nsHTMLSharedContainerElem.obj	\
>-	.\$(OBJDIR)\nsHTMLTableCaptionElement.obj	\

These two lists above don't match (also check Mac project)???

>Index: content/html/content/src/nsGenericHTMLElement.h
>===================================================================
>+inline nsresult
>+NS_NewHTMLOListElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
>+{
>+  return NS_NewHTMLSharedContainerElement(aResult, aNodeInfo);
>+}

Is OL really a rarely used element? I wouldn't consider it rare, but...

>Index: content/html/content/src/nsHTMLDelElement.cpp
>===================================================================
>Index: content/html/content/src/nsHTMLDirectoryElement.cpp
>===================================================================
>Index: content/html/content/src/nsHTMLInsElement.cpp
>===================================================================
>Index: content/html/content/src/nsHTMLMenuElement.cpp
>===================================================================
>Index: content/html/content/src/nsHTMLModElement.cpp
>===================================================================
>Index: content/html/content/src/nsHTMLOListElement.cpp
>===================================================================
>Index: content/html/content/src/nsHTMLQuoteElement.cpp
>===================================================================
>Index: content/html/content/src/nsHTMLTableCaptionElement.cpp
>===================================================================
>Index: content/macbuild/content.xml
>===================================================================
>Index: content/shared/public/nsHTMLAtomList.h
>===================================================================
Target Milestone: mozilla1.0 → mozilla1.1alpha
Target Milestone: mozilla1.1alpha → mozilla1.3alpha
Target Milestone: mozilla1.3alpha → mozilla1.3final
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Status: ASSIGNED → NEW
Comment on attachment 167388 [details] [diff] [review]
fix regression from col/colgroup combining (checked in to trunk, 2004-11-29 21:52 -0800).

This fixes a regression (perhaps asymptomatic) from attachment 55647 [details] [diff] [review].
Attachment #167388 - Flags: superreview?(bzbarsky)
Attachment #167388 - Flags: review?(jst)
Comment on attachment 167388 [details] [diff] [review]
fix regression from col/colgroup combining (checked in to trunk, 2004-11-29 21:52 -0800).

r+sr=bzbarsky
Attachment #167388 - Flags: superreview?(bzbarsky)
Attachment #167388 - Flags: superreview+
Attachment #167388 - Flags: review?(jst)
Attachment #167388 - Flags: review+
Attachment #167388 - Attachment description: fix regression from col/colgroup combining → fix regression from col/colgroup combining (checked in to trunk, 2004-11-29 21:52 -0800).
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
File followups if we ever want to do more of this.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee: general → jst
Depends on: 1075972
No longer depends on: 1075972
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: