createElement should do ASCII lowercasing

RESOLVED FIXED in mozilla13

Status

()

RESOLVED FIXED
8 years ago
6 years ago

People

(Reporter: bzbarsky, Assigned: ehoogeveen)

Tracking

Trunk
mozilla13
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

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?
(Reporter)

Updated

8 years ago
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.
(Reporter)

Comment 2

8 years ago
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.
(Reporter)

Comment 5

6 years ago
This got fixed in bug 492931.
Assignee: bzbarsky → emanuel.hoogeveen
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Depends on: 492931
Priority: P3 → --
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.