| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 String.prototype.compareTo = function(other) | 245 String.prototype.compareTo = function(other) |
| 246 { | 246 { |
| 247 if (this > other) | 247 if (this > other) |
| 248 return 1; | 248 return 1; |
| 249 if (this < other) | 249 if (this < other) |
| 250 return -1; | 250 return -1; |
| 251 return 0; | 251 return 0; |
| 252 } | 252 } |
| 253 | 253 |
| 254 /** | 254 /** |
| 255 * @param {string} href | |
| 256 * @return {?string} | |
| 257 */ | |
| 258 function sanitizeHref(href) | |
| 259 { | |
| 260 return href && href.trim().toLowerCase().startsWith("javascript:") ? null :
href; | |
| 261 } | |
| 262 | |
| 263 /** | |
| 264 * @return {string} | 255 * @return {string} |
| 265 */ | 256 */ |
| 266 String.prototype.removeURLFragment = function() | 257 String.prototype.removeURLFragment = function() |
| 267 { | 258 { |
| 268 var fragmentIndex = this.indexOf("#"); | 259 var fragmentIndex = this.indexOf("#"); |
| 269 if (fragmentIndex == -1) | 260 if (fragmentIndex == -1) |
| 270 fragmentIndex = this.length; | 261 fragmentIndex = this.length; |
| 271 return this.substring(0, fragmentIndex); | 262 return this.substring(0, fragmentIndex); |
| 272 } | 263 } |
| 273 | 264 |
| (...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1631 _tryMerge: function(first, second) | 1622 _tryMerge: function(first, second) |
| 1632 { | 1623 { |
| 1633 var merged = this._mergeCallback && this._mergeCallback(first, second); | 1624 var merged = this._mergeCallback && this._mergeCallback(first, second); |
| 1634 if (!merged) | 1625 if (!merged) |
| 1635 return null; | 1626 return null; |
| 1636 merged.begin = first.begin; | 1627 merged.begin = first.begin; |
| 1637 merged.end = Math.max(first.end, second.end); | 1628 merged.end = Math.max(first.end, second.end); |
| 1638 return merged; | 1629 return merged; |
| 1639 } | 1630 } |
| 1640 } | 1631 } |
| OLD | NEW |