Closed Bug 1355779 Opened 3 years ago Closed 3 years ago

Skip interned nsHtml5ElementName lookup for Custom Elements (ones with hyphen)

Categories

(Core :: DOM: HTML Parser, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(1 file)

No description provided.
Attachment #8857435 - Flags: review?(wchen)
Comment on attachment 8857435 [details]
Bug 1355779 - Skip interned nsHtml5ElementName lookup for Custom Elements (ones with hyphen).

https://reviewboard.mozilla.org/r/129436/#review133528

::: parser/html/javasrc/ElementName.java:233
(Diff revision 2)
>  //    private String constName() {
>  //        char[] buf = new char[name.length()];
>  //        for (int i = 0; i < name.length(); i++) {
>  //            char c = name.charAt(i);
>  //            if (c == '-') {
>  //                buf[i] = '_';

How about we change this to an assertion so that we don't accidentially try to add any names with hyphens to the generated interned names.
Attachment #8857435 - Flags: review?(wchen) → review+
Comment on attachment 8857435 [details]
Bug 1355779 - Skip interned nsHtml5ElementName lookup for Custom Elements (ones with hyphen).

https://reviewboard.mozilla.org/r/129436/#review133528

> How about we change this to an assertion so that we don't accidentially try to add any names with hyphens to the generated interned names.

Used an explicit `RuntimeException` instead so that it doesn't go unnoticed when running without assertions enabled.
Comment on attachment 8857435 [details]
Bug 1355779 - Skip interned nsHtml5ElementName lookup for Custom Elements (ones with hyphen).

https://reviewboard.mozilla.org/r/129436/#review133890
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/64a25d9841b0
Skip interned nsHtml5ElementName lookup for Custom Elements (ones with hyphen). r=wchen
https://hg.mozilla.org/projects/htmlparser/rev/c9e55b93adf0cd33456b9f02fbe1360b8cc95336
Mozilla bug 1355779 - Skip interned ElementName lookup for Custom Elements (ones with hyphen). r=wchen.
https://hg.mozilla.org/mozilla-central/rev/64a25d9841b0
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.