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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/svg/animations/animate-values-whitespace.html
diff --git a/third_party/WebKit/LayoutTests/svg/animations/animate-values-whitespace.html b/third_party/WebKit/LayoutTests/svg/animations/animate-values-whitespace.html
new file mode 100644
index 0000000000000000000000000000000000000000..8be8817e1c766cf21451ac0b196c88f351f989d2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/animations/animate-values-whitespace.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>SMIL 'values' whitespace</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg></svg>
+<script>
+let subjects = [
+ { char: '\u0009', stripped: true, name: 'Character Tabulation' },
+ { char: '\u000A', stripped: true, name: 'Line Feed' },
+ { char: '\u000C', stripped: true, name: 'Form Feed' },
+ { char: '\u000D', stripped: true, name: 'Carriage Return' },
+ { char: '\u0020', stripped: true, name: 'Space' },
+ { char: '\u00A0', stripped: false, name: 'No-Break Space' },
+ { char: '\u1680', stripped: false, name: 'Ogham Space Mark' },
+ { char: '\u2000', stripped: false, name: 'EN Quad' },
+ { char: '\u2001', stripped: false, name: 'EM Quad' },
+ { char: '\u2002', stripped: false, name: 'EN Space' },
+ { char: '\u2003', stripped: false, name: 'EM Space' },
+ { char: '\u2004', stripped: false, name: 'Three-Per-Em Space' },
+ { char: '\u2005', stripped: false, name: 'Four-Per-Em Space' },
+ { char: '\u2006', stripped: false, name: 'Six-Per-Em Space' },
+ { char: '\u2007', stripped: false, name: 'Figure Space' },
+ { char: '\u2008', stripped: false, name: 'Punctuation Space' },
+ { char: '\u2009', stripped: false, name: 'Thin Space' },
+ { char: '\u200A', stripped: false, name: 'Hair Space' },
+ { char: '\u202F', stripped: false, name: 'Narrow No-Break Space' },
+ { char: '\u205F', stripped: false, name: 'Medium Mathematical Space' },
+ { char: '\u3000', stripped: false, name: 'Ideographic Space' },
+];
+
+function makeTestSubject(subjectText) {
+ const svgNs = 'http://www.w3.org/2000/svg';
+ let aLink = document.createElementNS(svgNs, 'a');
+ let rect = aLink.appendChild(document.createElementNS(svgNs, 'rect'));
+ rect.setAttribute('width', 100);
+ rect.setAttribute('height', 100);
+ rect.setAttribute('fill', 'blue');
+ let animate = aLink.appendChild(document.createElementNS(svgNs, 'animate'));
+ animate.setAttribute('attributeName', 'href');
+ animate.setAttribute('values', subjectText);
+ return aLink;
+}
+
+let svgRoot = document.querySelector('svg');
+for (let subject of subjects) {
+ async_test(function(t) {
+ let payload = 'javascript:alert("' + subject.name + '")';
+ let fragment = makeTestSubject(subject.char + payload);
+ svgRoot.appendChild(fragment);
+ let expected = (subject.stripped ? '' : subject.char) + payload;
+ let animate = fragment.lastChild;
+ animate.onbegin = t.step_func_done(function() {
+ var target = animate.parentNode;
+ assert_equals(target.href.animVal, expected);
+ });
+ }, subject.name + ' (U+' + subject.char.codePointAt(0).toString(16) + ') is ' +
+ (subject.stripped ? '' : 'not ') + 'stripped.');
+};
+</script>
« 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