-
Notifications
You must be signed in to change notification settings - Fork 14
/
bugs.html
355 lines (312 loc) · 18.5 KB
/
bugs.html
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 <x-knob> rotating knob web component</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
Required for browsers that do not yet support the latest technologies.
http://webcomponents.org/
https://github.com/webcomponents/webcomponentsjs/releases
-->
<script type="text/javascript">
if (!document.registerElement) {
document.writeln(decodeURI('%3Cscript%20src=%22https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.12/webcomponents.min.js%22%20type=%22text/javascript%22%3E%3C/script%3E'));
}
</script>
<script src="xknob.js" type="text/javascript" async></script>
<link href="xknob.css" type="text/css" rel="stylesheet">
<script data-goatcounter="https://denilsonsa.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
<style type="text/css">
html, body {
background: white;
color: black;
}
h2 {
border-top: 1px solid black;
margin: 2em 0 1ex;
}
:target {
background: #eeeeec;
}
input[type="number"] {
width: 4em;
}
</style>
<svg style="display: none;">
<defs>
<symbol id="chromatic-wheel-labeled" viewBox="-5 -5 10 10">
<g visibility="hidden">
<path id="circle-section" d="M-0.2614672282429745,-2.988584094275237 -0.34862297099063266,-3.984778792366982 0.34862297099063266,-3.984778792366982 0.2614672282429745,-2.988584094275237 z"/>
</g>
<!-- Any referenced element inside this symbol must be defined also inside it, otherwise <x-knob> won't copy it. -->
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(0, 100%, 50%)" transform="rotate(0)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(10, 100%, 50%)" transform="rotate(10)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(20, 100%, 50%)" transform="rotate(20)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(30, 100%, 50%)" transform="rotate(30)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(40, 100%, 50%)" transform="rotate(40)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(50, 100%, 50%)" transform="rotate(50)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(60, 100%, 50%)" transform="rotate(60)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(70, 100%, 50%)" transform="rotate(70)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(80, 100%, 50%)" transform="rotate(80)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(90, 100%, 50%)" transform="rotate(90)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(100, 100%, 50%)" transform="rotate(100)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(110, 100%, 50%)" transform="rotate(110)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(120, 100%, 50%)" transform="rotate(120)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(130, 100%, 50%)" transform="rotate(130)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(140, 100%, 50%)" transform="rotate(140)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(150, 100%, 50%)" transform="rotate(150)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(160, 100%, 50%)" transform="rotate(160)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(170, 100%, 50%)" transform="rotate(170)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(180, 100%, 50%)" transform="rotate(180)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(190, 100%, 50%)" transform="rotate(190)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(200, 100%, 50%)" transform="rotate(200)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(210, 100%, 50%)" transform="rotate(210)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(220, 100%, 50%)" transform="rotate(220)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(230, 100%, 50%)" transform="rotate(230)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(240, 100%, 50%)" transform="rotate(240)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(250, 100%, 50%)" transform="rotate(250)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(260, 100%, 50%)" transform="rotate(260)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(270, 100%, 50%)" transform="rotate(270)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(280, 100%, 50%)" transform="rotate(280)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(290, 100%, 50%)" transform="rotate(290)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(300, 100%, 50%)" transform="rotate(300)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(310, 100%, 50%)" transform="rotate(310)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(320, 100%, 50%)" transform="rotate(320)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(330, 100%, 50%)" transform="rotate(330)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(340, 100%, 50%)" transform="rotate(340)"/>
<use xlink:href="#circle-section" x="0" y="0" fill="hsl(350, 100%, 50%)" transform="rotate(350)"/>
<g text-anchor="middle" dominant-baseline="central" font-family="Arial, sans-serif" font-size="0.4px">
<text x="0" y="-4.5" transform="rotate(0)">0</text>
<text x="0" y="-4.5" transform="rotate(10)">10</text>
<text x="0" y="-4.5" transform="rotate(20)">20</text>
<text x="0" y="-4.5" transform="rotate(30)">30</text>
<text x="0" y="-4.5" transform="rotate(40)">40</text>
<text x="0" y="-4.5" transform="rotate(50)">50</text>
<text x="0" y="-4.5" transform="rotate(60)">60</text>
<text x="0" y="-4.5" transform="rotate(70)">70</text>
<text x="0" y="-4.5" transform="rotate(80)">80</text>
<text x="0" y="-4.5" transform="rotate(90)">90</text>
<text x="0" y="-4.5" transform="rotate(100)">100</text>
<text x="0" y="-4.5" transform="rotate(110)">110</text>
<text x="0" y="-4.5" transform="rotate(120)">120</text>
<text x="0" y="-4.5" transform="rotate(130)">130</text>
<text x="0" y="-4.5" transform="rotate(140)">140</text>
<text x="0" y="-4.5" transform="rotate(150)">150</text>
<text x="0" y="-4.5" transform="rotate(160)">160</text>
<text x="0" y="-4.5" transform="rotate(170)">170</text>
<text x="0" y="-4.5" transform="rotate(180)">180</text>
<text x="0" y="-4.5" transform="rotate(190)">190</text>
<text x="0" y="-4.5" transform="rotate(200)">200</text>
<text x="0" y="-4.5" transform="rotate(210)">210</text>
<text x="0" y="-4.5" transform="rotate(220)">220</text>
<text x="0" y="-4.5" transform="rotate(230)">230</text>
<text x="0" y="-4.5" transform="rotate(240)">240</text>
<text x="0" y="-4.5" transform="rotate(250)">250</text>
<text x="0" y="-4.5" transform="rotate(260)">260</text>
<text x="0" y="-4.5" transform="rotate(270)">270</text>
<text x="0" y="-4.5" transform="rotate(280)">280</text>
<text x="0" y="-4.5" transform="rotate(290)">290</text>
<text x="0" y="-4.5" transform="rotate(300)">300</text>
<text x="0" y="-4.5" transform="rotate(310)">310</text>
<text x="0" y="-4.5" transform="rotate(320)">320</text>
<text x="0" y="-4.5" transform="rotate(330)">330</text>
<text x="0" y="-4.5" transform="rotate(340)">340</text>
<text x="0" y="-4.5" transform="rotate(350)">350</text>
</g>
</symbol>
<!-- Driving wheel clipart from https://openclipart.org/detail/172010/driving-wheel -->
<symbol id="driving-wheel-as-image" viewBox="0 0 1 1">
<image xlink:href="drivingwheel.svg" x="0" y="0" width="1" height="1"/>
</symbol>
<symbol id="driving-wheel-as-use" viewBox="0 0 1 1">
<use xlink:href="drivingwheel.svg#drivingwheel" x="0" y="0" width="1" height="1"/>
</symbol>
</defs>
</svg>
</head>
<body>
<h1><code><x-knob></code> bugs</h1>
<script type="text/javascript">
if (window.WebComponents) {
document.writeln('<p style="color:red;">Note: <code>document.registerElement()</code> not detected, enabling the <a href="https://github.com/webcomponents/webcomponentsjs/releases">webcomponentsjs</a> polyfill.</p>');
}
</script>
<section id="bug-chromatic-wheel">
<h2><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1199538">Firefox bug 1199538</a>: Incorrect SVG text rendering when font-size is effectively smaller than 8px</h2>
<p>Each graphic below has width and height set to <output class="bug-chromatic-wheel-size-output"></output>px. Internally, the SVG <code>viewBox</code> dimensions are 10x10, and the text <code>font-size</code> is <code>0.4px</code>. Doing the math, this the actual <code>font-size</code> in document pixels is <output class="bug-chromatic-wheel-font-size-output"></output>px. If this number is smaller than 8px, then text rendering in Firefox is completely broken, with all characters drawn on top of each other. Sometimes (depending on the rotation) the characters is drawn at the wrong location.</p>
<p><label>Size: <input type="number" id="bug-chromatic-wheel-size" min="1" step="1" value="199">px</label>. Try <a href="javascript:set_chromatic_wheel_size(199)">199px</a> and <a href="javascript:set_chromatic_wheel_size(200)">200px</a>.</p>
<p>Current rotation is <output class="bug-chromatic-wheel-rotation-output"></output>deg. Change it by dragging the left-most wheel. Try <a href="javascript:set_chromatic_wheel_rotation(0)">0deg</a> and <a href="javascript:set_chromatic_wheel_rotation(0.25)">0.25deg</a> and <a href="javascript:set_chromatic_wheel_rotation(10)">10deg</a> and <a href="javascript:set_chromatic_wheel_rotation(90)">90deg</a>.</p>
<p>
<x-knob id="bug-chromatic-wheel-x-knob" divisions="1440" svgsymbolid="chromatic-wheel-labeled" title="Interactive knob custom element with SVG inside the shadow DOM."></x-knob>
<svg id="bug-chromatic-wheel-svg-use" viewBox="-1 -1 2 2" title="Plain SVG element with <use> pointing to a previously defined symbol.">
<use xlink:href="#chromatic-wheel-labeled" x="-1" y="-1" width="2" height="2"/>
</svg>
<svg id="bug-chromatic-wheel-svg-inline" viewBox="-5 -5 10 10" title="Minimal SVG element with the text elements written inline as direct descendants.">
<g text-anchor="middle" dominant-baseline="central" font-family="Arial, sans-serif" font-size="0.4px">
<text x="0" y="-4.5" transform="rotate(0)">0</text>
<text x="0" y="-4.5" transform="rotate(10)">10</text>
<text x="0" y="-4.5" transform="rotate(20)">20</text>
<text x="0" y="-4.5" transform="rotate(30)">30</text>
<text x="0" y="-4.5" transform="rotate(40)">40</text>
<text x="0" y="-4.5" transform="rotate(50)">50</text>
<text x="0" y="-4.5" transform="rotate(60)">60</text>
<text x="0" y="-4.5" transform="rotate(70)">70</text>
<text x="0" y="-4.5" transform="rotate(80)">80</text>
<text x="0" y="-4.5" transform="rotate(90)">90</text>
<text x="0" y="-4.5" transform="rotate(100)">100</text>
<text x="0" y="-4.5" transform="rotate(110)">110</text>
<text x="0" y="-4.5" transform="rotate(120)">120</text>
<text x="0" y="-4.5" transform="rotate(130)">130</text>
<text x="0" y="-4.5" transform="rotate(140)">140</text>
<text x="0" y="-4.5" transform="rotate(150)">150</text>
<text x="0" y="-4.5" transform="rotate(160)">160</text>
<text x="0" y="-4.5" transform="rotate(170)">170</text>
<text x="0" y="-4.5" transform="rotate(180)">180</text>
<text x="0" y="-4.5" transform="rotate(190)">190</text>
<text x="0" y="-4.5" transform="rotate(200)">200</text>
<text x="0" y="-4.5" transform="rotate(210)">210</text>
<text x="0" y="-4.5" transform="rotate(220)">220</text>
<text x="0" y="-4.5" transform="rotate(230)">230</text>
<text x="0" y="-4.5" transform="rotate(240)">240</text>
<text x="0" y="-4.5" transform="rotate(250)">250</text>
<text x="0" y="-4.5" transform="rotate(260)">260</text>
<text x="0" y="-4.5" transform="rotate(270)">270</text>
<text x="0" y="-4.5" transform="rotate(280)">280</text>
<text x="0" y="-4.5" transform="rotate(290)">290</text>
<text x="0" y="-4.5" transform="rotate(300)">300</text>
<text x="0" y="-4.5" transform="rotate(310)">310</text>
<text x="0" y="-4.5" transform="rotate(320)">320</text>
<text x="0" y="-4.5" transform="rotate(330)">330</text>
<text x="0" y="-4.5" transform="rotate(340)">340</text>
<text x="0" y="-4.5" transform="rotate(350)">350</text>
</g>
</svg>
</p>
<style type="text/css">
#bug-chromatic-wheel p x-knob,
#bug-chromatic-wheel p svg {
/* Default sizes to avoid popping during page load. They will be overridden by update_chromatic_wheel() function. */
width: 200px;
height: 200px;
}
</style>
<script type="text/javascript">
function set_chromatic_wheel_size(size) {
document.getElementById('bug-chromatic-wheel-size').value = size;
update_chromatic_wheel();
}
function set_chromatic_wheel_rotation(degrees) {
document.getElementById('bug-chromatic-wheel-x-knob').value = degrees / 360;
update_chromatic_wheel();
}
function update_chromatic_wheel() {
var size = document.getElementById('bug-chromatic-wheel-size').value;
var rotation = document.getElementById('bug-chromatic-wheel-x-knob').value * 360;
[
document.getElementById('bug-chromatic-wheel-x-knob'),
document.getElementById('bug-chromatic-wheel-svg-use'),
document.getElementById('bug-chromatic-wheel-svg-inline'),
].forEach(function(curr, index, arr) {
curr.style.width = size + 'px';
curr.style.height = size + 'px';
});
[
document.getElementById('bug-chromatic-wheel-svg-use'),
document.getElementById('bug-chromatic-wheel-svg-inline'),
].forEach(function(curr, index, arr) {
curr.children[0].style.transform = 'rotate(' + rotation + 'deg)';
});
Array.prototype.forEach.call(
document.getElementsByClassName('bug-chromatic-wheel-size-output'),
function(curr, index, arr) {
curr.value = size;
}
);
Array.prototype.forEach.call(
document.getElementsByClassName('bug-chromatic-wheel-font-size-output'),
function(curr, index, arr) {
curr.value = (0.4 * size / 10).toFixed(3);
}
);
Array.prototype.forEach.call(
document.getElementsByClassName('bug-chromatic-wheel-rotation-output'),
function(curr, index, arr) {
curr.value = rotation.toFixed(2);
}
);
}
function init_chromatic_wheel() {
document.getElementById('bug-chromatic-wheel-size').addEventListener('input', update_chromatic_wheel);
document.getElementById('bug-chromatic-wheel-x-knob').addEventListener('input', update_chromatic_wheel);
update_chromatic_wheel();
}
window.addEventListener('load', init_chromatic_wheel);
</script>
</section>
<section id="bug-tinted-image-background">
<h2><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1199536">Firefox bug 1199536</a>: Tinted image background in external SVG included via SVG <image> tag</h2>
<p>We have an external <a href="drivingwheel.svg">drivingwheel.svg</a> file (<a href="https://openclipart.org/detail/172010/driving-wheel">from Open clipart</a>) that is being included below in several ways.</p>
<p>In Firefox, loading this external SVG file inside <code><image xlink:href="drivingwheel.svg"/></code> is buggy, because the background gets filled with a semi-transparent shade of gray.</p>
<p>Loading the same SVG image using HTML <code><img></code> or <code><object></code> works as expected. Using the same SVG image as CSS <code>background-image</code> also works as expected.</p>
<p class="testcase">
<x-knob svgsymbolid="driving-wheel-as-image" title="x-knob element with SVG <image> inside a <symbol> being referenced by <use> inside shadow DOM."></x-knob>
<svg viewBox="-1 -1 2 2" title="Plain SVG element with <image> inside a <symbol> being referenced by <use>.">
<use xlink:href="#driving-wheel-as-image" x="-1" y="-1" width="2" height="2"/>
</svg>
<svg viewBox="0 0 1 1" title="Plain SVG element with <image> loading the external SVG file.">
<image xlink:href="drivingwheel.svg" x="0" y="0" width="1" height="1"/>
</svg>
<img src="drivingwheel.svg" title="Plain HTML <img> element loading the external SVG file.">
<object data="drivingwheel.svg" type="text/svg+xml" title="Plain HTML <object> element loading the external SVG file."></object>
</p>
<style type="text/css">
#bug-tinted-image-background p.testcase {
background-image: url(drivingwheel.svg);
background-size: 32px 32px;
background-repeat: repeat-x;
}
#bug-tinted-image-background .testcase > x-knob,
#bug-tinted-image-background .testcase > svg,
#bug-tinted-image-background .testcase > img,
#bug-tinted-image-background .testcase > object {
display: inline-block;
width: 128px;
height: 128px;
}
</style>
</section>
<section id="bug-use-external-svg">
<h2><a href="http://crbug.com/109212">Chrome bug 109212</a>: <use> does not render correctly if pointing to an external SVG that contains "url(#some_id)"</h2>
<p>If we have an external SVG file, we can use <code><use xlink:href="foo.svg#bar"></code> to include it (or some elements from it) into an SVG element.</p>
<p>However, if this external SVG file defines stuff such as filters and gradients, and uses such stuff to render other elements (e.g. <code>fill="url(#gradient)"</code>); then Chrome will not resolve these external IDs correctly, failing to render the imported file correctly.</p>
<p>It is worth noting that <code>url(#foo)</code> will fail rendering, but <code><use xlink:href="#bar"></code> is resolved correctly.</p>
<p>As a bonus bug, the <code>title=""</code> tooltip does not show up in these <svg> elements.</p>
<p class="testcase">
<img src="drivingwheel.svg" title="drivingwheel.svg being included through <img>.">
<svg viewBox="0 0 1 1" title="drivingwheel.svg being included through <use>.">
<use xlink:href="drivingwheel.svg#drivingwheel" x="0" y="0" width="1" height="1"/>
</svg>
<img src="bugs-external-file.svg" title="Sample SVG file being included through <img>.">
<svg viewBox="0 0 1 1" title="Sample SVG file being included through <img>.">
<use xlink:href="bugs-external-file.svg#svg" x="0" y="0" width="1" height="1"/>
</svg>
<svg viewBox="0 0 16 16" title="One element from the external SVG file being included through <img>.">
<use xlink:href="bugs-external-file.svg#circle" x="0" y="0" width="16" height="16"/>
</svg>
<svg viewBox="0 0 16 16" title="One element from the external SVG file being included through <img>, having a stroke color being applied..">
<use xlink:href="bugs-external-file.svg#circle" x="0" y="0" width="16" height="16" stroke="green"/>
</svg>
</p>
<style type="text/css">
#bug-use-external-svg .testcase > img,
#bug-use-external-svg .testcase > svg {
display: inline-block;
width: 128px;
height: 128px;
outline: 1px dotted gray;
}
</style>
</section>
</body>
</html>