Fixed bugs causing tests to fail in Firefox and IE9

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1993 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2011-02-10 19:09:35 +00:00
parent 32f61b2b3a
commit 01e08e2116
2 changed files with 6 additions and 3 deletions

View File

@ -23,6 +23,9 @@ var svg_ns = "http://www.w3.org/2000/svg";
var se_ns = "http://svg-edit.googlecode.com";
var xmlns_ns = "http://www.w3.org/2000/xmlns/";
var visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use';
var visElems_arr = visElems.split(',');
var RandomizeModes = {
LET_DOCUMENT_DECIDE: 0,
ALWAYS_RANDOMIZE: 1,
@ -375,8 +378,8 @@ svgedit.draw.Drawing.prototype.identifyLayers = function() {
orphans.push(child);
}
}
// if child has a bbox (i.e. not a <title> or <defs> element), then it is an orphan
else if(svgedit.utilities.getBBox(child) && child.nodeName != 'defs') { // Opera returns a BBox for defs
// if child has is "visible" (i.e. not a <title> or <defs> element), then it is an orphan
else if(~visElems_arr.indexOf(child.nodeName)) {
var bb = svgedit.utilities.getBBox(child);
orphans.push(child);
}

View File

@ -224,7 +224,7 @@ svgedit.history.RemoveElementCommand.prototype.unapply = function(handler) {
svgedit.transformlist.removeElementFromListMap(this.elem);
if(this.nextSibling == null) {
console.log('Error: reference element was lost');
if(window.console) console.log('Error: reference element was lost');
}
this.parent.insertBefore(this.elem, this.nextSibling);