Closed Bug 614725 Opened 14 years ago Closed 11 years ago

createElement should do ASCII lowercasing

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: bzbarsky, Assigned: ehoogeveen)

References

Details

The relevant code:

  PRBool needsLowercase = IsHTML() && !IsLowercaseASCII(aTagName);
  nsAutoString lcTagName;
  if (needsLowercase) {
    ToLowerCase(aTagName, lcTagName);
  }

Can we just always call the ASCII ToLowerCase on the input string and be done with it?
Assignee: nobody → bzbarsky
Priority: -- → P3
I don't feel strongly, but whatever we do should be put in Web DOM Core.

The IsLowercaseASCII check definitely feels silly.

If we do always lowercase, it'd make sense to me to hook things up to tables which ensures that svg and mathml elements can be created as well.
Oh, by "always" I meant "whenever IsHTML()".  As in, get rid of the IsLowercaseASCII thing, and change the way we do the lowercasing to do ascii-only.

That said, IsLowercaseASCII was added in bug 566466.  Maybe we have performance data indicating it helps?
I added IsLowercaseASCII because of performance reasons. We want to avoid
extra allocations and memcopying.
Another option would be to change ToLowerCase so that it doesn't always
effectively memcpy.
This got fixed in bug 492931.
Assignee: bzbarsky → emanuel.hoogeveen
Status: NEW → RESOLVED
Closed: 11 years ago
Depends on: 492931
Priority: P3 → --
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.