summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/annotation-model/annotations/specificResource/4.4-styleClassValidIfPresent.json
blob: 3e599a0590e6e8bc9462cc238cb7c66170ac57a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "4.4-styleClassValidIfPresent.json",
  "assertionType": "must",
  "expectedResult": "valid",
  "onUnexpectedResult" : "failAndContinue",
  "errorMessage": "ERROR: Annotation contains one or more Specific Resources with styleClass key, but does not contain an Annotation-level stylesheet key.",
  "title": "If any **Specific Resource _styleClass_ keys** are present, a **_stylesheet_ key** (a key of Annotation) with a **single value** is also present [model 4.4](https://www.w3.org/TR/annotation-model/#styles)",
  "description": "True when no Specific Resources styleClass present or all Specific Resource styleClass values are strings / array of strings and Annotation has a stylesheet key. (Section 4.4)",
  "type": "object",
  "anyOf":
   [
    { "required": ["stylesheet"] },
    { "not":
      {
        "anyOf":
         [
          { "$ref": "#/definitions/bodyHasStyleClass" },
          { "$ref": "#/definitions/targHasStyleClass" }
         ]
      }
    }
   ],
  "definitions":
   {
      "bodyHasStyleClass":
      {
        "properties":
        {
            "body":
            {
               "oneOf":
               [
                  { "anyOf":
                  [
                    { "$ref": "specificResource.json#/definitions/styleClassDetected" },
                    { "$ref": "specificResource.json#/definitions/itemStyleClassPropertyDetected" }
                   ]
                  },
                   { "not":
                     { "items":
                        { "not":
                           { "anyOf": [
                              { "$ref": "specificResource.json#/definitions/styleClassDetected" },
                              { "$ref": "specificResource.json#/definitions/itemStyleClassPropertyDetected" }
                             ]
                           }
                         }
                     }
                   }
               ]
             }
         },
         "required": ["body"]
      },

      "targHasStyleClass":
      {
        "properties":
        {
            "target":
            {
               "oneOf":
               [
                  { "anyOf":
                   [
                    { "$ref": "specificResource.json#/definitions/styleClassDetected" },
                    { "$ref": "specificResource.json#/definitions/itemStyleClassPropertyDetected" }
                   ]
                  },
                   { "not":
                     { "items":
                        { "not":
                           { "anyOf": [
                              { "$ref": "specificResource.json#/definitions/styleClassDetected" },
                              { "$ref": "specificResource.json#/definitions/itemStyleClassPropertyDetected" }
                             ]
                           }
                         }
                     }
                   }
               ]
             }
         },
         "required": [ "target" ]
      }
   }
}