Closed
Bug 487023
Opened 16 years ago
Closed 15 years ago
Refactor IsCaseSensitive() into non-virtual inline IsHTML()
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: hsivonen, Assigned: dzbarsky)
References
Details
Attachments
(2 files)
25.51 KB,
patch
|
hsivonen
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
25.20 KB,
patch
|
Details | Diff | Splinter Review |
nsIDocument has virtual PRBool IsCaseSensitive(). The common usage patterns for this method really is that !IsCaseSensitive() means that the document is an HTML document for the purposes of HTML5. Therefore, it would be more intuitive to have a method IsHTML() that returned the negation of what IsCaseSensitive() now returns.
Moreover, it seems useless that this method is virtual. I seems to me that it could be marginally better for perf to make it a non-virtual inline and to hoist mIsRegularHTML from nsHTMLDocument to nsIDocument.
Also, IsXHTML() on nsHTMLDocument is redundant with IsCaseSensitive() and should probably be refactored into !IsHTML().
Marking as depending on bug 468708, because merge conflicts with landing that one would not be nice.
Assignee | ||
Comment 1•15 years ago
|
||
Attachment #391265 -
Flags: review?
Assignee | ||
Updated•15 years ago
|
Attachment #391265 -
Flags: review? → review?(hsivonen)
Reporter | ||
Comment 2•15 years ago
|
||
Comment on attachment 391265 [details] [diff] [review]
Patch
> // XXXbz should mIsRegularHTML be reset if someone manually calls
> // SetContentType() on this document?
Per HTML5, the only way to change the HTMLness flag is to call document.open() on a Document object.
> if (IsHTML())
> return nsStyleSet::eHTMLPresHintSheet;
I'd use curly braces around the second line even though it is a single-statement block.
> if (IsHTML())
> rv = GetElementsByTagName(NS_LITERAL_STRING("frameset"),
> getter_AddRefs(nodeList));
> else
Curly braces would be good here, too.
With those curly braces, r=hsivonen. Thanks for fixing this!
Attachment #391265 -
Flags: review?(hsivonen) → review+
Reporter | ||
Comment 3•15 years ago
|
||
Comment on attachment 391265 [details] [diff] [review]
Patch
Actually, I'm not sure if I'm authorized to grant an r+ on this code. I'll check.
Attachment #391265 -
Flags: review+ → review?(hsivonen)
Reporter | ||
Comment 4•15 years ago
|
||
Comment on attachment 391265 [details] [diff] [review]
Patch
I checked. You should still get an sr from a content module peer before pushing to m-c.
Attachment #391265 -
Flags: review?(hsivonen) → review+
Assignee | ||
Updated•15 years ago
|
Attachment #391265 -
Flags: superreview?(jst)
Updated•15 years ago
|
Attachment #391265 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 5•15 years ago
|
||
Comment 6•15 years ago
|
||
Assignee: nobody → dzbarsky
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
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
•