Bug 218339

Summary: HTML template element does not respect input type="color"
Product: WebKit Reporter: Daniel Dietrich <cafebab3>
Component: DOMAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: akeerthi, rniwa
Priority: P2    
Version: Safari 14   
Hardware: Mac   
OS: macOS 10.15   
Description Flags
Minimal sample html page to reproduce the bug. none

Description Daniel Dietrich 2020-10-29 07:47:36 PDT
Created attachment 412647 [details]
Minimal sample html page to reproduce the bug.

### Overview

The HTML Content Template element `<template>` does not respect the HTML5 input type="color".
Instead of rendering a color picker, an ordinary input field is shown.

### Steps to Reproduce

Open the attached html file in a Safari browser.

### Actual Results

An input text field is rendered.

### Expected Results

A color picker should be rendered.

### Additional Builds and Platforms

Doesn't occur on current version of Chrome and Firefox.

### Additional Information

Above, we reproduced the bug using a template tag as part of the markup of a html document.

The bug also occurs, when create a template element dynamically using javascript:

    const template = document.createElement('template')
    template.innerHTML = '<input type="color">'
    const fragment = template.content

The bug does not occur when rendering to a div.
The following code can be used as a **workaround** for the bug:

    const div = document.createElement('div')
    div.innerHTML = '<input type="color">'
    const fragment = document.createDocumentFragment()

Here you can find a benchmark that compares the workaround with the canonical solution:



Comment 1 Aditya Keerthi 2020-10-29 17:27:13 PDT
This is a duplicate of https://bugs.webkit.org/show_bug.cgi?id=216985.

It's fixed in Safari Technology Preview 116.

*** This bug has been marked as a duplicate of bug 216985 ***
Comment 2 Daniel Dietrich 2020-10-30 00:42:18 PDT
Awesome, thanks for the fast reply!