Changeset 1338
- Timestamp:
- 11/12/07 22:22:58 (6 years ago)
- Location:
- lang/javascript/javascript-xpath/trunk
- Files:
-
- 1 added
- 5 modified
-
ChangeLog (modified) (1 diff)
-
release/javascript-xpath-0.1.3.js (added)
-
release/javascript-xpath-latest.js (modified) (4 diffs)
-
src/functionCall.js (modified) (2 diffs)
-
src/pathExpr.js (modified) (1 diff)
-
version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/javascript-xpath/trunk/ChangeLog
r1332 r1338 1 == 0.1.3 / 2007-11-12 amachang <seijro@gmail.com> 2 3 * fix Opera's substring problem 4 * fix Safari2's element.contains problem 5 1 6 == 0.1.2 / 2007-11-12 amachang <seijro@gmail.com> 2 7 -
lang/javascript/javascript-xpath/trunk/release/javascript-xpath-latest.js
r1332 r1338 1 /* JavaScript-XPath 0.1. 21 /* JavaScript-XPath 0.1.3 2 2 * (c) 2007 Cybozu Labs, Inc. 3 3 * … … 684 684 if (!step.needContextPosition && step.axis == 'following') { 685 685 for (node = iter(); next = iter(); node = next) { 686 try { if (!node.contains(next)) break } 687 catch(e) { if (!(next.compareDocumentPosition(node) & 8)) break } 686 687 // Safari 2 node.contains problem 688 if (uai.applewebkit4) { 689 var contains = false; 690 var ancestor = next; 691 do { 692 if (ancestor == node) { 693 contains = true; 694 break; 695 } 696 } while (ancestor = ancestor.parentNode); 697 if (!contains) break; 698 } 699 else { 700 try { if (!node.contains(next)) break } 701 catch(e) { if (!(next.compareDocumentPosition(node) & 8)) break } 702 } 688 703 } 689 704 nodeset = step.evaluate(new Ctx(node)); … … 1854 1869 1855 1870 substring: [function(s, n1, n2) { 1871 var a1, a2; 1856 1872 s = s.string(this); 1857 1873 n1 = n1.number(this); … … 1869 1885 n1 = Math.round(n1); 1870 1886 n2 = Math.round(n2); 1871 return s.substring(n1 - 1, n1 + n2 - 1) 1887 a1 = n1 - 1; 1888 a2 = n1 + n2 - 1; 1889 if (a2 == Infinity) { 1890 return s.substring(a1 < 0 ? 0 : a1); 1891 } 1892 else { 1893 return s.substring(a1 < 0 ? 0 : a1, a2) 1894 } 1872 1895 }, 'string', false, []], 1873 1896 -
lang/javascript/javascript-xpath/trunk/src/functionCall.js
r1325 r1338 196 196 197 197 substring: [function(s, n1, n2) { 198 var a1, a2; 198 199 s = s.string(this); 199 200 n1 = n1.number(this); … … 211 212 n1 = Math.round(n1); 212 213 n2 = Math.round(n2); 213 return s.substring(n1 - 1, n1 + n2 - 1) 214 a1 = n1 - 1; 215 a2 = n1 + n2 - 1; 216 if (a2 == Infinity) { 217 return s.substring(a1 < 0 ? 0 : a1); 218 } 219 else { 220 return s.substring(a1 < 0 ? 0 : a1, a2) 221 } 214 222 }, 'string', false, []], 215 223 -
lang/javascript/javascript-xpath/trunk/src/pathExpr.js
r1269 r1338 77 77 if (!step.needContextPosition && step.axis == 'following') { 78 78 for (node = iter(); next = iter(); node = next) { 79 try { if (!node.contains(next)) break } 80 catch(e) { if (!(next.compareDocumentPosition(node) & 8)) break } 79 80 // Safari 2 node.contains problem 81 if (uai.applewebkit4) { 82 var contains = false; 83 var ancestor = next; 84 do { 85 if (ancestor == node) { 86 contains = true; 87 break; 88 } 89 } while (ancestor = ancestor.parentNode); 90 if (!contains) break; 91 } 92 else { 93 try { if (!node.contains(next)) break } 94 catch(e) { if (!(next.compareDocumentPosition(node) & 8)) break } 95 } 81 96 } 82 97 nodeset = step.evaluate(new Ctx(node)); -
lang/javascript/javascript-xpath/trunk/version.txt
r1332 r1338 1 0.1. 21 0.1.3
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)