Get the features.json files ready for open contributions
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Apr 2015 23:42:16 +0000 (23:42 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Apr 2015 23:42:16 +0000 (23:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143436

Reviewed by Darin Adler.

Source/JavaScriptCore:

* features.json:

Source/WebCore:

* features.json:

Tools:

* Scripts/webkitpy/style/checkers/jsonchecker.py:
(JSONFeaturesChecker.check):
Extend the syntax checking a bit, but leave everything non-mandatory
very loose until we figure what fields are important.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182509 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/features.json
Source/WebCore/ChangeLog
Source/WebCore/features.json
Tools/ChangeLog
Tools/Scripts/webkitpy/style/checkers/jsonchecker.py

index 45d35f3..2d4f81f 100644 (file)
@@ -1,3 +1,12 @@
+2015-04-07  Benjamin Poulain  <benjamin@webkit.org>
+
+        Get the features.json files ready for open contributions
+        https://bugs.webkit.org/show_bug.cgi?id=143436
+
+        Reviewed by Darin Adler.
+
+        * features.json:
+
 2015-04-07  Filip Pizlo  <fpizlo@apple.com>
 
         Constant folding of typed array properties should be handled by AI rather than strength reduction
index 94f8a89..ed63f3b 100644 (file)
@@ -7,6 +7,7 @@
     },
     {
         "name": "ES7",
+        "url": "https://github.com/tc39/ecma262",
         "keywords": ["es7", "ecmascript"]
     }
     ],
index d1aef44..0df6961 100644 (file)
@@ -1,3 +1,12 @@
+2015-04-07  Benjamin Poulain  <benjamin@webkit.org>
+
+        Get the features.json files ready for open contributions
+        https://bugs.webkit.org/show_bug.cgi?id=143436
+
+        Reviewed by Darin Adler.
+
+        * features.json:
+
 2015-04-07  Alex Christensen  <achristensen@webkit.org>
 
         More unreviewed fixing API tests.
