Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: third_party/WebKit/LayoutTests/svg/animations/animate-values-whitespace.html

Issue 2807193003: Strip only ASCII spaces from SMIL 'values' attributes (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>SMIL 'values' whitespace</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <svg></svg>
6 <script>
7 let subjects = [
8 { char: '\u0009', stripped: true, name: 'Character Tabulation' },
9 { char: '\u000A', stripped: true, name: 'Line Feed' },
10 { char: '\u000C', stripped: true, name: 'Form Feed' },
11 { char: '\u000D', stripped: true, name: 'Carriage Return' },
12 { char: '\u0020', stripped: true, name: 'Space' },
13 { char: '\u00A0', stripped: false, name: 'No-Break Space' },
14 { char: '\u1680', stripped: false, name: 'Ogham Space Mark' },
15 { char: '\u2000', stripped: false, name: 'EN Quad' },
16 { char: '\u2001', stripped: false, name: 'EM Quad' },
17 { char: '\u2002', stripped: false, name: 'EN Space' },
18 { char: '\u2003', stripped: false, name: 'EM Space' },
19 { char: '\u2004', stripped: false, name: 'Three-Per-Em Space' },
20 { char: '\u2005', stripped: false, name: 'Four-Per-Em Space' },
21 { char: '\u2006', stripped: false, name: 'Six-Per-Em Space' },
22 { char: '\u2007', stripped: false, name: 'Figure Space' },
23 { char: '\u2008', stripped: false, name: 'Punctuation Space' },
24 { char: '\u2009', stripped: false, name: 'Thin Space' },
25 { char: '\u200A', stripped: false, name: 'Hair Space' },
26 { char: '\u202F', stripped: false, name: 'Narrow No-Break Space' },
27 { char: '\u205F', stripped: false, name: 'Medium Mathematical Space' },
28 { char: '\u3000', stripped: false, name: 'Ideographic Space' },
29 ];
30
31 function makeTestSubject(subjectText) {
32 const svgNs = 'http://www.w3.org/2000/svg';
33 let aLink = document.createElementNS(svgNs, 'a');
34 let rect = aLink.appendChild(document.createElementNS(svgNs, 'rect'));
35 rect.setAttribute('width', 100);
36 rect.setAttribute('height', 100);
37 rect.setAttribute('fill', 'blue');
38 let animate = aLink.appendChild(document.createElementNS(svgNs, 'animate'));
39 animate.setAttribute('attributeName', 'href');
40 animate.setAttribute('values', subjectText);
41 return aLink;
42 }
43
44 let svgRoot = document.querySelector('svg');
45 for (let subject of subjects) {
46 async_test(function(t) {
47 let payload = 'javascript:alert("' + subject.name + '")';
48 let fragment = makeTestSubject(subject.char + payload);
49 svgRoot.appendChild(fragment);
50 let expected = (subject.stripped ? '' : subject.char) + payload;
51 let animate = fragment.lastChild;
52 animate.onbegin = t.step_func_done(function() {
53 var target = animate.parentNode;
54 assert_equals(target.href.animVal, expected);
55 });
56 }, subject.name + ' (U+' + subject.char.codePointAt(0).toString(16) + ') is ' +
57 (subject.stripped ? '' : 'not ') + 'stripped.');
58 };
59 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698