- Refactoring (minor): Simplify (empty string is falsey)

- Refactoring (minor): Consistent HTML indenting/no-namespacing and title/icon use
- Testing: Add browser bug test with reference to issue
master
Brett Zamir 2018-05-18 11:35:24 +08:00
parent f768fe2547
commit 89cbab7217
4 changed files with 35 additions and 11 deletions

View File

@ -40,9 +40,10 @@
$prefix = 'data:' . $info['mime'] . ';base64,'; $prefix = 'data:' . $info['mime'] . ';base64,';
} }
?> ?>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>-</title>
<script> <script>
top.svgEditor.processFile("<?php top.svgEditor.processFile("<?php
@ -52,5 +53,6 @@ echo $prefix . base64_encode($output);
?>", "<?php echo $type; ?>"); ?>", "<?php echo $type; ?>");
</script> </script>
</head><body></body> </head>
<body></body>
</html> </html>

View File

@ -1,8 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>-</title> <title>-</title>
<link rel="icon" type="image/png" href="../../images/logo.png"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
</head> </head>
<body> <body>

View File

@ -35,7 +35,7 @@ function setStrings (type, obj, ids) {
switch (type) { switch (type) {
case 'content': case 'content':
for (var i = 0, node; (node = elem.childNodes[i]); i++) { for (var i = 0, node; (node = elem.childNodes[i]); i++) {
if (node.nodeType === 3 && node.textContent.trim() === '') { if (node.nodeType === 3 && node.textContent.trim()) {
node.textContent = val; node.textContent = val;
break; break;
} }

View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>removeItem and setAttribute test</title>
<link rel="icon" type="image/png" href="../editor/images/logo.png"/>
</head>
<body>
<script>
var elem = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
elem.setAttribute('transform', 'matrix(1,0,0,1,0,0)');
elem.transform.baseVal.removeItem(0);
elem.removeAttribute('transform');
console.log(elem.hasAttribute('transform'));
</script>
Issue:
<a href="https://bugs.chromium.org/p/chromium/issues/detail?id=843901">
Chromium 843901
</a>
</body>
</html>