index 323a3d4..05e5b79 100644 (file)
@@ -1,10 +1,16 @@
 {
     "specification": [
     {
-        "name": "HTML5",
-        "url": "https://html.spec.whatwg.org",
-        "keywords": ["html", "html5", "html5.1"],
-        "category": "html"
+        "name": "CSS Media Queries Level 4",
+        "url": "http://dev.w3.org/csswg/mediaqueries-4/",
+        "keywords": ["css media queries", "media queries"],
+        "category": "css"
+    },
+    {
+        "name": "CSS Selectors Level 4",
+        "url": "http://dev.w3.org/csswg/selectors-4/",
+        "keywords": ["css selectors", "selectors"],
+        "category": "css"
     },
     {
         "name": "DOM",
         "category": "html"
     },
     {
+        "name": "HTML5",
+        "url": "https://html.spec.whatwg.org",
+        "keywords": ["html", "html5", "html5.1"],
+        "category": "html"
+    },
+    {
         "name": "Streams",
         "url": "https://streams.spec.whatwg.org",
         "keywords": ["streams api"],
         "category": "webapps"
-    },
-    {
-        "name": "CSS Selectors Level 4",
-        "url": "http://dev.w3.org/csswg/selectors-4/",
-        "keywords": ["css selectors", "selectors"],
-        "category": "css"
-    },
-    {
-        "name": "CSS Media Queries Level 4",
-        "url": "http://dev.w3.org/csswg/mediaqueries-4/",
-        "keywords": ["css media queries", "media queries"],
-        "category": "css"
     }
     ],
 
     "features": [
     {
+        "name": "CSS Selector :any-link",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/selectors-4/#the-any-link-pseudo",
+        "specification": "CSS Selectors Level 4",
+        "description": "The pseudo class :any-link matches any element that would match :link or :visisted.",
+        "comment": "A prefix version :-webkit-any-link has been available for a while but it was not 100% compliant to the specification."
+    },
+    {
+        "name": "CSS Selector :lang() level 4",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/selectors-4/#the-lang-pseudo",
+        "specification": "CSS Selectors Level 4",
+        "description": "The selector :lang() is extended in level 4 to support a list of language range, each range can contain a wildcard. For example: p:lang(\"*-be\", \"en\")."
+    },
+    {
+        "name": "CSS Selector :matches()",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/selectors-4/#matches",
+        "specification": "CSS Selectors Level 4",
+        "description": "The selector :matches() takes a selector list as argument and matches an element if any of them matches (e.g. :matches(article > section, #target)). When used for styling, the specificity of :matches() is the higest specificity of all selectors in the selector list.",
+        "comment": "The pseudo classes <em>:visited</em> and <em>:link</em> are not supported inside :matches()."
+    },
+    {
+        "name": "CSS Selector :not() level 4",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/selectors-4/#negation",
+        "specification": "CSS Selectors Level 4",
+        "description": "The selector :not() in level 4 supports full selector lists as argument. For example: :not(:any-link >> img, :any-link >> picture).",
+        "comment": "The pseudo classes <em>:visited</em> and <em>:link</em> are not supported inside :not()."
+    },
+    {
+        "name": "CSS Selector :nth-child(An+B of selector list) and :nth-last-child(An+B of selector list)",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/selectors-4/#the-nth-child-pseudo",
+        "specification": "CSS Selectors Level 4",
+        "description": "The pseudo classes :nth-child() and :nth-last-child() now supports a selector list that filters what to count. For example: \":nth-child(even of .visible)\".",
+        "comment": "The pseudo classes <em>:visited</em> and <em>:link</em> are not supported inside :nth-child() and :nth-last-child()."
+    },
+    {
+        "name": "CSS Selector :placeholder-shown",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/selectors-4/#placeholder",
+        "specification": "CSS Selectors Level 4",
+        "description": "The selector :placeholder-shown matches any input element that has a visible placeholder.",
+        "comment": "Styling the placeholder can be done through the WebKit pseudo-element \"::-webkit-input-placeholder\"."
+    },
+    {
+        "name": "Case-insensitive attribute selectors",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/selectors-4/#attribute-case",
+        "specification": "CSS Selectors Level 4",
+        "description": "Any attribute selector that test a value can take a flag \"i\" to use case insensitive checks. For example: input[type=number i] test the value \"number\" case-insensitively."
+    },
+    {
         "name": "Element.closest()",
         "status": {
             "status": "Done",
         "description": "Provide the events necessary to handle force click events in the page, overriding the default behavior."
     },
     {
+        "name": "Interaction Media Features (pointer, hover, any-pointer, any-hover)",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "http://dev.w3.org/csswg/mediaqueries-4/#mf-interaction",
+        "specification": "CSS Media Queries Level 4",
+        "description": "The \"pointer\" media defines how percise the pointing device is. The \"hover\" media defines the ability of the poiting device to hover elements."
+    },
+    {
+        "name": "Navigator.hardwareConcurrency",
+        "status": {
+            "status": "Done",
+            "enabled-by-default": true
+        },
+        "url": "https://wiki.whatwg.org/wiki/Navigator_HW_Concurrency",
+        "webkit-url": "http://trac.webkit.org/changeset/169017",
+        "description": "Navigator.hardwareConcurrency provides the total number of logical processors available to the user agent."
+    },
+    {
         "name": "Readable Streams",
         "status": {
             "status": "In Development",
             "enabled-by-default": true
         },
         "url": "https://streams.spec.whatwg.org/#rs",
-        "specification": "Streams"
+        "webkit-url": "https://bugs.webkit.org/show_bug.cgi?id=138967",
+        "specification": "Streams",
+        "comment": "The ReadableStream and ReadableStreamReader interfaces are available but not functional."
     }
     ]
 }
\ No newline at end of file
index 678106f..c999867 100644 (file)
@@ -1,3 +1,15 @@
+2015-04-07  Benjamin Poulain  <benjamin@webkit.org>
+
+        Get the features.json files ready for open contributions
+        https://bugs.webkit.org/show_bug.cgi?id=143436
+
+        Reviewed by Darin Adler.
+
+        * Scripts/webkitpy/style/checkers/jsonchecker.py:
+        (JSONFeaturesChecker.check):
+        Extend the syntax checking a bit, but leave everything non-mandatory
+        very loose until we figure what fields are important.
+
 2015-04-07  Tim Horton  <timothy_horton@apple.com>
 
         Expose and test fixedLayoutSize via modern WebKit SPI
index 750ab3c..264e35b 100644 (file)
@@ -24,7 +24,7 @@
 
 import json
 import re
-
+from sets import Set
 
 class JSONChecker(object):
     """Processes JSON lines for checking style."""
@@ -69,12 +69,42 @@ class JSONFeaturesChecker(JSONChecker):
                 self._handle_style_error(0, 'json/syntax', 5, '"features" key not found, the key is mandatory.')
                 return
 
+            specification_name_set = Set()
+            if 'specification' in features_definition:
+                previous_specification_name = ''
+                for specification_object in features_definition['specification']:
+                    if 'name' not in specification_object or not specification_object['name']:
+                        self._handle_style_error(0, 'json/syntax', 5, 'The "name" field is mandatory for specifications.')
+                        continue
+                    name = specification_object['name']
+
+                    if name < previous_specification_name:
+                        self._handle_style_error(0, 'json/syntax', 5, 'The specifications should be sorted alphabetically by name, "%s" appears after "%s".' % (name, previous_specification_name))
+                    previous_specification_name = name
+
+                    specification_name_set.add(name)
+                    if 'url' not in specification_object or not specification_object['url']:
+                        self._handle_style_error(0, 'json/syntax', 5, 'The specifciation "%s" does not have an URL' % name)
+                        continue
+
             features_list = features_definition['features']
+            previous_feature_name = ''
             for i in xrange(len(features_list)):
                 feature = features_list[i]
-                if 'name' not in feature:
+                feature_name = 'Feature %s' % i
+                if 'name' not in feature or not feature['name']:
                     self._handle_style_error(0, 'json/syntax', 5, 'The feature %d does not have the mandatory field "name".' % i)
-                if 'status' not in feature:
-                    self._handle_style_error(0, 'json/syntax', 5, 'The feature %d does not have the mandatory field "status".' % i)
+                else:
+                    feature_name = feature['name']
+
+                    if feature_name < previous_feature_name:
+                        self._handle_style_error(0, 'json/syntax', 5, 'The features should be sorted alphabetically by name, "%s" appears after "%s".' % (feature_name, previous_feature_name))
+                    previous_feature_name = feature_name
+
+                if 'status' not in feature or not feature['status']:
+                    self._handle_style_error(0, 'json/syntax', 5, 'The feature "%s" does not have the mandatory field "status".' % feature_name)
+                if 'specification' in feature:
+                    if feature['specification'] not in specification_name_set:
+                        self._handle_style_error(0, 'json/syntax', 5, 'The feature "%s" has a specification field but no specification of that name exists.' % feature_name)
         except:
             pass