Bug 154908 - Make HTML parser construct custom elements
Summary: Make HTML parser construct custom elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 154907 187317
  Show dependency treegraph
 
Reported: 2016-03-01 21:58 PST by Ryosuke Niwa
Modified: 2018-07-04 01:43 PDT (History)
6 users (show)

See Also:


Attachments
Adds the support (48.23 KB, patch)
2016-03-01 22:21 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
GTK build fix (48.20 KB, patch)
2016-03-01 22:33 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
GTK build fix 2 (48.34 KB, patch)
2016-03-01 22:47 PST, Ryosuke Niwa
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2016-03-01 21:58:08 PST
HTML parser should be able to instantiate custom elements.

<rdar://problem/24923735>
Comment 1 Ryosuke Niwa 2016-03-01 22:21:18 PST
Created attachment 272633 [details]
Adds the support
Comment 2 Ryosuke Niwa 2016-03-01 22:33:05 PST
Created attachment 272634 [details]
GTK build fix
Comment 3 Ryosuke Niwa 2016-03-01 22:47:45 PST
Created attachment 272635 [details]
GTK build fix 2
Comment 4 Antti Koivisto 2016-03-02 04:35:30 PST
Comment on attachment 272635 [details]
GTK build fix 2

View in context: https://bugs.webkit.org/attachment.cgi?id=272635&action=review

r=me

> Source/WebCore/html/parser/HTMLConstructionSite.cpp:666
> +    const AtomicString& localName = token->name();

auto&

> Source/WebCore/html/parser/HTMLConstructionSite.cpp:678
> +        if (customElementInterface && UNLIKELY(definitions)) {

Some of these UNLIKELYs seem questionable. I could imagine content where custom element definitions are common.

> Source/WebCore/html/parser/HTMLDocumentParser.cpp:198
> +        if (!newElement) // FIXME: This call to docuemnt() is wrong in some cases.

Spelling 'document'
The comment is too vague, please clarify.
Please move FIXME to a line of its own and use { }

> Source/WebCore/html/parser/HTMLDocumentParser.cpp:201
> +        ASSERT(newElement);

This assert adds no value given the code above.

> Source/WebCore/html/parser/HTMLStackItem.h:105
> +    const AtomicString& namespaceURI = element.get().namespaceURI();

auto&
Comment 5 Ryosuke Niwa 2016-03-02 13:56:37 PST
Committed r197463: <http://trac.webkit.org/changeset/197463>