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

View File

@ -1,9 +1,10 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta charset="utf-8" />
<title>-</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<meta charset="utf-8" />
<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>
</head>
<body>

View File

@ -35,7 +35,7 @@ function setStrings (type, obj, ids) {
switch (type) {
case 'content':
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;
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>