From: <ad...@us...> - 2010-11-20 21:26:33
|
Revision: 1216 http://jtidy.svn.sourceforge.net/jtidy/?rev=1216&view=rev Author: aditsu Date: 2010-11-20 21:26:27 +0000 (Sat, 20 Nov 2010) Log Message: ----------- fixed test 1055398 - swapped "first" and "second" when joining styles in repairDuplicateAttributes Modified Paths: -------------- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java Modified: branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java =================================================================== --- branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-20 21:12:16 UTC (rev 1215) +++ branches/CodeUpdateAndJava5/src/main/java/org/w3c/tidy/Node.java 2010-11-20 21:26:27 UTC (rev 1216) @@ -320,40 +320,28 @@ // this doesn't handle CSS comments and leading/trailing white-space very well see // http://www.w3.org/TR/css-style-attr - int end = second.value.length() - 1; + int end = first.value.length() - 1; - if (second.value.charAt(end) == ';') + if (first.value.charAt(end) == ';') { // attribute ends with declaration seperator - second.value = second.value + " " + first.value; + first.value = first.value + " " + second.value; } - else if (second.value.charAt(end) == '}') + else if (first.value.charAt(end) == '}') { // attribute ends with rule set - second.value = second.value + " { " + first.value + " }"; + first.value = first.value + " { " + second.value + " }"; } else { // attribute ends with property value - second.value = second.value + "; " + first.value; + first.value = first.value + "; " + second.value; } - temp = first.next; - - if (temp.next == null) - { - second = null; - } - else - { - second = second.next; - } - - lexer.report.attrError(lexer, this, first, ErrorCode.JOINING_ATTRIBUTE); - - removeAttribute(first); - first = temp; - + temp = second.next; + lexer.report.attrError(lexer, this, second, ErrorCode.JOINING_ATTRIBUTE); + removeAttribute(second); + second = temp; } else if (lexer.configuration.getDuplicateAttrs() == DupAttrModes.KeepLast) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |