| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 return null; | 221 return null; |
| 222 } | 222 } |
| 223 | 223 |
| 224 Node.prototype.enclosingNodeWithClass = function(className) | 224 Node.prototype.enclosingNodeWithClass = function(className) |
| 225 { | 225 { |
| 226 if (!this.parentNode) | 226 if (!this.parentNode) |
| 227 return null; | 227 return null; |
| 228 return this.parentNode.enclosingNodeOrSelfWithClass(className); | 228 return this.parentNode.enclosingNodeOrSelfWithClass(className); |
| 229 } | 229 } |
| 230 | 230 |
| 231 Node.SHADOW_ROOT_NODE = 14; | 231 Element.prototype.query = function(query) |
| 232 | |
| 233 Element.prototype.query = function(query) | |
| 234 { | 232 { |
| 235 return this.ownerDocument.evaluate(query, this, null, XPathResult.FIRST_ORDE
RED_NODE_TYPE, null).singleNodeValue; | 233 return this.ownerDocument.evaluate(query, this, null, XPathResult.FIRST_ORDE
RED_NODE_TYPE, null).singleNodeValue; |
| 236 } | 234 } |
| 237 | 235 |
| 238 Element.prototype.removeChildren = function() | 236 Element.prototype.removeChildren = function() |
| 239 { | 237 { |
| 240 if (this.firstChild) | 238 if (this.firstChild) |
| 241 this.textContent = ""; | 239 this.textContent = ""; |
| 242 } | 240 } |
| 243 | 241 |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 var text = content; | 1059 var text = content; |
| 1062 var result = 0; | 1060 var result = 0; |
| 1063 var match; | 1061 var match; |
| 1064 while (text && (match = regex.exec(text))) { | 1062 while (text && (match = regex.exec(text))) { |
| 1065 if (match[0].length > 0) | 1063 if (match[0].length > 0) |
| 1066 ++result; | 1064 ++result; |
| 1067 text = text.substring(match.index + 1); | 1065 text = text.substring(match.index + 1); |
| 1068 } | 1066 } |
| 1069 return result; | 1067 return result; |
| 1070 } | 1068 } |
| OLD | NEW |