WebPlatformForEmbedded / WPEWebKit

WPE WebKit port (downstream)
210 stars 135 forks source link

[wpe-2.38] HTML5 tests - HTML 'intput' element doesn't handle 'type' attr correctly #1362

Closed asurdej-comcast closed 3 days ago

asurdej-comcast commented 4 days ago

There are couple of HMTL5 tests available in https://html5test.com/ Among different failures there is an issue with handling element. Using types "date", "month", "time", etc always ends up in element.type == "text"

What TC does is:

var element=document.createElement('input');
element.setAttribute('type','date');
var minimal = element.type == 'date'; <<<<<<< element.type here is "text"

element.value = "foobar";
var sanitization = element.value == ''; <<<<<<< element.value is "foobar" (should be empty)

return minimal && sanitization;,

Types that doesn't work are "date", "month", "week", "time", "datetime-local", "color", "datalist" (last two are disabled at compile time I think).

Other types work well like "number", "range", "tel"

The same seems to work fine with PC gtk browser: epiphany-browser 3.36.4 Powered by WebKitGTK 2.38.6

pgorszkowski-igalia commented 3 days ago

It is because in case WPE we don't have enabled DATE_AND_TIME_INPUT_TYPES. For enabling it, you need to implement virtual RefPtr<WebDateTimePicker> createDateTimePicker(WebPageProxy&) = 0; from the PageClient interface in: Source/WebKit/UIProcess/API/wpe/PageClientImpl.h/cpp

asurdej-comcast commented 3 days ago

@pgorszkowski-igalia thanks for your input, I didn't notice DATE_AND_TIME_INPUT_TYPES and INPUT_TYPE_DATE. In such case we can just close this ticket. We don't actually need to support this right now