Closed
Bug 209271
Opened 23 years ago
Closed 23 years ago
Dodgy SetCaseSensitive() call in nsDOMCSSAttrDeclaration.cpp
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
mozilla1.5alpha
People
(Reporter: ian, Assigned: bzbarsky)
Details
Attachments
(1 file)
|
1.22 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
nsDOMCSSAttrDeclaration.cpp contains the following code:
// look up our namespace. If we're XHTML, we need to be case-sensitive
// Otherwise, we should not be
(*aCSSParser)->SetCaseSensitive(nodeInfo->NamespaceEquals(kNameSpaceID_XHTML));
This seems wrong. We should be case sensitive in any namespace _other_ than
non-XML HTML, not _just_ case sensitive in the case of XHTML.
Note that IMHO, if the code is relying on some other constant (like, this code
only gets called for XHTML and HTML, but not, e.g., SVG) then a comment should
be added to this effect.
| Assignee | ||
Comment 1•23 years ago
|
||
This code is indeed relying on the fact that it's only called for HTML. That
said, this is a bit safer...
Of course all this only matters when you have a node that can no longer reach
its ownerDocument (so that it's not getting a CSS parser via the loader), which
is kinda hard to arrange... ;)
| Assignee | ||
Comment 2•23 years ago
|
||
Comment on attachment 126105 [details] [diff] [review]
Patch
The other option is to assert that in fact
mContent->IsContentOfType(nsIContent::eHTML)
Attachment #126105 -
Flags: superreview?(dbaron)
Attachment #126105 -
Flags: review?(dbaron)
| Assignee | ||
Comment 3•23 years ago
|
||
.
Assignee: dom_bugs → bzbarsky
OS: Windows 2000 → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla1.5alpha
Attachment #126105 -
Flags: superreview?(dbaron)
Attachment #126105 -
Flags: superreview+
Attachment #126105 -
Flags: review?(dbaron)
Attachment #126105 -
Flags: review+
| Assignee | ||
Comment 4•23 years ago
|
||
fixed.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 5•23 years ago
|
||
+ // If we are not HTML, we need to be case-sensitive. Otherwise, Look up our
+ // namespace. If we're XHTML, we need to be case-sensitive Otherwise, we
+ // should not be
That's still a confusing comment, IMHO. (It requires that you realise that XHTML
is also HTML.)
What about something like "If we are XML, we are case sensitive on all
attributes. Otherwise, we're HTML, and we should only be case sensitive on those
that the HTML spec says are [CS]."
But yeah, whatever. It's only a comment in a rarely used piece of code. :-)
| Assignee | ||
Comment 6•23 years ago
|
||
> (It requires that you realise that XHTML is also HTML.)
If you don't know that about nsIContent objects in Mozilla, you probably should
not be touching this code. ;)
Comment 7•23 years ago
|
||
> What about something like "If we are XML, we are case sensitive on all
> attributes. Otherwise, we're HTML, and we should only be case sensitive on those
Since you're picking comment nits: "... we should be case sensitive only on
those ...."
/be
You need to log in
before you can comment on or make changes to this bug.
Description
•