summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/chrome/inactive-property-helper/highlight-pseudo-elements.mjs
blob: bcb5b8763cca3e85fb666ccb846a5e529fb82b1f (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// InactivePropertyHelper `highlight-pseudo-elements` test cases.

// "background",
// "background-color",
// "color",
// "fill-color",
// "stroke-color",
// "stroke-width",
// "text-decoration",
// "text-shadow",
// "text-underline-offset",
// "text-underline-position",

export default [
  {
    info: "width is inactive on ::selection",
    property: "width",
    tagName: "span",
    rules: ["span::selection { width: 10px; }"],
    isActive: false,
    // `width` is also inactive on inline element, so make sure we get the warning
    // because we're using it in a highlight pseudo.
    expectedMsgId: "inactive-css-highlight-pseudo-elements-not-supported",
  },
  {
    info: "display is inactive on ::highlight",
    property: "display",
    tagName: "span",
    rules: ["span::highlight(result) { display: grid; }"],
    isActive: false,
    expectedMsgId: "inactive-css-highlight-pseudo-elements-not-supported",
  },
  {
    // accept background shorthand, even if it might hold inactive values
    info: "background is active on ::selection",
    property: "background",
    tagName: "span",
    rules: ["span::selection { background: red; }"],
    isActive: true,
  },
  {
    info: "border-color is inactive on ::selection",
    property: "border-color",
    tagName: "span",
    rules: ["span::selection { border-color: red; }"],
    isActive: false,
    // `width` is also inactive on inline element, so make sure we get the warning
    // because we're using it in a highlight pseudo.
    expectedMsgId: "inactive-css-highlight-pseudo-elements-not-supported",
  },
  {
    info: "background-color is active on ::selection",
    property: "background-color",
    tagName: "span",
    rules: ["span::selection { background-color: red; }"],
    isActive: true,
  },
  {
    info: "color is active on ::selection",
    property: "color",
    tagName: "span",
    rules: ["span::selection { color: red; }"],
    isActive: true,
  },
  {
    info: "text-decoration is active on ::selection",
    property: "text-decoration",
    tagName: "span",
    rules: [
      "span::selection { text-decoration: double overline #FF3028 4px; }",
    ],
    isActive: true,
  },
  {
    info: "text-decoration-color is active on ::selection",
    property: "text-decoration-color",
    tagName: "span",
    rules: ["span::selection { text-decoration-color: #FF3028; }"],
    isActive: true,
  },
  {
    info: "text-decoration-line is active on ::selection",
    property: "text-decoration-line",
    tagName: "span",
    rules: ["span::selection { text-decoration-line: overline; }"],
    isActive: true,
  },
  {
    info: "text-decoration-style is active on ::selection",
    property: "text-decoration-style",
    tagName: "span",
    rules: ["span::selection { text-decoration-style: double; }"],
    isActive: true,
  },
  {
    info: "text-decoration-thickness is active on ::selection",
    property: "text-decoration-thickness",
    tagName: "span",
    rules: ["span::selection { text-decoration-thickness: 4px; }"],
    isActive: true,
  },
  {
    info: "text-shadow is active on ::selection",
    property: "text-shadow",
    tagName: "span",
    rules: ["span::selection { text-shadow: text-shadow: #FC0 1px 0 10px; }"],
    isActive: true,
  },
  {
    info: "text-underline-offset is active on ::selection",
    property: "text-underline-offset",
    tagName: "span",
    rules: ["span::selection { text-underline-offset: 10px; }"],
    isActive: true,
  },
  {
    info: "text-underline-position is active on ::selection",
    property: "text-underline-position",
    tagName: "span",
    rules: ["span::selection { text-underline-position: under; }"],
    isActive: true,
  },
  {
    info: "-webkit-text-fill-color is active on ::selection",
    property: "-webkit-text-fill-color",
    tagName: "span",
    rules: ["span::selection { -webkit-text-fill-color: red; }"],
    isActive: true,
  },
  {
    info: "-webkit-text-stroke-color is active on ::selection",
    property: "-webkit-text-stroke-color",
    tagName: "span",
    rules: ["span::selection { -webkit-text-stroke-color: red; }"],
    isActive: true,
  },
  {
    info: "-webkit-text-stroke-width is active on ::selection",
    property: "-webkit-text-stroke-width",
    tagName: "span",
    rules: ["span::selection { -webkit-text-stroke-width: 4px; }"],
    isActive: true,
  },
  {
    info: "-webkit-text-stroke is active on ::selection",
    property: "-webkit-text-stroke",
    tagName: "span",
    rules: ["span::selection { -webkit-text-stroke: 4px navy; }"],
    isActive: true,
  },
];