Bug 154908

Summary: Make HTML parser construct custom elements
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, esprehn+autocc, gyuyoung.kim, kangil.han, koivisto
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 154907, 187317    
Attachments:
Description Flags
Adds the support
none
GTK build fix
none
GTK build fix 2 koivisto: review+

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>