[Webkit-unassigned] [Bug 216985] <input type="datetime-local"> not show calendar UI when it's inside ShadowDOM

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 5 08:33:51 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=216985

Aditya Keerthi <akeerthi at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |akeerthi at apple.com

--- Comment #4 from Aditya Keerthi <akeerthi at apple.com> ---
There are a couple ways to reproduce this issue.

```
let body = document.getElementsByTagName("body")[0];
let template = document.createElement('template');
template.innerHTML = '<input type="date">';
body.appendChild(template.content.cloneNode(true));
```

and

```
let body = document.getElementsByTagName("body")[0];
let doc = document.implementation.createHTMLDocument("New Document");
doc.body = document.createElement("body");
doc.body.innerHTML = '<input type="date">';
body.appendChild(doc.body.childNodes[0]);
```

The common link between these two test cases is the creation of a new Document, without an associated Frame. This results in the Document’s Settings containing default values for all features.

```
m_settings(frame ? Ref<Settings>(frame->settings()) : Settings::create(nullptr))
```

Since the initial value of date input feature flags in Settings.yaml is false, creating an <input type=“date”> element in this kind of Document results in the creation of a TextInputType rather than a DateInputType.

```
Ref<InputType> InputType::create(HTMLInputElement& element, const AtomString& typeName)
{
    if (!typeName.isEmpty()) {
        static const auto factoryMap = makeNeverDestroyed(createInputTypeFactoryMap());
        auto&& [conditional, factory] = factoryMap.get().get(typeName);
        if (factory && (!conditional || std::invoke(conditional, element.document().settings())))
            return factory(element);
    }
    return adoptRef(*new TextInputType(element));
}
```

This regression was caused by r263977, which moved date input feature flags from RuntimeEnabledSettings into page Settings.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201005/96d5ee44/attachment.htm>


More information about the webkit-unassigned mailing list