Closed
Bug 276959
Opened 20 years ago
Closed 20 years ago
get rid of nsIHTMLContent
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: bryner, Assigned: bryner)
Details
Attachments
(2 files)
|
144.84 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
|
5.70 KB,
patch
|
bryner
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
It's not really necessary for us to have nsIHTMLContent. The interface isn't used outside of gklayout, so the implementations can just move onto nsGenericHTMLElement, and everything except GetAttributeMappingFunction can become non-virtual. (I'd like to do the same with nsIXMLContent and nsIStyledContent)
| Assignee | ||
Comment 1•20 years ago
|
||
Pretty much what I described above. The relatively few callers that need to deal with the nsIHTMLContent methods now use nsGenericHTMLElement directly. Rather than put an IID on nsGenericHTMLElement, I added a method that does an IsContentOfType check and cast, which should be more efficient than QI because it doesn't addref. I went ahead and changed GetAttributeMappingFunction to just return the function pointer, since this method never fails. I replaced some code in nsHTMLSelectElement with what I belive to be much simpler code that does the same thing. Same goes for nsIsIndexFrame and nsTextControlFrame. Hopefully there's not some subtle behavior here that I'm missing...
| Assignee | ||
Updated•20 years ago
|
Attachment #170221 -
Flags: superreview?(jst)
Attachment #170221 -
Flags: review?(jst)
also note bug 236476
Oh, and like so much else MaybeTriggerAutoLink could probably be replaced by a proper fix for bug 239152
Comment 4•20 years ago
|
||
(In reply to comment #0) > (I'd like to do the same with nsIXMLContent and nsIStyledContent) Another one is nsIXULContent. It's used in one place outside content (http://lxr.mozilla.org/seamonkey/source/widget/src/mac/nsDragService.cpp#144), and that can easily be switched to nsIContent and IsContentOfType(eXUL).
Comment 5•20 years ago
|
||
Comment on attachment 170221 [details] [diff] [review] patch - In nsHTMLSharedElement::GetAttributeMappingFunction() - else if (mNodeInfo->Equals(nsHTMLAtoms::spacer)) { - aMapRuleFunc = &SpacerMapAttributesIntoRule; + if (mNodeInfo->Equals(nsHTMLAtoms::spacer)) { + return &SpacerMapAttributesIntoRule; } else if (mNodeInfo->Equals(nsHTMLAtoms::dir) || mNodeInfo->Equals(nsHTMLAtoms::menu)) { Get rid of this else-after-return as well. r+sr=jst with that change. Looks good.
Attachment #170221 -
Flags: superreview?(jst)
Attachment #170221 -
Flags: superreview+
Attachment #170221 -
Flags: review?(jst)
Attachment #170221 -
Flags: review+
| Assignee | ||
Comment 6•20 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 7•20 years ago
|
||
Changing the type of mCurrentForm saves code. Either of you feel free to r+sr this if you like it that much ;-)
Updated•20 years ago
|
Attachment #171165 -
Flags: superreview?(jst)
Attachment #171165 -
Flags: review?(bryner)
Comment 8•20 years ago
|
||
Doesn't that cause an extra QI on every SetForm call instead of just one QI up front?
| Assignee | ||
Comment 9•20 years ago
|
||
Comment on attachment 171165 [details] [diff] [review] Correct fix for QI error Yeah, that's fine too. Yet another idea would be to declare nsHTMLFormElement outside of the .cpp file, so this code can see that it inherits nsIDOMHTMLFormElement, then either make NS_NewHTMLFormElement return that pointer type or cast the result to it. Probably doesn't matter that much.
Attachment #171165 -
Flags: review?(bryner) → review+
Comment 10•20 years ago
|
||
Comment on attachment 171165 [details] [diff] [review] Correct fix for QI error sr=jst
Attachment #171165 -
Flags: superreview?(jst) → superreview+
Comment 11•20 years ago
|
||
Attachment 171165 [details] [diff] checked in, thanks.
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•