Bug 165331 - Make a public facing page to check for WebKit features
Summary: Make a public facing page to check for WebKit features
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-12-02 13:44 PST by Dean Jackson
Modified: 2016-12-02 17:21 PST (History)
1 user (show)

See Also:


Attachments
Patch (6.36 KB, patch)
2016-12-02 13:51 PST, Dean Jackson
graouts: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2016-12-02 13:44:58 PST
Make a public facing page to check for WebKit features
Comment 1 Radar WebKit Bug Importer 2016-12-02 13:49:59 PST
<rdar://problem/29488535>
Comment 2 Dean Jackson 2016-12-02 13:51:18 PST
Created attachment 295990 [details]
Patch
Comment 3 Antoine Quint 2016-12-02 14:24:47 PST
Comment on attachment 295990 [details]
Patch

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

> Websites/webkit.org/experimental-features.html:79
> +    return canvas.getContext("webgl2");

Either make this a one-liner or use `const`.

> Websites/webkit.org/experimental-features.html:111
> +    Array.from(document.querySelectorAll(".test")).forEach(element => {

you can just use `for … of` to iterate these items.

> Websites/webkit.org/experimental-features.html:114
> +            element.classList.add(testFunction() ? "enabled" : "disabled");

If you used a single class, and assume the absence of it is the inverse, then you could just do `element.classList.toggle("enabled", testFunction())`.
Comment 4 Dean Jackson 2016-12-02 16:32:22 PST
Comment on attachment 295990 [details]
Patch

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

>> Websites/webkit.org/experimental-features.html:79
>> +    return canvas.getContext("webgl2");
> 
> Either make this a one-liner or use `const`.

ok

>> Websites/webkit.org/experimental-features.html:111
>> +    Array.from(document.querySelectorAll(".test")).forEach(element => {
> 
> you can just use `for … of` to iterate these items.

cool

>> Websites/webkit.org/experimental-features.html:114
>> +            element.classList.add(testFunction() ? "enabled" : "disabled");
> 
> If you used a single class, and assume the absence of it is the inverse, then you could just do `element.classList.toggle("enabled", testFunction())`.

There are three states: enabled, disabled and unknown.
Comment 5 Dean Jackson 2016-12-02 17:21:20 PST
Committed r209287: <http://trac.webkit.org/changeset/209287>