select_all-rails 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/README.md +8 -7
- data/lib/select_all/rails/version.rb +1 -1
- data/node_modules/.bin/acorn +71 -0
- data/node_modules/.bin/escodegen +77 -0
- data/node_modules/.bin/esgenerate +64 -0
- data/node_modules/.bin/esparse +126 -0
- data/node_modules/.bin/esvalidate +199 -0
- data/node_modules/.bin/har-validator +56 -0
- data/node_modules/.bin/sshpk-conv +201 -0
- data/node_modules/.bin/sshpk-sign +191 -0
- data/node_modules/.bin/sshpk-verify +166 -0
- data/node_modules/.bin/uuid +26 -0
- data/node_modules/abab/CHANGELOG.md +11 -0
- data/node_modules/abab/README.md +52 -0
- data/node_modules/abab/index.js +9 -0
- data/node_modules/abab/lib/atob.js +109 -0
- data/node_modules/abab/lib/btoa.js +65 -0
- data/node_modules/abab/package.json +106 -0
- data/node_modules/acorn-globals/LICENSE +19 -0
- data/node_modules/acorn-globals/README.md +76 -0
- data/node_modules/acorn-globals/index.js +180 -0
- data/node_modules/acorn-globals/package.json +100 -0
- data/node_modules/acorn/.editorconfig +7 -0
- data/node_modules/acorn/.gitattributes +1 -0
- data/node_modules/acorn/.npmignore +3 -0
- data/node_modules/acorn/.tern-project +6 -0
- data/node_modules/acorn/.travis.yml +6 -0
- data/node_modules/acorn/AUTHORS +43 -0
- data/node_modules/acorn/LICENSE +19 -0
- data/node_modules/acorn/README.md +396 -0
- data/node_modules/acorn/bin/acorn +71 -0
- data/node_modules/acorn/bin/build-acorn.js +82 -0
- data/node_modules/acorn/bin/generate-identifier-regex.js +47 -0
- data/node_modules/acorn/bin/update_authors.sh +6 -0
- data/node_modules/acorn/dist/.keep +0 -0
- data/node_modules/acorn/dist/acorn.js +3340 -0
- data/node_modules/acorn/dist/acorn_loose.js +1300 -0
- data/node_modules/acorn/dist/walk.js +377 -0
- data/node_modules/acorn/package.json +222 -0
- data/node_modules/acorn/src/bin/acorn.js +59 -0
- data/node_modules/acorn/src/expression.js +707 -0
- data/node_modules/acorn/src/identifier.js +90 -0
- data/node_modules/acorn/src/index.js +67 -0
- data/node_modules/acorn/src/location.js +24 -0
- data/node_modules/acorn/src/locutil.js +42 -0
- data/node_modules/acorn/src/loose/acorn_loose.js +0 -0
- data/node_modules/acorn/src/loose/expression.js +501 -0
- data/node_modules/acorn/src/loose/index.js +50 -0
- data/node_modules/acorn/src/loose/parseutil.js +1 -0
- data/node_modules/acorn/src/loose/state.js +160 -0
- data/node_modules/acorn/src/loose/statement.js +420 -0
- data/node_modules/acorn/src/loose/tokenize.js +108 -0
- data/node_modules/acorn/src/lval.js +215 -0
- data/node_modules/acorn/src/node.js +50 -0
- data/node_modules/acorn/src/options.js +121 -0
- data/node_modules/acorn/src/parseutil.js +102 -0
- data/node_modules/acorn/src/state.js +104 -0
- data/node_modules/acorn/src/statement.js +626 -0
- data/node_modules/acorn/src/tokencontext.js +109 -0
- data/node_modules/acorn/src/tokenize.js +682 -0
- data/node_modules/acorn/src/tokentype.js +147 -0
- data/node_modules/acorn/src/util.js +9 -0
- data/node_modules/acorn/src/walk/index.js +340 -0
- data/node_modules/acorn/src/whitespace.js +12 -0
- data/node_modules/amdefine/LICENSE +58 -0
- data/node_modules/amdefine/README.md +171 -0
- data/node_modules/amdefine/amdefine.js +301 -0
- data/node_modules/amdefine/intercept.js +36 -0
- data/node_modules/amdefine/package.json +86 -0
- data/node_modules/ansi-regex/index.js +4 -0
- data/node_modules/ansi-regex/license +21 -0
- data/node_modules/ansi-regex/package.json +121 -0
- data/node_modules/ansi-regex/readme.md +31 -0
- data/node_modules/ansi-styles/index.js +65 -0
- data/node_modules/ansi-styles/license +21 -0
- data/node_modules/ansi-styles/package.json +114 -0
- data/node_modules/ansi-styles/readme.md +86 -0
- data/node_modules/array-equal/.npmignore +1 -0
- data/node_modules/array-equal/LICENSE +22 -0
- data/node_modules/array-equal/README.md +11 -0
- data/node_modules/array-equal/component.json +10 -0
- data/node_modules/array-equal/index.js +9 -0
- data/node_modules/array-equal/package.json +75 -0
- data/node_modules/asn1/.npmignore +2 -0
- data/node_modules/asn1/.travis.yml +4 -0
- data/node_modules/asn1/LICENSE +19 -0
- data/node_modules/asn1/README.md +50 -0
- data/node_modules/asn1/lib/ber/errors.js +13 -0
- data/node_modules/asn1/lib/ber/index.js +27 -0
- data/node_modules/asn1/lib/ber/reader.js +261 -0
- data/node_modules/asn1/lib/ber/types.js +36 -0
- data/node_modules/asn1/lib/ber/writer.js +316 -0
- data/node_modules/asn1/lib/index.js +20 -0
- data/node_modules/asn1/package.json +98 -0
- data/node_modules/asn1/tst/ber/reader.test.js +208 -0
- data/node_modules/asn1/tst/ber/writer.test.js +370 -0
- data/node_modules/assert-plus/AUTHORS +6 -0
- data/node_modules/assert-plus/CHANGES.md +8 -0
- data/node_modules/assert-plus/README.md +155 -0
- data/node_modules/assert-plus/assert.js +206 -0
- data/node_modules/assert-plus/package.json +115 -0
- data/node_modules/assertion-error/.npmignore +11 -0
- data/node_modules/assertion-error/History.md +19 -0
- data/node_modules/assertion-error/README.md +41 -0
- data/node_modules/assertion-error/index.js +116 -0
- data/node_modules/assertion-error/package.json +95 -0
- data/node_modules/asynckit/LICENSE +21 -0
- data/node_modules/asynckit/README.md +233 -0
- data/node_modules/asynckit/bench.js +76 -0
- data/node_modules/asynckit/index.js +6 -0
- data/node_modules/asynckit/lib/abort.js +29 -0
- data/node_modules/asynckit/lib/async.js +34 -0
- data/node_modules/asynckit/lib/defer.js +26 -0
- data/node_modules/asynckit/lib/iterate.js +75 -0
- data/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- data/node_modules/asynckit/lib/readable_parallel.js +25 -0
- data/node_modules/asynckit/lib/readable_serial.js +25 -0
- data/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- data/node_modules/asynckit/lib/state.js +37 -0
- data/node_modules/asynckit/lib/streamify.js +141 -0
- data/node_modules/asynckit/lib/terminator.js +29 -0
- data/node_modules/asynckit/package.json +126 -0
- data/node_modules/asynckit/parallel.js +43 -0
- data/node_modules/asynckit/serial.js +17 -0
- data/node_modules/asynckit/serialOrdered.js +75 -0
- data/node_modules/asynckit/stream.js +21 -0
- data/node_modules/aws-sign2/LICENSE +55 -0
- data/node_modules/aws-sign2/README.md +4 -0
- data/node_modules/aws-sign2/index.js +212 -0
- data/node_modules/aws-sign2/package.json +81 -0
- data/node_modules/aws4/.npmignore +4 -0
- data/node_modules/aws4/.tern-port +1 -0
- data/node_modules/aws4/.travis.yml +5 -0
- data/node_modules/aws4/LICENSE +19 -0
- data/node_modules/aws4/README.md +523 -0
- data/node_modules/aws4/aws4.js +323 -0
- data/node_modules/aws4/lru.js +96 -0
- data/node_modules/aws4/package.json +140 -0
- data/node_modules/bcrypt-pbkdf/README.md +39 -0
- data/node_modules/bcrypt-pbkdf/index.js +559 -0
- data/node_modules/bcrypt-pbkdf/package.json +72 -0
- data/node_modules/boom/.npmignore +18 -0
- data/node_modules/boom/.travis.yml +8 -0
- data/node_modules/boom/CONTRIBUTING.md +1 -0
- data/node_modules/boom/LICENSE +28 -0
- data/node_modules/boom/README.md +652 -0
- data/node_modules/boom/images/boom.png +0 -0
- data/node_modules/boom/lib/index.js +318 -0
- data/node_modules/boom/package.json +98 -0
- data/node_modules/boom/test/index.js +654 -0
- data/node_modules/caseless/LICENSE +28 -0
- data/node_modules/caseless/README.md +45 -0
- data/node_modules/caseless/index.js +66 -0
- data/node_modules/caseless/package.json +96 -0
- data/node_modules/caseless/test.js +40 -0
- data/node_modules/chai/.npmignore +14 -0
- data/node_modules/chai/CODE_OF_CONDUCT.md +58 -0
- data/node_modules/chai/CONTRIBUTING.md +214 -0
- data/node_modules/chai/History.md +1059 -0
- data/node_modules/chai/README.md +83 -0
- data/node_modules/chai/ReleaseNotes.md +737 -0
- data/node_modules/chai/bower.json +26 -0
- data/node_modules/chai/chai.js +6142 -0
- data/node_modules/chai/index.js +1 -0
- data/node_modules/chai/karma.conf.js +28 -0
- data/node_modules/chai/karma.sauce.js +41 -0
- data/node_modules/chai/lib/chai.js +93 -0
- data/node_modules/chai/lib/chai/assertion.js +131 -0
- data/node_modules/chai/lib/chai/config.js +55 -0
- data/node_modules/chai/lib/chai/core/assertions.js +1860 -0
- data/node_modules/chai/lib/chai/interface/assert.js +1645 -0
- data/node_modules/chai/lib/chai/interface/expect.js +34 -0
- data/node_modules/chai/lib/chai/interface/should.js +201 -0
- data/node_modules/chai/lib/chai/utils/addChainableMethod.js +112 -0
- data/node_modules/chai/lib/chai/utils/addMethod.js +44 -0
- data/node_modules/chai/lib/chai/utils/addProperty.js +48 -0
- data/node_modules/chai/lib/chai/utils/expectTypes.js +42 -0
- data/node_modules/chai/lib/chai/utils/flag.js +33 -0
- data/node_modules/chai/lib/chai/utils/getActual.js +20 -0
- data/node_modules/chai/lib/chai/utils/getEnumerableProperties.js +26 -0
- data/node_modules/chai/lib/chai/utils/getMessage.js +51 -0
- data/node_modules/chai/lib/chai/utils/getName.js +22 -0
- data/node_modules/chai/lib/chai/utils/getPathInfo.js +111 -0
- data/node_modules/chai/lib/chai/utils/getPathValue.js +43 -0
- data/node_modules/chai/lib/chai/utils/getProperties.js +36 -0
- data/node_modules/chai/lib/chai/utils/hasProperty.js +64 -0
- data/node_modules/chai/lib/chai/utils/index.js +130 -0
- data/node_modules/chai/lib/chai/utils/inspect.js +335 -0
- data/node_modules/chai/lib/chai/utils/objDisplay.js +50 -0
- data/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js +54 -0
- data/node_modules/chai/lib/chai/utils/overwriteMethod.js +52 -0
- data/node_modules/chai/lib/chai/utils/overwriteProperty.js +55 -0
- data/node_modules/chai/lib/chai/utils/test.js +28 -0
- data/node_modules/chai/lib/chai/utils/transferFlags.js +45 -0
- data/node_modules/chai/package.json +128 -0
- data/node_modules/chai/sauce.browsers.js +128 -0
- data/node_modules/chalk/index.js +116 -0
- data/node_modules/chalk/license +21 -0
- data/node_modules/chalk/package.json +140 -0
- data/node_modules/chalk/readme.md +213 -0
- data/node_modules/combined-stream/License +19 -0
- data/node_modules/combined-stream/Readme.md +138 -0
- data/node_modules/combined-stream/lib/combined_stream.js +188 -0
- data/node_modules/combined-stream/package.json +101 -0
- data/node_modules/commander/History.md +261 -0
- data/node_modules/commander/LICENSE +22 -0
- data/node_modules/commander/Readme.md +351 -0
- data/node_modules/commander/index.js +1110 -0
- data/node_modules/commander/package.json +104 -0
- data/node_modules/content-type-parser/LICENSE.txt +19 -0
- data/node_modules/content-type-parser/README.md +60 -0
- data/node_modules/content-type-parser/lib/content-type-parser.js +103 -0
- data/node_modules/content-type-parser/package.json +96 -0
- data/node_modules/cryptiles/.npmignore +18 -0
- data/node_modules/cryptiles/.travis.yml +8 -0
- data/node_modules/cryptiles/LICENSE +28 -0
- data/node_modules/cryptiles/README.md +16 -0
- data/node_modules/cryptiles/lib/index.js +68 -0
- data/node_modules/cryptiles/package.json +94 -0
- data/node_modules/cryptiles/test/index.js +102 -0
- data/node_modules/cssom/LICENSE.txt +20 -0
- data/node_modules/cssom/README.mdown +69 -0
- data/node_modules/cssom/lib/CSSDocumentRule.js +39 -0
- data/node_modules/cssom/lib/CSSFontFaceRule.js +36 -0
- data/node_modules/cssom/lib/CSSImportRule.js +132 -0
- data/node_modules/cssom/lib/CSSKeyframeRule.js +37 -0
- data/node_modules/cssom/lib/CSSKeyframesRule.js +39 -0
- data/node_modules/cssom/lib/CSSMediaRule.js +41 -0
- data/node_modules/cssom/lib/CSSRule.js +43 -0
- data/node_modules/cssom/lib/CSSStyleDeclaration.js +148 -0
- data/node_modules/cssom/lib/CSSStyleRule.js +190 -0
- data/node_modules/cssom/lib/CSSStyleSheet.js +88 -0
- data/node_modules/cssom/lib/CSSValue.js +43 -0
- data/node_modules/cssom/lib/CSSValueExpression.js +344 -0
- data/node_modules/cssom/lib/MatcherList.js +62 -0
- data/node_modules/cssom/lib/MediaList.js +61 -0
- data/node_modules/cssom/lib/StyleSheet.js +17 -0
- data/node_modules/cssom/lib/clone.js +76 -0
- data/node_modules/cssom/lib/index.js +19 -0
- data/node_modules/cssom/lib/parse.js +381 -0
- data/node_modules/cssom/package.json +96 -0
- data/node_modules/cssstyle/.npmignore +1 -0
- data/node_modules/cssstyle/MIT-LICENSE.txt +20 -0
- data/node_modules/cssstyle/README.md +27 -0
- data/node_modules/cssstyle/lib/CSSStyleDeclaration.js +233 -0
- data/node_modules/cssstyle/lib/parsers.js +670 -0
- data/node_modules/cssstyle/lib/properties.js +5858 -0
- data/node_modules/cssstyle/lib/properties/alignmentBaseline.js +12 -0
- data/node_modules/cssstyle/lib/properties/azimuth.js +65 -0
- data/node_modules/cssstyle/lib/properties/background.js +24 -0
- data/node_modules/cssstyle/lib/properties/backgroundAttachment.js +22 -0
- data/node_modules/cssstyle/lib/properties/backgroundClip.js +12 -0
- data/node_modules/cssstyle/lib/properties/backgroundColor.js +33 -0
- data/node_modules/cssstyle/lib/properties/backgroundImage.js +29 -0
- data/node_modules/cssstyle/lib/properties/backgroundOrigin.js +12 -0
- data/node_modules/cssstyle/lib/properties/backgroundPosition.js +56 -0
- data/node_modules/cssstyle/lib/properties/backgroundPositionX.js +12 -0
- data/node_modules/cssstyle/lib/properties/backgroundPositionY.js +12 -0
- data/node_modules/cssstyle/lib/properties/backgroundRepeat.js +25 -0
- data/node_modules/cssstyle/lib/properties/backgroundRepeatX.js +12 -0
- data/node_modules/cssstyle/lib/properties/backgroundRepeatY.js +12 -0
- data/node_modules/cssstyle/lib/properties/backgroundSize.js +12 -0
- data/node_modules/cssstyle/lib/properties/baselineShift.js +12 -0
- data/node_modules/cssstyle/lib/properties/border.js +49 -0
- data/node_modules/cssstyle/lib/properties/borderBottom.js +23 -0
- data/node_modules/cssstyle/lib/properties/borderBottomColor.js +16 -0
- data/node_modules/cssstyle/lib/properties/borderBottomLeftRadius.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderBottomRightRadius.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderBottomStyle.js +21 -0
- data/node_modules/cssstyle/lib/properties/borderBottomWidth.js +16 -0
- data/node_modules/cssstyle/lib/properties/borderCollapse.js +25 -0
- data/node_modules/cssstyle/lib/properties/borderColor.js +28 -0
- data/node_modules/cssstyle/lib/properties/borderImage.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderImageOutset.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderImageRepeat.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderImageSlice.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderImageSource.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderImageWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderLeft.js +23 -0
- data/node_modules/cssstyle/lib/properties/borderLeftColor.js +16 -0
- data/node_modules/cssstyle/lib/properties/borderLeftStyle.js +21 -0
- data/node_modules/cssstyle/lib/properties/borderLeftWidth.js +16 -0
- data/node_modules/cssstyle/lib/properties/borderRadius.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderRight.js +23 -0
- data/node_modules/cssstyle/lib/properties/borderRightColor.js +16 -0
- data/node_modules/cssstyle/lib/properties/borderRightStyle.js +21 -0
- data/node_modules/cssstyle/lib/properties/borderRightWidth.js +16 -0
- data/node_modules/cssstyle/lib/properties/borderSpacing.js +42 -0
- data/node_modules/cssstyle/lib/properties/borderStyle.js +27 -0
- data/node_modules/cssstyle/lib/properties/borderTop.js +22 -0
- data/node_modules/cssstyle/lib/properties/borderTopColor.js +16 -0
- data/node_modules/cssstyle/lib/properties/borderTopLeftRadius.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderTopRightRadius.js +12 -0
- data/node_modules/cssstyle/lib/properties/borderTopStyle.js +21 -0
- data/node_modules/cssstyle/lib/properties/borderTopWidth.js +17 -0
- data/node_modules/cssstyle/lib/properties/borderWidth.js +47 -0
- data/node_modules/cssstyle/lib/properties/bottom.js +14 -0
- data/node_modules/cssstyle/lib/properties/boxShadow.js +12 -0
- data/node_modules/cssstyle/lib/properties/boxSizing.js +12 -0
- data/node_modules/cssstyle/lib/properties/captionSide.js +12 -0
- data/node_modules/cssstyle/lib/properties/clear.js +16 -0
- data/node_modules/cssstyle/lib/properties/clip.js +49 -0
- data/node_modules/cssstyle/lib/properties/color.js +14 -0
- data/node_modules/cssstyle/lib/properties/colorInterpolation.js +12 -0
- data/node_modules/cssstyle/lib/properties/colorInterpolationFilters.js +12 -0
- data/node_modules/cssstyle/lib/properties/colorProfile.js +12 -0
- data/node_modules/cssstyle/lib/properties/colorRendering.js +12 -0
- data/node_modules/cssstyle/lib/properties/content.js +12 -0
- data/node_modules/cssstyle/lib/properties/counterIncrement.js +12 -0
- data/node_modules/cssstyle/lib/properties/counterReset.js +12 -0
- data/node_modules/cssstyle/lib/properties/cssFloat.js +12 -0
- data/node_modules/cssstyle/lib/properties/cue.js +12 -0
- data/node_modules/cssstyle/lib/properties/cueAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/cueBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/cursor.js +12 -0
- data/node_modules/cssstyle/lib/properties/direction.js +12 -0
- data/node_modules/cssstyle/lib/properties/display.js +12 -0
- data/node_modules/cssstyle/lib/properties/dominantBaseline.js +12 -0
- data/node_modules/cssstyle/lib/properties/elevation.js +12 -0
- data/node_modules/cssstyle/lib/properties/emptyCells.js +12 -0
- data/node_modules/cssstyle/lib/properties/enableBackground.js +12 -0
- data/node_modules/cssstyle/lib/properties/fill.js +12 -0
- data/node_modules/cssstyle/lib/properties/fillOpacity.js +12 -0
- data/node_modules/cssstyle/lib/properties/fillRule.js +12 -0
- data/node_modules/cssstyle/lib/properties/filter.js +12 -0
- data/node_modules/cssstyle/lib/properties/floodColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/floodOpacity.js +12 -0
- data/node_modules/cssstyle/lib/properties/font.js +40 -0
- data/node_modules/cssstyle/lib/properties/fontFamily.js +33 -0
- data/node_modules/cssstyle/lib/properties/fontSize.js +25 -0
- data/node_modules/cssstyle/lib/properties/fontSizeAdjust.js +12 -0
- data/node_modules/cssstyle/lib/properties/fontStretch.js +12 -0
- data/node_modules/cssstyle/lib/properties/fontStyle.js +18 -0
- data/node_modules/cssstyle/lib/properties/fontVariant.js +18 -0
- data/node_modules/cssstyle/lib/properties/fontWeight.js +18 -0
- data/node_modules/cssstyle/lib/properties/glyphOrientationHorizontal.js +12 -0
- data/node_modules/cssstyle/lib/properties/glyphOrientationVertical.js +12 -0
- data/node_modules/cssstyle/lib/properties/height.js +24 -0
- data/node_modules/cssstyle/lib/properties/imageRendering.js +12 -0
- data/node_modules/cssstyle/lib/properties/kerning.js +12 -0
- data/node_modules/cssstyle/lib/properties/left.js +14 -0
- data/node_modules/cssstyle/lib/properties/letterSpacing.js +12 -0
- data/node_modules/cssstyle/lib/properties/lightingColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/lineHeight.js +21 -0
- data/node_modules/cssstyle/lib/properties/listStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/listStyleImage.js +12 -0
- data/node_modules/cssstyle/lib/properties/listStylePosition.js +12 -0
- data/node_modules/cssstyle/lib/properties/listStyleType.js +12 -0
- data/node_modules/cssstyle/lib/properties/margin.js +59 -0
- data/node_modules/cssstyle/lib/properties/marginBottom.js +13 -0
- data/node_modules/cssstyle/lib/properties/marginLeft.js +13 -0
- data/node_modules/cssstyle/lib/properties/marginRight.js +13 -0
- data/node_modules/cssstyle/lib/properties/marginTop.js +13 -0
- data/node_modules/cssstyle/lib/properties/marker.js +12 -0
- data/node_modules/cssstyle/lib/properties/markerEnd.js +12 -0
- data/node_modules/cssstyle/lib/properties/markerMid.js +12 -0
- data/node_modules/cssstyle/lib/properties/markerOffset.js +12 -0
- data/node_modules/cssstyle/lib/properties/markerStart.js +12 -0
- data/node_modules/cssstyle/lib/properties/marks.js +12 -0
- data/node_modules/cssstyle/lib/properties/mask.js +12 -0
- data/node_modules/cssstyle/lib/properties/maxHeight.js +12 -0
- data/node_modules/cssstyle/lib/properties/maxWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/minHeight.js +12 -0
- data/node_modules/cssstyle/lib/properties/minWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/opacity.js +14 -0
- data/node_modules/cssstyle/lib/properties/orphans.js +12 -0
- data/node_modules/cssstyle/lib/properties/outline.js +12 -0
- data/node_modules/cssstyle/lib/properties/outlineColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/outlineOffset.js +12 -0
- data/node_modules/cssstyle/lib/properties/outlineStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/outlineWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/overflow.js +12 -0
- data/node_modules/cssstyle/lib/properties/overflowX.js +12 -0
- data/node_modules/cssstyle/lib/properties/overflowY.js +12 -0
- data/node_modules/cssstyle/lib/properties/padding.js +52 -0
- data/node_modules/cssstyle/lib/properties/paddingBottom.js +13 -0
- data/node_modules/cssstyle/lib/properties/paddingLeft.js +13 -0
- data/node_modules/cssstyle/lib/properties/paddingRight.js +13 -0
- data/node_modules/cssstyle/lib/properties/paddingTop.js +13 -0
- data/node_modules/cssstyle/lib/properties/page.js +12 -0
- data/node_modules/cssstyle/lib/properties/pageBreakAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/pageBreakBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/pageBreakInside.js +12 -0
- data/node_modules/cssstyle/lib/properties/pause.js +12 -0
- data/node_modules/cssstyle/lib/properties/pauseAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/pauseBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/pitch.js +12 -0
- data/node_modules/cssstyle/lib/properties/pitchRange.js +12 -0
- data/node_modules/cssstyle/lib/properties/playDuring.js +12 -0
- data/node_modules/cssstyle/lib/properties/pointerEvents.js +12 -0
- data/node_modules/cssstyle/lib/properties/position.js +12 -0
- data/node_modules/cssstyle/lib/properties/quotes.js +12 -0
- data/node_modules/cssstyle/lib/properties/resize.js +12 -0
- data/node_modules/cssstyle/lib/properties/richness.js +12 -0
- data/node_modules/cssstyle/lib/properties/right.js +14 -0
- data/node_modules/cssstyle/lib/properties/shapeRendering.js +12 -0
- data/node_modules/cssstyle/lib/properties/size.js +12 -0
- data/node_modules/cssstyle/lib/properties/speak.js +12 -0
- data/node_modules/cssstyle/lib/properties/speakHeader.js +12 -0
- data/node_modules/cssstyle/lib/properties/speakNumeral.js +12 -0
- data/node_modules/cssstyle/lib/properties/speakPunctuation.js +12 -0
- data/node_modules/cssstyle/lib/properties/speechRate.js +12 -0
- data/node_modules/cssstyle/lib/properties/src.js +12 -0
- data/node_modules/cssstyle/lib/properties/stopColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/stopOpacity.js +12 -0
- data/node_modules/cssstyle/lib/properties/stress.js +12 -0
- data/node_modules/cssstyle/lib/properties/stroke.js +12 -0
- data/node_modules/cssstyle/lib/properties/strokeDasharray.js +12 -0
- data/node_modules/cssstyle/lib/properties/strokeDashoffset.js +12 -0
- data/node_modules/cssstyle/lib/properties/strokeLinecap.js +12 -0
- data/node_modules/cssstyle/lib/properties/strokeLinejoin.js +12 -0
- data/node_modules/cssstyle/lib/properties/strokeMiterlimit.js +12 -0
- data/node_modules/cssstyle/lib/properties/strokeOpacity.js +12 -0
- data/node_modules/cssstyle/lib/properties/strokeWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/tableLayout.js +12 -0
- data/node_modules/cssstyle/lib/properties/textAlign.js +12 -0
- data/node_modules/cssstyle/lib/properties/textAnchor.js +12 -0
- data/node_modules/cssstyle/lib/properties/textDecoration.js +12 -0
- data/node_modules/cssstyle/lib/properties/textIndent.js +12 -0
- data/node_modules/cssstyle/lib/properties/textLineThrough.js +12 -0
- data/node_modules/cssstyle/lib/properties/textLineThroughColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/textLineThroughMode.js +12 -0
- data/node_modules/cssstyle/lib/properties/textLineThroughStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/textLineThroughWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/textOverflow.js +12 -0
- data/node_modules/cssstyle/lib/properties/textOverline.js +12 -0
- data/node_modules/cssstyle/lib/properties/textOverlineColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/textOverlineMode.js +12 -0
- data/node_modules/cssstyle/lib/properties/textOverlineStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/textOverlineWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/textRendering.js +12 -0
- data/node_modules/cssstyle/lib/properties/textShadow.js +12 -0
- data/node_modules/cssstyle/lib/properties/textTransform.js +12 -0
- data/node_modules/cssstyle/lib/properties/textUnderline.js +12 -0
- data/node_modules/cssstyle/lib/properties/textUnderlineColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/textUnderlineMode.js +12 -0
- data/node_modules/cssstyle/lib/properties/textUnderlineStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/textUnderlineWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/top.js +14 -0
- data/node_modules/cssstyle/lib/properties/unicodeBidi.js +12 -0
- data/node_modules/cssstyle/lib/properties/unicodeRange.js +12 -0
- data/node_modules/cssstyle/lib/properties/vectorEffect.js +12 -0
- data/node_modules/cssstyle/lib/properties/verticalAlign.js +12 -0
- data/node_modules/cssstyle/lib/properties/visibility.js +12 -0
- data/node_modules/cssstyle/lib/properties/voiceFamily.js +12 -0
- data/node_modules/cssstyle/lib/properties/volume.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimation.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationDelay.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationDirection.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationDuration.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationFillMode.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationIterationCount.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationName.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationPlayState.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAnimationTimingFunction.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAppearance.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitAspectRatio.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBackfaceVisibility.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBackgroundClip.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBackgroundComposite.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBackgroundOrigin.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBackgroundSize.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderAfterColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderAfterStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderAfterWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderBeforeColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderBeforeStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderBeforeWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderEnd.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderEndColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderEndStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderEndWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderFit.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderHorizontalSpacing.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderImage.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderRadius.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderStart.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderStartColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderStartStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderStartWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBorderVerticalSpacing.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxAlign.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxDirection.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxFlex.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxFlexGroup.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxLines.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxOrdinalGroup.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxOrient.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxPack.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxReflect.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitBoxShadow.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColorCorrection.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnAxis.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnBreakAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnBreakBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnBreakInside.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnCount.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnGap.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnRule.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnRuleColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnRuleStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnRuleWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnSpan.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumnWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitColumns.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFilter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexAlign.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexDirection.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexFlow.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexItemAlign.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexLinePack.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexOrder.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexPack.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlexWrap.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlowFrom.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFlowInto.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFontFeatureSettings.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFontKerning.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFontSizeDelta.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFontSmoothing.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitFontVariantLigatures.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitHighlight.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitHyphenateCharacter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitHyphenateLimitAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitHyphenateLimitBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitHyphenateLimitLines.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitHyphens.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLineAlign.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLineBoxContain.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLineBreak.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLineClamp.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLineGrid.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLineSnap.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLocale.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLogicalHeight.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitLogicalWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginAfterCollapse.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginBeforeCollapse.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginBottomCollapse.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginCollapse.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginEnd.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginStart.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarginTopCollapse.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarquee.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarqueeDirection.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarqueeIncrement.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarqueeRepetition.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarqueeSpeed.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMarqueeStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMask.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskAttachment.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskBoxImage.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskBoxImageOutset.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskBoxImageRepeat.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSlice.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSource.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskBoxImageWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskClip.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskComposite.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskImage.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskOrigin.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskPosition.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskPositionX.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskPositionY.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskRepeat.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskRepeatX.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskRepeatY.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaskSize.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMatchNearestMailBlockquoteColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitMaxLogicalHeight.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMaxLogicalWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMinLogicalHeight.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitMinLogicalWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitNbspMode.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitOverflowScrolling.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPaddingAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPaddingBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPaddingEnd.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPaddingStart.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPerspective.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPerspectiveOrigin.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginX.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginY.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitPrintColorAdjust.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitRegionBreakAfter.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitRegionBreakBefore.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitRegionBreakInside.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitRegionOverflow.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitRtlOrdering.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitSvgShadow.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTapHighlightColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitTextCombine.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextDecorationsInEffect.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextEmphasis.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextEmphasisColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitTextEmphasisPosition.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextEmphasisStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextFillColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitTextOrientation.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextSecurity.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextSizeAdjust.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextStroke.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTextStrokeColor.js +14 -0
- data/node_modules/cssstyle/lib/properties/webkitTextStrokeWidth.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransform.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransformOrigin.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransformOriginX.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransformOriginY.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransformOriginZ.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransformStyle.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransition.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransitionDelay.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransitionDuration.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransitionProperty.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitTransitionTimingFunction.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitUserDrag.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitUserModify.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitUserSelect.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWrap.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWrapFlow.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWrapMargin.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWrapPadding.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWrapShapeInside.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWrapShapeOutside.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWrapThrough.js +12 -0
- data/node_modules/cssstyle/lib/properties/webkitWritingMode.js +12 -0
- data/node_modules/cssstyle/lib/properties/whiteSpace.js +12 -0
- data/node_modules/cssstyle/lib/properties/widows.js +12 -0
- data/node_modules/cssstyle/lib/properties/width.js +24 -0
- data/node_modules/cssstyle/lib/properties/wordBreak.js +12 -0
- data/node_modules/cssstyle/lib/properties/wordSpacing.js +12 -0
- data/node_modules/cssstyle/lib/properties/wordWrap.js +12 -0
- data/node_modules/cssstyle/lib/properties/writingMode.js +12 -0
- data/node_modules/cssstyle/lib/properties/zIndex.js +12 -0
- data/node_modules/cssstyle/lib/properties/zoom.js +12 -0
- data/node_modules/cssstyle/package.json +109 -0
- data/node_modules/cssstyle/scripts/generate_properties.js +302 -0
- data/node_modules/cssstyle/scripts/run_tests.sh +4 -0
- data/node_modules/cssstyle/tests/tests.js +405 -0
- data/node_modules/dashdash/CHANGES.md +364 -0
- data/node_modules/dashdash/LICENSE.txt +24 -0
- data/node_modules/dashdash/README.md +574 -0
- data/node_modules/dashdash/etc/dashdash.bash_completion.in +389 -0
- data/node_modules/dashdash/lib/dashdash.js +1055 -0
- data/node_modules/dashdash/node_modules/assert-plus/AUTHORS +6 -0
- data/node_modules/dashdash/node_modules/assert-plus/CHANGES.md +14 -0
- data/node_modules/dashdash/node_modules/assert-plus/README.md +162 -0
- data/node_modules/dashdash/node_modules/assert-plus/assert.js +211 -0
- data/node_modules/dashdash/node_modules/assert-plus/package.json +115 -0
- data/node_modules/dashdash/package.json +125 -0
- data/node_modules/deep-eql/.npmignore +11 -0
- data/node_modules/deep-eql/History.md +28 -0
- data/node_modules/deep-eql/README.md +52 -0
- data/node_modules/deep-eql/index.js +1 -0
- data/node_modules/deep-eql/karma.conf.js +20 -0
- data/node_modules/deep-eql/lib/eql.js +257 -0
- data/node_modules/deep-eql/node_modules/type-detect/.npmignore +11 -0
- data/node_modules/deep-eql/node_modules/type-detect/History.md +18 -0
- data/node_modules/deep-eql/node_modules/type-detect/README.md +193 -0
- data/node_modules/deep-eql/node_modules/type-detect/index.js +1 -0
- data/node_modules/deep-eql/node_modules/type-detect/lib/type.js +142 -0
- data/node_modules/deep-eql/node_modules/type-detect/package.json +91 -0
- data/node_modules/deep-eql/package.json +98 -0
- data/node_modules/deep-is/.npmignore +1 -0
- data/node_modules/deep-is/.travis.yml +6 -0
- data/node_modules/deep-is/LICENSE +22 -0
- data/node_modules/deep-is/README.markdown +70 -0
- data/node_modules/deep-is/example/cmp.js +11 -0
- data/node_modules/deep-is/index.js +102 -0
- data/node_modules/deep-is/package.json +120 -0
- data/node_modules/deep-is/test/NaN.js +16 -0
- data/node_modules/deep-is/test/cmp.js +23 -0
- data/node_modules/deep-is/test/neg-vs-pos-0.js +15 -0
- data/node_modules/delayed-stream/.npmignore +1 -0
- data/node_modules/delayed-stream/License +19 -0
- data/node_modules/delayed-stream/Makefile +7 -0
- data/node_modules/delayed-stream/Readme.md +141 -0
- data/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- data/node_modules/delayed-stream/package.json +97 -0
- data/node_modules/ecc-jsbn/.npmignore +15 -0
- data/node_modules/ecc-jsbn/LICENSE +21 -0
- data/node_modules/ecc-jsbn/README.md +8 -0
- data/node_modules/ecc-jsbn/index.js +57 -0
- data/node_modules/ecc-jsbn/lib/LICENSE-jsbn +40 -0
- data/node_modules/ecc-jsbn/lib/ec.js +561 -0
- data/node_modules/ecc-jsbn/lib/sec.js +170 -0
- data/node_modules/ecc-jsbn/package.json +90 -0
- data/node_modules/ecc-jsbn/test.js +14 -0
- data/node_modules/escape-string-regexp/index.js +11 -0
- data/node_modules/escape-string-regexp/license +21 -0
- data/node_modules/escape-string-regexp/package.json +109 -0
- data/node_modules/escape-string-regexp/readme.md +27 -0
- data/node_modules/escodegen/LICENSE.BSD +19 -0
- data/node_modules/escodegen/LICENSE.source-map +27 -0
- data/node_modules/escodegen/README.md +116 -0
- data/node_modules/escodegen/bin/escodegen.js +77 -0
- data/node_modules/escodegen/bin/esgenerate.js +64 -0
- data/node_modules/escodegen/escodegen.js +2607 -0
- data/node_modules/escodegen/package.json +122 -0
- data/node_modules/esprima/ChangeLog +174 -0
- data/node_modules/esprima/LICENSE.BSD +21 -0
- data/node_modules/esprima/README.md +27 -0
- data/node_modules/esprima/bin/esparse.js +126 -0
- data/node_modules/esprima/bin/esvalidate.js +199 -0
- data/node_modules/esprima/esprima.js +5740 -0
- data/node_modules/esprima/package.json +153 -0
- data/node_modules/estraverse/.editorconfig +10 -0
- data/node_modules/estraverse/.jshintrc +16 -0
- data/node_modules/estraverse/LICENSE.BSD +19 -0
- data/node_modules/estraverse/README.md +124 -0
- data/node_modules/estraverse/estraverse.js +845 -0
- data/node_modules/estraverse/gulpfile.js +70 -0
- data/node_modules/estraverse/package.json +95 -0
- data/node_modules/esutils/LICENSE.BSD +19 -0
- data/node_modules/esutils/README.md +169 -0
- data/node_modules/esutils/lib/ast.js +144 -0
- data/node_modules/esutils/lib/code.js +135 -0
- data/node_modules/esutils/lib/keyword.js +165 -0
- data/node_modules/esutils/lib/utils.js +33 -0
- data/node_modules/esutils/package.json +105 -0
- data/node_modules/extend/.eslintrc +192 -0
- data/node_modules/extend/.jscs.json +104 -0
- data/node_modules/extend/.npmignore +1 -0
- data/node_modules/extend/.travis.yml +44 -0
- data/node_modules/extend/CHANGELOG.md +69 -0
- data/node_modules/extend/LICENSE +23 -0
- data/node_modules/extend/README.md +62 -0
- data/node_modules/extend/component.json +32 -0
- data/node_modules/extend/index.js +86 -0
- data/node_modules/extend/package.json +106 -0
- data/node_modules/extsprintf/.gitmodules +6 -0
- data/node_modules/extsprintf/LICENSE +19 -0
- data/node_modules/extsprintf/Makefile +23 -0
- data/node_modules/extsprintf/Makefile.deps +39 -0
- data/node_modules/extsprintf/Makefile.targ +285 -0
- data/node_modules/extsprintf/README.md +39 -0
- data/node_modules/extsprintf/examples/simple.js +2 -0
- data/node_modules/extsprintf/jsl.node.conf +137 -0
- data/node_modules/extsprintf/lib/extsprintf.js +166 -0
- data/node_modules/extsprintf/package.json +74 -0
- data/node_modules/fast-levenshtein/LICENSE.md +25 -0
- data/node_modules/fast-levenshtein/README.md +104 -0
- data/node_modules/fast-levenshtein/levenshtein.js +102 -0
- data/node_modules/fast-levenshtein/package.json +108 -0
- data/node_modules/forever-agent/LICENSE +55 -0
- data/node_modules/forever-agent/README.md +4 -0
- data/node_modules/forever-agent/index.js +138 -0
- data/node_modules/forever-agent/package.json +88 -0
- data/node_modules/form-data/License +19 -0
- data/node_modules/form-data/README.md +217 -0
- data/node_modules/form-data/lib/browser.js +2 -0
- data/node_modules/form-data/lib/form_data.js +440 -0
- data/node_modules/form-data/lib/populate.js +10 -0
- data/node_modules/form-data/package.json +145 -0
- data/node_modules/generate-function/.npmignore +1 -0
- data/node_modules/generate-function/.travis.yml +3 -0
- data/node_modules/generate-function/README.md +72 -0
- data/node_modules/generate-function/example.js +27 -0
- data/node_modules/generate-function/index.js +61 -0
- data/node_modules/generate-function/package.json +87 -0
- data/node_modules/generate-function/test.js +33 -0
- data/node_modules/generate-object-property/.npmignore +1 -0
- data/node_modules/generate-object-property/.travis.yml +3 -0
- data/node_modules/generate-object-property/LICENSE +21 -0
- data/node_modules/generate-object-property/README.md +19 -0
- data/node_modules/generate-object-property/index.js +12 -0
- data/node_modules/generate-object-property/package.json +84 -0
- data/node_modules/generate-object-property/test.js +12 -0
- data/node_modules/getpass/.npmignore +8 -0
- data/node_modules/getpass/.travis.yml +9 -0
- data/node_modules/getpass/LICENSE +18 -0
- data/node_modules/getpass/README.md +32 -0
- data/node_modules/getpass/lib/index.js +123 -0
- data/node_modules/getpass/node_modules/assert-plus/AUTHORS +6 -0
- data/node_modules/getpass/node_modules/assert-plus/CHANGES.md +14 -0
- data/node_modules/getpass/node_modules/assert-plus/README.md +162 -0
- data/node_modules/getpass/node_modules/assert-plus/assert.js +211 -0
- data/node_modules/getpass/node_modules/assert-plus/package.json +115 -0
- data/node_modules/getpass/package.json +90 -0
- data/node_modules/graceful-readlink/.npmignore +3 -0
- data/node_modules/graceful-readlink/.travis.yml +5 -0
- data/node_modules/graceful-readlink/LICENSE +22 -0
- data/node_modules/graceful-readlink/README.md +17 -0
- data/node_modules/graceful-readlink/index.js +12 -0
- data/node_modules/graceful-readlink/package.json +83 -0
- data/node_modules/har-validator/LICENSE +13 -0
- data/node_modules/har-validator/README.md +309 -0
- data/node_modules/har-validator/bin/har-validator +56 -0
- data/node_modules/har-validator/lib/async.js +14 -0
- data/node_modules/har-validator/lib/error.js +10 -0
- data/node_modules/har-validator/lib/index.js +22 -0
- data/node_modules/har-validator/lib/runner.js +29 -0
- data/node_modules/har-validator/lib/schemas/cache.json +13 -0
- data/node_modules/har-validator/lib/schemas/cacheEntry.json +31 -0
- data/node_modules/har-validator/lib/schemas/content.json +27 -0
- data/node_modules/har-validator/lib/schemas/cookie.json +34 -0
- data/node_modules/har-validator/lib/schemas/creator.json +18 -0
- data/node_modules/har-validator/lib/schemas/entry.json +51 -0
- data/node_modules/har-validator/lib/schemas/har.json +11 -0
- data/node_modules/har-validator/lib/schemas/index.js +49 -0
- data/node_modules/har-validator/lib/schemas/log.json +34 -0
- data/node_modules/har-validator/lib/schemas/page.json +30 -0
- data/node_modules/har-validator/lib/schemas/pageTimings.json +16 -0
- data/node_modules/har-validator/lib/schemas/postData.json +41 -0
- data/node_modules/har-validator/lib/schemas/record.json +18 -0
- data/node_modules/har-validator/lib/schemas/request.json +55 -0
- data/node_modules/har-validator/lib/schemas/response.json +52 -0
- data/node_modules/har-validator/lib/schemas/timings.json +40 -0
- data/node_modules/har-validator/package.json +120 -0
- data/node_modules/has-ansi/index.js +4 -0
- data/node_modules/has-ansi/license +21 -0
- data/node_modules/has-ansi/package.json +118 -0
- data/node_modules/has-ansi/readme.md +36 -0
- data/node_modules/hawk/.npmignore +20 -0
- data/node_modules/hawk/.travis.yml +5 -0
- data/node_modules/hawk/LICENSE +28 -0
- data/node_modules/hawk/README.md +634 -0
- data/node_modules/hawk/bower.json +24 -0
- data/node_modules/hawk/component.json +19 -0
- data/node_modules/hawk/dist/client.js +343 -0
- data/node_modules/hawk/example/usage.js +78 -0
- data/node_modules/hawk/images/hawk.png +0 -0
- data/node_modules/hawk/images/logo.png +0 -0
- data/node_modules/hawk/lib/browser.js +637 -0
- data/node_modules/hawk/lib/client.js +369 -0
- data/node_modules/hawk/lib/crypto.js +126 -0
- data/node_modules/hawk/lib/index.js +15 -0
- data/node_modules/hawk/lib/server.js +548 -0
- data/node_modules/hawk/lib/utils.js +184 -0
- data/node_modules/hawk/package.json +101 -0
- data/node_modules/hawk/test/browser.js +1492 -0
- data/node_modules/hawk/test/client.js +440 -0
- data/node_modules/hawk/test/crypto.js +70 -0
- data/node_modules/hawk/test/index.js +378 -0
- data/node_modules/hawk/test/readme.js +95 -0
- data/node_modules/hawk/test/server.js +1329 -0
- data/node_modules/hawk/test/uri.js +838 -0
- data/node_modules/hawk/test/utils.js +149 -0
- data/node_modules/hoek/.npmignore +18 -0
- data/node_modules/hoek/.travis.yml +7 -0
- data/node_modules/hoek/CONTRIBUTING.md +1 -0
- data/node_modules/hoek/LICENSE +31 -0
- data/node_modules/hoek/README.md +584 -0
- data/node_modules/hoek/images/hoek.png +0 -0
- data/node_modules/hoek/lib/escape.js +132 -0
- data/node_modules/hoek/lib/index.js +993 -0
- data/node_modules/hoek/package.json +96 -0
- data/node_modules/hoek/test/escaper.js +88 -0
- data/node_modules/hoek/test/index.js +2513 -0
- data/node_modules/hoek/test/modules/ignore.txt +0 -0
- data/node_modules/hoek/test/modules/test1.js +1 -0
- data/node_modules/hoek/test/modules/test2.js +1 -0
- data/node_modules/hoek/test/modules/test3.js +1 -0
- data/node_modules/html-encoding-sniffer/LICENSE.txt +19 -0
- data/node_modules/html-encoding-sniffer/README.md +38 -0
- data/node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js +302 -0
- data/node_modules/html-encoding-sniffer/package.json +98 -0
- data/node_modules/http-signature/.dir-locals.el +6 -0
- data/node_modules/http-signature/.npmignore +7 -0
- data/node_modules/http-signature/CHANGES.md +46 -0
- data/node_modules/http-signature/LICENSE +18 -0
- data/node_modules/http-signature/README.md +79 -0
- data/node_modules/http-signature/http_signing.md +363 -0
- data/node_modules/http-signature/lib/index.js +29 -0
- data/node_modules/http-signature/lib/parser.js +318 -0
- data/node_modules/http-signature/lib/signer.js +399 -0
- data/node_modules/http-signature/lib/utils.js +112 -0
- data/node_modules/http-signature/lib/verify.js +88 -0
- data/node_modules/http-signature/package.json +116 -0
- data/node_modules/iconv-lite/.npmignore +6 -0
- data/node_modules/iconv-lite/.travis.yml +22 -0
- data/node_modules/iconv-lite/Changelog.md +108 -0
- data/node_modules/iconv-lite/LICENSE +21 -0
- data/node_modules/iconv-lite/README.md +159 -0
- data/node_modules/iconv-lite/encodings/dbcs-codec.js +554 -0
- data/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- data/node_modules/iconv-lite/encodings/index.js +22 -0
- data/node_modules/iconv-lite/encodings/internal.js +187 -0
- data/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- data/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- data/node_modules/iconv-lite/encodings/sbcs-data.js +169 -0
- data/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- data/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- data/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- data/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- data/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- data/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- data/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- data/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- data/node_modules/iconv-lite/encodings/utf16.js +176 -0
- data/node_modules/iconv-lite/encodings/utf7.js +289 -0
- data/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- data/node_modules/iconv-lite/lib/extend-node.js +214 -0
- data/node_modules/iconv-lite/lib/index.d.ts +31 -0
- data/node_modules/iconv-lite/lib/index.js +141 -0
- data/node_modules/iconv-lite/lib/streams.js +120 -0
- data/node_modules/iconv-lite/package.json +158 -0
- data/node_modules/is-my-json-valid/.npmignore +2 -0
- data/node_modules/is-my-json-valid/.travis.yml +3 -0
- data/node_modules/is-my-json-valid/LICENSE +21 -0
- data/node_modules/is-my-json-valid/README.md +173 -0
- data/node_modules/is-my-json-valid/example.js +18 -0
- data/node_modules/is-my-json-valid/formats.js +14 -0
- data/node_modules/is-my-json-valid/index.js +594 -0
- data/node_modules/is-my-json-valid/package.json +116 -0
- data/node_modules/is-my-json-valid/require.js +12 -0
- data/node_modules/is-my-json-valid/test/fixtures/cosmic.js +84 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json +82 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json +88 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json +112 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json +68 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json +107 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/default.json +49 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json +32 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json +113 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json +72 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/format.json +143 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/items.json +46 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json +28 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json +28 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json +28 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json +42 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json +28 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json +28 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json +28 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json +42 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json +96 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/not.json +96 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json +18 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json +18 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json +68 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json +23 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json +110 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json +92 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json +128 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json +74 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/required.json +39 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/type.json +330 -0
- data/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json +79 -0
- data/node_modules/is-my-json-valid/test/json-schema.js +23 -0
- data/node_modules/is-my-json-valid/test/misc.js +471 -0
- data/node_modules/is-property/.npmignore +17 -0
- data/node_modules/is-property/LICENSE +22 -0
- data/node_modules/is-property/README.md +28 -0
- data/node_modules/is-property/is-property.js +5 -0
- data/node_modules/is-property/package.json +92 -0
- data/node_modules/is-typedarray/LICENSE.md +18 -0
- data/node_modules/is-typedarray/README.md +16 -0
- data/node_modules/is-typedarray/index.js +41 -0
- data/node_modules/is-typedarray/package.json +90 -0
- data/node_modules/is-typedarray/test.js +34 -0
- data/node_modules/isstream/.jshintrc +59 -0
- data/node_modules/isstream/.npmignore +1 -0
- data/node_modules/isstream/.travis.yml +12 -0
- data/node_modules/isstream/LICENSE.md +11 -0
- data/node_modules/isstream/README.md +66 -0
- data/node_modules/isstream/isstream.js +27 -0
- data/node_modules/isstream/package.json +93 -0
- data/node_modules/isstream/test.js +168 -0
- data/node_modules/jodid25519/.npmignore +11 -0
- data/node_modules/jodid25519/.travis.yml +7 -0
- data/node_modules/jodid25519/AUTHORS.md +3 -0
- data/node_modules/jodid25519/LICENSE +23 -0
- data/node_modules/jodid25519/README.md +51 -0
- data/node_modules/jodid25519/almond.0 +42 -0
- data/node_modules/jodid25519/almond.1 +13 -0
- data/node_modules/jodid25519/index.js +35 -0
- data/node_modules/jodid25519/jsdoc.json +19 -0
- data/node_modules/jodid25519/lib/core.js +481 -0
- data/node_modules/jodid25519/lib/curve255.js +221 -0
- data/node_modules/jodid25519/lib/dh.js +111 -0
- data/node_modules/jodid25519/lib/eddsa.js +573 -0
- data/node_modules/jodid25519/lib/utils.js +198 -0
- data/node_modules/jodid25519/package.json +104 -0
- data/node_modules/jquery/AUTHORS.txt +295 -0
- data/node_modules/jquery/LICENSE.txt +36 -0
- data/node_modules/jquery/README.md +65 -0
- data/node_modules/jquery/bower.json +14 -0
- data/node_modules/jquery/dist/core.js +482 -0
- data/node_modules/jquery/dist/jquery.js +10220 -0
- data/node_modules/jquery/dist/jquery.min.js +4 -0
- data/node_modules/jquery/dist/jquery.min.map +1 -0
- data/node_modules/jquery/dist/jquery.slim.js +8107 -0
- data/node_modules/jquery/dist/jquery.slim.min.js +4 -0
- data/node_modules/jquery/dist/jquery.slim.min.map +1 -0
- data/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.js +2272 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/node_modules/jquery/package.json +169 -0
- data/node_modules/jquery/src/.eslintrc.json +18 -0
- data/node_modules/jquery/src/ajax.js +855 -0
- data/node_modules/jquery/src/ajax/jsonp.js +102 -0
- data/node_modules/jquery/src/ajax/load.js +76 -0
- data/node_modules/jquery/src/ajax/parseXML.js +30 -0
- data/node_modules/jquery/src/ajax/script.js +77 -0
- data/node_modules/jquery/src/ajax/var/location.js +5 -0
- data/node_modules/jquery/src/ajax/var/nonce.js +7 -0
- data/node_modules/jquery/src/ajax/var/rquery.js +5 -0
- data/node_modules/jquery/src/ajax/xhr.js +169 -0
- data/node_modules/jquery/src/attributes.js +13 -0
- data/node_modules/jquery/src/attributes/attr.js +140 -0
- data/node_modules/jquery/src/attributes/classes.js +174 -0
- data/node_modules/jquery/src/attributes/prop.js +143 -0
- data/node_modules/jquery/src/attributes/support.js +33 -0
- data/node_modules/jquery/src/attributes/val.js +188 -0
- data/node_modules/jquery/src/callbacks.js +234 -0
- data/node_modules/jquery/src/core.js +482 -0
- data/node_modules/jquery/src/core/DOMEval.js +16 -0
- data/node_modules/jquery/src/core/access.js +70 -0
- data/node_modules/jquery/src/core/init.js +127 -0
- data/node_modules/jquery/src/core/parseHTML.js +65 -0
- data/node_modules/jquery/src/core/ready-no-deferred.js +105 -0
- data/node_modules/jquery/src/core/ready.js +95 -0
- data/node_modules/jquery/src/core/readyException.js +13 -0
- data/node_modules/jquery/src/core/stripAndCollapse.js +14 -0
- data/node_modules/jquery/src/core/support.js +20 -0
- data/node_modules/jquery/src/core/var/rsingleTag.js +6 -0
- data/node_modules/jquery/src/css.js +426 -0
- data/node_modules/jquery/src/css/addGetHookIf.js +26 -0
- data/node_modules/jquery/src/css/adjustCSS.js +71 -0
- data/node_modules/jquery/src/css/curCSS.js +59 -0
- data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/node_modules/jquery/src/css/showHide.js +105 -0
- data/node_modules/jquery/src/css/support.js +89 -0
- data/node_modules/jquery/src/css/var/cssExpand.js +5 -0
- data/node_modules/jquery/src/css/var/getStyles.js +17 -0
- data/node_modules/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/node_modules/jquery/src/css/var/rmargin.js +5 -0
- data/node_modules/jquery/src/css/var/rnumnonpx.js +7 -0
- data/node_modules/jquery/src/css/var/swap.js +26 -0
- data/node_modules/jquery/src/data.js +179 -0
- data/node_modules/jquery/src/data/Data.js +161 -0
- data/node_modules/jquery/src/data/var/acceptData.js +19 -0
- data/node_modules/jquery/src/data/var/dataPriv.js +7 -0
- data/node_modules/jquery/src/data/var/dataUser.js +7 -0
- data/node_modules/jquery/src/deferred.js +389 -0
- data/node_modules/jquery/src/deferred/exceptionHook.js +21 -0
- data/node_modules/jquery/src/deprecated.js +30 -0
- data/node_modules/jquery/src/dimensions.js +56 -0
- data/node_modules/jquery/src/effects.js +693 -0
- data/node_modules/jquery/src/effects/Tween.js +123 -0
- data/node_modules/jquery/src/effects/animatedSelector.js +15 -0
- data/node_modules/jquery/src/event.js +745 -0
- data/node_modules/jquery/src/event/ajax.js +22 -0
- data/node_modules/jquery/src/event/alias.js +29 -0
- data/node_modules/jquery/src/event/focusin.js +55 -0
- data/node_modules/jquery/src/event/support.js +11 -0
- data/node_modules/jquery/src/event/trigger.js +185 -0
- data/node_modules/jquery/src/exports/amd.js +26 -0
- data/node_modules/jquery/src/exports/global.js +34 -0
- data/node_modules/jquery/src/jquery.js +41 -0
- data/node_modules/jquery/src/manipulation.js +486 -0
- data/node_modules/jquery/src/manipulation/_evalUrl.js +23 -0
- data/node_modules/jquery/src/manipulation/buildFragment.js +104 -0
- data/node_modules/jquery/src/manipulation/getAll.js +31 -0
- data/node_modules/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/node_modules/jquery/src/manipulation/support.js +35 -0
- data/node_modules/jquery/src/manipulation/var/rcheckableType.js +5 -0
- data/node_modules/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/node_modules/jquery/src/manipulation/var/rtagName.js +5 -0
- data/node_modules/jquery/src/manipulation/wrapMap.js +29 -0
- data/node_modules/jquery/src/offset.js +232 -0
- data/node_modules/jquery/src/queue.js +145 -0
- data/node_modules/jquery/src/queue/delay.js +24 -0
- data/node_modules/jquery/src/selector-native.js +237 -0
- data/node_modules/jquery/src/selector-sizzle.js +19 -0
- data/node_modules/jquery/src/selector.js +3 -0
- data/node_modules/jquery/src/serialize.js +130 -0
- data/node_modules/jquery/src/traversing.js +178 -0
- data/node_modules/jquery/src/traversing/findFilter.js +106 -0
- data/node_modules/jquery/src/traversing/var/dir.js +22 -0
- data/node_modules/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/node_modules/jquery/src/traversing/var/siblings.js +17 -0
- data/node_modules/jquery/src/var/ObjectFunctionString.js +7 -0
- data/node_modules/jquery/src/var/arr.js +5 -0
- data/node_modules/jquery/src/var/class2type.js +6 -0
- data/node_modules/jquery/src/var/concat.js +7 -0
- data/node_modules/jquery/src/var/document.js +5 -0
- data/node_modules/jquery/src/var/documentElement.js +7 -0
- data/node_modules/jquery/src/var/fnToString.js +7 -0
- data/node_modules/jquery/src/var/getProto.js +5 -0
- data/node_modules/jquery/src/var/hasOwn.js +7 -0
- data/node_modules/jquery/src/var/indexOf.js +7 -0
- data/node_modules/jquery/src/var/pnum.js +5 -0
- data/node_modules/jquery/src/var/push.js +7 -0
- data/node_modules/jquery/src/var/rcssNum.js +9 -0
- data/node_modules/jquery/src/var/rnothtmlwhite.js +8 -0
- data/node_modules/jquery/src/var/slice.js +7 -0
- data/node_modules/jquery/src/var/support.js +6 -0
- data/node_modules/jquery/src/var/toString.js +7 -0
- data/node_modules/jquery/src/wrap.js +77 -0
- data/node_modules/jsbn/.npmignore +2 -0
- data/node_modules/jsbn/LICENSE +40 -0
- data/node_modules/jsbn/README.md +175 -0
- data/node_modules/jsbn/example.html +12 -0
- data/node_modules/jsbn/example.js +3 -0
- data/node_modules/jsbn/index.js +1358 -0
- data/node_modules/jsbn/package.json +87 -0
- data/node_modules/jsdom-global/.npmignore +1 -0
- data/node_modules/jsdom-global/.travis.yml +6 -0
- data/node_modules/jsdom-global/HISTORY.md +85 -0
- data/node_modules/jsdom-global/README.md +137 -0
- data/node_modules/jsdom-global/browser.js +10 -0
- data/node_modules/jsdom-global/index.js +46 -0
- data/node_modules/jsdom-global/keys.js +187 -0
- data/node_modules/jsdom-global/package.json +95 -0
- data/node_modules/jsdom-global/register.js +1 -0
- data/node_modules/jsdom-global/test.js +22 -0
- data/node_modules/jsdom/Changelog.md +1254 -0
- data/node_modules/jsdom/LICENSE.txt +22 -0
- data/node_modules/jsdom/README.md +592 -0
- data/node_modules/jsdom/lib/jsdom.js +456 -0
- data/node_modules/jsdom/lib/jsdom/browser/Window.js +502 -0
- data/node_modules/jsdom/lib/jsdom/browser/default-stylesheet.js +1129 -0
- data/node_modules/jsdom/lib/jsdom/browser/documentAdapter.js +73 -0
- data/node_modules/jsdom/lib/jsdom/browser/documentfeatures.js +47 -0
- data/node_modules/jsdom/lib/jsdom/browser/domtohtml.js +19 -0
- data/node_modules/jsdom/lib/jsdom/browser/htmltodom.js +323 -0
- data/node_modules/jsdom/lib/jsdom/browser/not-implemented.js +13 -0
- data/node_modules/jsdom/lib/jsdom/browser/resource-loader.js +275 -0
- data/node_modules/jsdom/lib/jsdom/level2/style.js +69 -0
- data/node_modules/jsdom/lib/jsdom/level3/xpath.js +1874 -0
- data/node_modules/jsdom/lib/jsdom/living/attributes.js +468 -0
- data/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js +87 -0
- data/node_modules/jsdom/lib/jsdom/living/blob-symbols.js +6 -0
- data/node_modules/jsdom/lib/jsdom/living/blob.js +73 -0
- data/node_modules/jsdom/lib/jsdom/living/dom-token-list.js +222 -0
- data/node_modules/jsdom/lib/jsdom/living/domparsing/DOMParser-impl.js +61 -0
- data/node_modules/jsdom/lib/jsdom/living/events/CustomEvent-impl.js +18 -0
- data/node_modules/jsdom/lib/jsdom/living/events/ErrorEvent-impl.js +11 -0
- data/node_modules/jsdom/lib/jsdom/living/events/Event-impl.js +77 -0
- data/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js +303 -0
- data/node_modules/jsdom/lib/jsdom/living/events/FocusEvent-impl.js +4 -0
- data/node_modules/jsdom/lib/jsdom/living/events/HashChangeEvent-impl.js +11 -0
- data/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js +21 -0
- data/node_modules/jsdom/lib/jsdom/living/events/MessageEvent-impl.js +22 -0
- data/node_modules/jsdom/lib/jsdom/living/events/MouseEvent-impl.js +28 -0
- data/node_modules/jsdom/lib/jsdom/living/events/PopStateEvent-impl.js +4 -0
- data/node_modules/jsdom/lib/jsdom/living/events/ProgressEvent-impl.js +11 -0
- data/node_modules/jsdom/lib/jsdom/living/events/TouchEvent-impl.js +11 -0
- data/node_modules/jsdom/lib/jsdom/living/events/UIEvent-impl.js +19 -0
- data/node_modules/jsdom/lib/jsdom/living/file-reader.js +133 -0
- data/node_modules/jsdom/lib/jsdom/living/file-symbols.js +4 -0
- data/node_modules/jsdom/lib/jsdom/living/file.js +22 -0
- data/node_modules/jsdom/lib/jsdom/living/filelist-symbols.js +3 -0
- data/node_modules/jsdom/lib/jsdom/living/filelist.js +21 -0
- data/node_modules/jsdom/lib/jsdom/living/form-data-symbols.js +3 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/.gitkeep +0 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/AddEventListenerOptions.js +34 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Attr.js +169 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/CharacterData.js +189 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ChildNode.js +92 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Comment.js +92 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/CustomEvent.js +122 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/CustomEventInit.js +34 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/DOMImplementation.js +143 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/DOMParser.js +97 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Document.js +712 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/DocumentFragment.js +91 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/DocumentType.js +110 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Element.js +552 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ElementCSSInlineStyle.js +88 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ElementContentEditable.js +77 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ErrorEvent.js +137 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ErrorEventInit.js +56 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Event.js +251 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/EventInit.js +40 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/EventListenerOptions.js +32 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/EventModifierInit.js +146 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js +130 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/FocusEvent.js +104 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/FocusEventInit.js +34 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/FormData.js +179 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/GlobalEventHandlers.js +770 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLAnchorElement.js +228 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLAppletElement.js +225 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLAreaElement.js +167 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLAudioElement.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLBRElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLBaseElement.js +107 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLBodyElement.js +164 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLButtonElement.js +189 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js +181 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLDListElement.js +98 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataListElement.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLDialogElement.js +98 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLDirectoryElement.js +98 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLDivElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLElement.js +205 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLEmbedElement.js +159 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLFieldSetElement.js +119 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLFontElement.js +121 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLFormElement.js +211 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameElement.js +203 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameSetElement.js +112 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLHRElement.js +150 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadElement.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadingElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLHtmlElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLHyperlinkElementUtils.js +205 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLIFrameElement.js +278 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLImageElement.js +326 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLInputElement.js +583 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLLIElement.js +108 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLLabelElement.js +103 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLLegendElement.js +103 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLLinkElement.js +206 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLMapElement.js +103 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLMediaElement.js +505 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLMenuElement.js +124 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLMetaElement.js +134 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLMeterElement.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLModElement.js +108 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLOListElement.js +140 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLObjectElement.js +309 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptGroupElement.js +111 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionElement.js +178 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLOutputElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLParagraphElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLParamElement.js +134 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLPreElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLProgressElement.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLQuoteElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLScriptElement.js +204 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLSelectElement.js +260 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLSourceElement.js +146 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLSpanElement.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLStyleElement.js +125 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCellElement.js +245 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableColElement.js +161 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableDataCellElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableElement.js +357 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableHeaderCellElement.js +121 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableRowElement.js +202 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableSectionElement.js +173 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTemplateElement.js +90 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTextAreaElement.js +415 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTimeElement.js +95 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTitleElement.js +94 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLTrackElement.js +193 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLUListElement.js +111 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLUnknownElement.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HTMLVideoElement.js +138 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEvent.js +113 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEventInit.js +38 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/History.js +179 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEvent.js +269 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEventInit.js +90 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/LinkStyle.js +85 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Location.js +227 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/MessageEvent.js +164 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/MessageEventInit.js +56 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/MouseEvent.js +234 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/MouseEventInit.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Navigator.js +96 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NavigatorConcurrentHardware.js +85 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NavigatorCookies.js +85 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NavigatorID.js +149 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NavigatorLanguage.js +93 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NavigatorOnLine.js +85 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NavigatorPlugins.js +88 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Node.js +512 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NonDocumentTypeChildNode.js +93 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/NonElementParentNode.js +92 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ParentNode.js +139 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/PopStateEvent.js +105 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/PopStateEventInit.js +32 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ProcessingInstruction.js +90 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ProgressEvent.js +122 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ProgressEventInit.js +50 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js +42 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/ScrollOptions.js +32 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Text.js +107 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/TouchEvent.js +138 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/TreeWalker.js +189 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/UIEvent.js +134 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/UIEventInit.js +42 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/Window.js +1 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/WindowEventHandlers.js +242 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/XMLDocument.js +82 -0
- data/node_modules/jsdom/lib/jsdom/living/generated/utils.js +40 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/document-base-url.js +53 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/focusing.js +74 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/form-controls.js +43 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/internal-constants.js +13 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/ordered-set-parser.js +5 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/proxied-window-event-handlers.js +11 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js +68 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/selectors.js +30 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/stylesheets.js +78 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/traversal.js +51 -0
- data/node_modules/jsdom/lib/jsdom/living/helpers/validate-names.js +62 -0
- data/node_modules/jsdom/lib/jsdom/living/html-collection.js +109 -0
- data/node_modules/jsdom/lib/jsdom/living/index.js +57 -0
- data/node_modules/jsdom/lib/jsdom/living/named-properties-window.js +139 -0
- data/node_modules/jsdom/lib/jsdom/living/navigator/Navigator-impl.js +24 -0
- data/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js +8 -0
- data/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl.js +7 -0
- data/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js +37 -0
- data/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl.js +7 -0
- data/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl.js +7 -0
- data/node_modules/jsdom/lib/jsdom/living/node-document-position.js +10 -0
- data/node_modules/jsdom/lib/jsdom/living/node-filter.js +47 -0
- data/node_modules/jsdom/lib/jsdom/living/node-iterator.js +232 -0
- data/node_modules/jsdom/lib/jsdom/living/node-list.js +85 -0
- data/node_modules/jsdom/lib/jsdom/living/node-type.js +16 -0
- data/node_modules/jsdom/lib/jsdom/living/node.js +189 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/CharacterData-impl.js +78 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/ChildNode-impl.js +15 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/Comment-impl.js +17 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/DOMImplementation-impl.js +176 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js +777 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/DocumentFragment-impl.js +21 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/DocumentType-impl.js +26 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js +491 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js +7 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl.js +7 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js +7 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js +25 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAppletElement-impl.js +26 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl.js +18 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js +27 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl.js +30 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl.js +58 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js +134 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js +144 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js +18 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js +14 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js +125 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl.js +181 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js +275 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl.js +93 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl.js +396 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl.js +72 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js +14 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl.js +76 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl.js +13 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl.js +140 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLModElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl.js +35 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl.js +122 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js +139 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl.js +174 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl.js +18 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js +33 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js +56 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableDataCellElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl.js +148 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableHeaderCellElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js +70 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js +54 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js +33 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js +184 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl.js +18 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl.js +21 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl.js +26 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/LinkStyle-impl.js +16 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js +475 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js +28 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js +91 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl.js +22 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/Text-impl.js +48 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl.js +9 -0
- data/node_modules/jsdom/lib/jsdom/living/nodes/XMLDocument-impl.js +4 -0
- data/node_modules/jsdom/lib/jsdom/living/post-message.js +36 -0
- data/node_modules/jsdom/lib/jsdom/living/register-elements.js +306 -0
- data/node_modules/jsdom/lib/jsdom/living/traversal/TreeWalker-impl.js +257 -0
- data/node_modules/jsdom/lib/jsdom/living/window/History-impl.js +145 -0
- data/node_modules/jsdom/lib/jsdom/living/window/History.idl +12 -0
- data/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js +235 -0
- data/node_modules/jsdom/lib/jsdom/living/window/navigation.js +103 -0
- data/node_modules/jsdom/lib/jsdom/living/xhr-sync-worker.js +50 -0
- data/node_modules/jsdom/lib/jsdom/living/xhr-utils.js +327 -0
- data/node_modules/jsdom/lib/jsdom/living/xhr/FormData-impl.js +182 -0
- data/node_modules/jsdom/lib/jsdom/living/xmlhttprequest-event-target.js +23 -0
- data/node_modules/jsdom/lib/jsdom/living/xmlhttprequest-symbols.js +4 -0
- data/node_modules/jsdom/lib/jsdom/living/xmlhttprequest-upload.js +17 -0
- data/node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js +1016 -0
- data/node_modules/jsdom/lib/jsdom/named-properties-tracker.js +156 -0
- data/node_modules/jsdom/lib/jsdom/utils.js +242 -0
- data/node_modules/jsdom/lib/jsdom/virtual-console.js +34 -0
- data/node_modules/jsdom/lib/jsdom/vm-shim.js +106 -0
- data/node_modules/jsdom/lib/jsdom/web-idl/DOMException.js +41 -0
- data/node_modules/jsdom/lib/jsdom/web-idl/dom-exception-table.json +134 -0
- data/node_modules/jsdom/node_modules/request/CHANGELOG.md +662 -0
- data/node_modules/jsdom/node_modules/request/LICENSE +55 -0
- data/node_modules/jsdom/node_modules/request/README.md +1098 -0
- data/node_modules/jsdom/node_modules/request/index.js +156 -0
- data/node_modules/jsdom/node_modules/request/lib/auth.js +168 -0
- data/node_modules/jsdom/node_modules/request/lib/cookies.js +39 -0
- data/node_modules/jsdom/node_modules/request/lib/getProxyFromURI.js +79 -0
- data/node_modules/jsdom/node_modules/request/lib/har.js +215 -0
- data/node_modules/jsdom/node_modules/request/lib/helpers.js +65 -0
- data/node_modules/jsdom/node_modules/request/lib/multipart.js +112 -0
- data/node_modules/jsdom/node_modules/request/lib/oauth.js +147 -0
- data/node_modules/jsdom/node_modules/request/lib/querystring.js +51 -0
- data/node_modules/jsdom/node_modules/request/lib/redirect.js +157 -0
- data/node_modules/jsdom/node_modules/request/lib/tunnel.js +176 -0
- data/node_modules/jsdom/node_modules/request/package.json +163 -0
- data/node_modules/jsdom/node_modules/request/request.js +1475 -0
- data/node_modules/jsdom/package.json +184 -0
- data/node_modules/json-schema/README.md +5 -0
- data/node_modules/json-schema/draft-00/hyper-schema +68 -0
- data/node_modules/json-schema/draft-00/json-ref +26 -0
- data/node_modules/json-schema/draft-00/links +33 -0
- data/node_modules/json-schema/draft-00/schema +155 -0
- data/node_modules/json-schema/draft-01/hyper-schema +68 -0
- data/node_modules/json-schema/draft-01/json-ref +26 -0
- data/node_modules/json-schema/draft-01/links +33 -0
- data/node_modules/json-schema/draft-01/schema +155 -0
- data/node_modules/json-schema/draft-02/hyper-schema +68 -0
- data/node_modules/json-schema/draft-02/json-ref +26 -0
- data/node_modules/json-schema/draft-02/links +35 -0
- data/node_modules/json-schema/draft-02/schema +166 -0
- data/node_modules/json-schema/draft-03/examples/address +20 -0
- data/node_modules/json-schema/draft-03/examples/calendar +53 -0
- data/node_modules/json-schema/draft-03/examples/card +105 -0
- data/node_modules/json-schema/draft-03/examples/geo +8 -0
- data/node_modules/json-schema/draft-03/examples/interfaces +23 -0
- data/node_modules/json-schema/draft-03/hyper-schema +60 -0
- data/node_modules/json-schema/draft-03/json-ref +26 -0
- data/node_modules/json-schema/draft-03/links +35 -0
- data/node_modules/json-schema/draft-03/schema +174 -0
- data/node_modules/json-schema/draft-04/hyper-schema +60 -0
- data/node_modules/json-schema/draft-04/links +41 -0
- data/node_modules/json-schema/draft-04/schema +189 -0
- data/node_modules/json-schema/draft-zyp-json-schema-03.xml +1120 -0
- data/node_modules/json-schema/draft-zyp-json-schema-04.xml +1072 -0
- data/node_modules/json-schema/lib/links.js +66 -0
- data/node_modules/json-schema/lib/validate.js +273 -0
- data/node_modules/json-schema/package.json +100 -0
- data/node_modules/json-schema/test/tests.js +95 -0
- data/node_modules/json-stringify-safe/.npmignore +1 -0
- data/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- data/node_modules/json-stringify-safe/LICENSE +15 -0
- data/node_modules/json-stringify-safe/Makefile +35 -0
- data/node_modules/json-stringify-safe/README.md +52 -0
- data/node_modules/json-stringify-safe/package.json +102 -0
- data/node_modules/json-stringify-safe/stringify.js +27 -0
- data/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- data/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- data/node_modules/jsonpointer/.travis.yml +7 -0
- data/node_modules/jsonpointer/LICENSE.md +21 -0
- data/node_modules/jsonpointer/README.md +39 -0
- data/node_modules/jsonpointer/benchmark.js +56 -0
- data/node_modules/jsonpointer/jsonpointer.js +93 -0
- data/node_modules/jsonpointer/package.json +109 -0
- data/node_modules/jsonpointer/test.js +131 -0
- data/node_modules/jsprim/CHANGES.md +39 -0
- data/node_modules/jsprim/LICENSE +19 -0
- data/node_modules/jsprim/README.md +237 -0
- data/node_modules/jsprim/lib/jsprim.js +488 -0
- data/node_modules/jsprim/package.json +85 -0
- data/node_modules/levn/LICENSE +22 -0
- data/node_modules/levn/README.md +196 -0
- data/node_modules/levn/lib/cast.js +298 -0
- data/node_modules/levn/lib/coerce.js +285 -0
- data/node_modules/levn/lib/index.js +22 -0
- data/node_modules/levn/lib/parse-string.js +113 -0
- data/node_modules/levn/lib/parse.js +102 -0
- data/node_modules/levn/package.json +108 -0
- data/node_modules/mime-db/HISTORY.md +375 -0
- data/node_modules/mime-db/LICENSE +22 -0
- data/node_modules/mime-db/README.md +82 -0
- data/node_modules/mime-db/db.json +6712 -0
- data/node_modules/mime-db/index.js +11 -0
- data/node_modules/mime-db/package.json +137 -0
- data/node_modules/mime-types/HISTORY.md +210 -0
- data/node_modules/mime-types/LICENSE +23 -0
- data/node_modules/mime-types/README.md +103 -0
- data/node_modules/mime-types/index.js +188 -0
- data/node_modules/mime-types/package.json +127 -0
- data/node_modules/nwmatcher/LICENSE +22 -0
- data/node_modules/nwmatcher/README.md +107 -0
- data/node_modules/nwmatcher/package.json +99 -0
- data/node_modules/nwmatcher/src/modules/nwmatcher-cache.js +187 -0
- data/node_modules/nwmatcher/src/modules/nwmatcher-jquery.js +126 -0
- data/node_modules/nwmatcher/src/modules/nwmatcher-pseudos.js +273 -0
- data/node_modules/nwmatcher/src/modules/nwmatcher-shortcuts.js +35 -0
- data/node_modules/nwmatcher/src/modules/nwmatcher-traversal.js +90 -0
- data/node_modules/nwmatcher/src/modules/nwmatcher-webforms.js +104 -0
- data/node_modules/nwmatcher/src/nwmatcher-base.js +785 -0
- data/node_modules/nwmatcher/src/nwmatcher-noqsa.js +962 -0
- data/node_modules/nwmatcher/src/nwmatcher.js +1780 -0
- data/node_modules/oauth-sign/LICENSE +55 -0
- data/node_modules/oauth-sign/README.md +4 -0
- data/node_modules/oauth-sign/index.js +136 -0
- data/node_modules/oauth-sign/package.json +98 -0
- data/node_modules/optionator/CHANGELOG.md +52 -0
- data/node_modules/optionator/LICENSE +22 -0
- data/node_modules/optionator/README.md +236 -0
- data/node_modules/optionator/lib/help.js +247 -0
- data/node_modules/optionator/lib/index.js +465 -0
- data/node_modules/optionator/lib/util.js +54 -0
- data/node_modules/optionator/package.json +109 -0
- data/node_modules/parse5/CHANGELOG.md +69 -0
- data/node_modules/parse5/LICENSE +19 -0
- data/node_modules/parse5/README.md +247 -0
- data/node_modules/parse5/docs/build/index.md +963 -0
- data/node_modules/parse5/index.js +12 -0
- data/node_modules/parse5/lib/common/doctype.js +134 -0
- data/node_modules/parse5/lib/common/foreign_content.js +257 -0
- data/node_modules/parse5/lib/common/html.js +268 -0
- data/node_modules/parse5/lib/common/unicode.js +48 -0
- data/node_modules/parse5/lib/common/utils.js +13 -0
- data/node_modules/parse5/lib/jsdom/jsdom_parser.js +39 -0
- data/node_modules/parse5/lib/jsdom/parsing_unit.js +53 -0
- data/node_modules/parse5/lib/serialization/serializer.js +178 -0
- data/node_modules/parse5/lib/simple_api/simple_api_parser.js +107 -0
- data/node_modules/parse5/lib/simple_api/tokenizer_proxy.js +122 -0
- data/node_modules/parse5/lib/tokenization/location_info_mixin.js +80 -0
- data/node_modules/parse5/lib/tokenization/named_entity_trie.js +6 -0
- data/node_modules/parse5/lib/tokenization/preprocessor.js +115 -0
- data/node_modules/parse5/lib/tokenization/tokenizer.js +2317 -0
- data/node_modules/parse5/lib/tree_adapters/default.js +200 -0
- data/node_modules/parse5/lib/tree_adapters/htmlparser2.js +317 -0
- data/node_modules/parse5/lib/tree_construction/formatting_element_list.js +167 -0
- data/node_modules/parse5/lib/tree_construction/location_info_mixin.js +197 -0
- data/node_modules/parse5/lib/tree_construction/open_element_stack.js +379 -0
- data/node_modules/parse5/lib/tree_construction/parser.js +2827 -0
- data/node_modules/parse5/package.json +125 -0
- data/node_modules/pinkie-promise/index.js +3 -0
- data/node_modules/pinkie-promise/license +21 -0
- data/node_modules/pinkie-promise/package.json +102 -0
- data/node_modules/pinkie-promise/readme.md +28 -0
- data/node_modules/pinkie/index.js +292 -0
- data/node_modules/pinkie/license +21 -0
- data/node_modules/pinkie/package.json +100 -0
- data/node_modules/pinkie/readme.md +83 -0
- data/node_modules/prelude-ls/CHANGELOG.md +99 -0
- data/node_modules/prelude-ls/LICENSE +22 -0
- data/node_modules/prelude-ls/README.md +15 -0
- data/node_modules/prelude-ls/lib/Func.js +65 -0
- data/node_modules/prelude-ls/lib/List.js +686 -0
- data/node_modules/prelude-ls/lib/Num.js +130 -0
- data/node_modules/prelude-ls/lib/Obj.js +154 -0
- data/node_modules/prelude-ls/lib/Str.js +92 -0
- data/node_modules/prelude-ls/lib/index.js +178 -0
- data/node_modules/prelude-ls/package.json +116 -0
- data/node_modules/punycode/LICENSE-MIT.txt +20 -0
- data/node_modules/punycode/README.md +176 -0
- data/node_modules/punycode/package.json +127 -0
- data/node_modules/punycode/punycode.js +533 -0
- data/node_modules/qs/.eslintignore +1 -0
- data/node_modules/qs/.eslintrc +19 -0
- data/node_modules/qs/CHANGELOG.md +144 -0
- data/node_modules/qs/CONTRIBUTING.md +1 -0
- data/node_modules/qs/LICENSE +28 -0
- data/node_modules/qs/README.md +398 -0
- data/node_modules/qs/dist/qs.js +574 -0
- data/node_modules/qs/lib/formats.js +18 -0
- data/node_modules/qs/lib/index.js +11 -0
- data/node_modules/qs/lib/parse.js +166 -0
- data/node_modules/qs/lib/stringify.js +187 -0
- data/node_modules/qs/lib/utils.js +180 -0
- data/node_modules/qs/package.json +121 -0
- data/node_modules/qs/test/.eslintrc +9 -0
- data/node_modules/qs/test/index.js +7 -0
- data/node_modules/qs/test/parse.js +459 -0
- data/node_modules/qs/test/stringify.js +538 -0
- data/node_modules/qs/test/utils.js +22 -0
- data/node_modules/sax/LICENSE +41 -0
- data/node_modules/sax/LICENSE-W3C.html +188 -0
- data/node_modules/sax/README.md +225 -0
- data/node_modules/sax/lib/sax.js +1576 -0
- data/node_modules/sax/package.json +133 -0
- data/node_modules/sntp/.npmignore +18 -0
- data/node_modules/sntp/.travis.yml +5 -0
- data/node_modules/sntp/LICENSE +28 -0
- data/node_modules/sntp/Makefile +9 -0
- data/node_modules/sntp/README.md +68 -0
- data/node_modules/sntp/examples/offset.js +16 -0
- data/node_modules/sntp/examples/time.js +25 -0
- data/node_modules/sntp/index.js +1 -0
- data/node_modules/sntp/lib/index.js +412 -0
- data/node_modules/sntp/package.json +98 -0
- data/node_modules/sntp/test/index.js +435 -0
- data/node_modules/source-map/.npmignore +2 -0
- data/node_modules/source-map/.travis.yml +4 -0
- data/node_modules/source-map/CHANGELOG.md +201 -0
- data/node_modules/source-map/LICENSE +28 -0
- data/node_modules/source-map/Makefile.dryice.js +166 -0
- data/node_modules/source-map/README.md +479 -0
- data/node_modules/source-map/build/assert-shim.js +56 -0
- data/node_modules/source-map/build/mini-require.js +152 -0
- data/node_modules/source-map/build/prefix-source-map.jsm +20 -0
- data/node_modules/source-map/build/prefix-utils.jsm +18 -0
- data/node_modules/source-map/build/suffix-browser.js +8 -0
- data/node_modules/source-map/build/suffix-source-map.jsm +6 -0
- data/node_modules/source-map/build/suffix-utils.jsm +21 -0
- data/node_modules/source-map/build/test-prefix.js +8 -0
- data/node_modules/source-map/build/test-suffix.js +3 -0
- data/node_modules/source-map/lib/source-map.js +8 -0
- data/node_modules/source-map/lib/source-map/array-set.js +97 -0
- data/node_modules/source-map/lib/source-map/base64-vlq.js +142 -0
- data/node_modules/source-map/lib/source-map/base64.js +42 -0
- data/node_modules/source-map/lib/source-map/basic-source-map-consumer.js +420 -0
- data/node_modules/source-map/lib/source-map/binary-search.js +80 -0
- data/node_modules/source-map/lib/source-map/indexed-source-map-consumer.js +303 -0
- data/node_modules/source-map/lib/source-map/mapping-list.js +86 -0
- data/node_modules/source-map/lib/source-map/source-map-consumer.js +222 -0
- data/node_modules/source-map/lib/source-map/source-map-generator.js +400 -0
- data/node_modules/source-map/lib/source-map/source-node.js +414 -0
- data/node_modules/source-map/lib/source-map/util.js +319 -0
- data/node_modules/source-map/package.json +223 -0
- data/node_modules/source-map/test/run-tests.js +62 -0
- data/node_modules/source-map/test/source-map/test-api.js +26 -0
- data/node_modules/source-map/test/source-map/test-array-set.js +104 -0
- data/node_modules/source-map/test/source-map/test-base64-vlq.js +23 -0
- data/node_modules/source-map/test/source-map/test-base64.js +35 -0
- data/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
- data/node_modules/source-map/test/source-map/test-dog-fooding.js +84 -0
- data/node_modules/source-map/test/source-map/test-source-map-consumer.js +874 -0
- data/node_modules/source-map/test/source-map/test-source-map-generator.js +679 -0
- data/node_modules/source-map/test/source-map/test-source-node.js +612 -0
- data/node_modules/source-map/test/source-map/test-util.js +216 -0
- data/node_modules/source-map/test/source-map/util.js +299 -0
- data/node_modules/sshpk/.npmignore +9 -0
- data/node_modules/sshpk/.travis.yml +11 -0
- data/node_modules/sshpk/LICENSE +18 -0
- data/node_modules/sshpk/README.md +666 -0
- data/node_modules/sshpk/bin/sshpk-conv +201 -0
- data/node_modules/sshpk/bin/sshpk-sign +191 -0
- data/node_modules/sshpk/bin/sshpk-verify +166 -0
- data/node_modules/sshpk/lib/algs.js +168 -0
- data/node_modules/sshpk/lib/certificate.js +291 -0
- data/node_modules/sshpk/lib/dhe.js +311 -0
- data/node_modules/sshpk/lib/ed-compat.js +96 -0
- data/node_modules/sshpk/lib/errors.js +84 -0
- data/node_modules/sshpk/lib/fingerprint.js +161 -0
- data/node_modules/sshpk/lib/formats/auto.js +73 -0
- data/node_modules/sshpk/lib/formats/openssh-cert.js +289 -0
- data/node_modules/sshpk/lib/formats/pem.js +186 -0
- data/node_modules/sshpk/lib/formats/pkcs1.js +320 -0
- data/node_modules/sshpk/lib/formats/pkcs8.js +505 -0
- data/node_modules/sshpk/lib/formats/rfc4253.js +146 -0
- data/node_modules/sshpk/lib/formats/ssh-private.js +261 -0
- data/node_modules/sshpk/lib/formats/ssh.js +114 -0
- data/node_modules/sshpk/lib/formats/x509-pem.js +77 -0
- data/node_modules/sshpk/lib/formats/x509.js +484 -0
- data/node_modules/sshpk/lib/identity.js +255 -0
- data/node_modules/sshpk/lib/index.js +38 -0
- data/node_modules/sshpk/lib/key.js +270 -0
- data/node_modules/sshpk/lib/private-key.js +231 -0
- data/node_modules/sshpk/lib/signature.js +245 -0
- data/node_modules/sshpk/lib/ssh-buffer.js +148 -0
- data/node_modules/sshpk/lib/utils.js +288 -0
- data/node_modules/sshpk/man/man1/sshpk-conv.1 +135 -0
- data/node_modules/sshpk/man/man1/sshpk-sign.1 +81 -0
- data/node_modules/sshpk/man/man1/sshpk-verify.1 +68 -0
- data/node_modules/sshpk/node_modules/assert-plus/AUTHORS +6 -0
- data/node_modules/sshpk/node_modules/assert-plus/CHANGES.md +14 -0
- data/node_modules/sshpk/node_modules/assert-plus/README.md +162 -0
- data/node_modules/sshpk/node_modules/assert-plus/assert.js +211 -0
- data/node_modules/sshpk/node_modules/assert-plus/package.json +115 -0
- data/node_modules/sshpk/package.json +135 -0
- data/node_modules/stringstream/.npmignore +15 -0
- data/node_modules/stringstream/.travis.yml +4 -0
- data/node_modules/stringstream/LICENSE.txt +22 -0
- data/node_modules/stringstream/README.md +38 -0
- data/node_modules/stringstream/example.js +27 -0
- data/node_modules/stringstream/package.json +85 -0
- data/node_modules/stringstream/stringstream.js +102 -0
- data/node_modules/strip-ansi/index.js +6 -0
- data/node_modules/strip-ansi/license +21 -0
- data/node_modules/strip-ansi/package.json +123 -0
- data/node_modules/strip-ansi/readme.md +33 -0
- data/node_modules/supports-color/index.js +50 -0
- data/node_modules/supports-color/license +21 -0
- data/node_modules/supports-color/package.json +113 -0
- data/node_modules/supports-color/readme.md +36 -0
- data/node_modules/symbol-tree/.jscsrc +55 -0
- data/node_modules/symbol-tree/.npmignore +6 -0
- data/node_modules/symbol-tree/LICENSE +21 -0
- data/node_modules/symbol-tree/README.md +68 -0
- data/node_modules/symbol-tree/api.md +441 -0
- data/node_modules/symbol-tree/lib/SymbolTree.js +834 -0
- data/node_modules/symbol-tree/lib/SymbolTreeNode.js +54 -0
- data/node_modules/symbol-tree/lib/TreeIterator.js +69 -0
- data/node_modules/symbol-tree/lib/TreePosition.js +10 -0
- data/node_modules/symbol-tree/package.json +121 -0
- data/node_modules/symbol-tree/test/SymbolTree.js +1189 -0
- data/node_modules/tough-cookie/LICENSE +27 -0
- data/node_modules/tough-cookie/README.md +506 -0
- data/node_modules/tough-cookie/lib/cookie.js +1336 -0
- data/node_modules/tough-cookie/lib/memstore.js +170 -0
- data/node_modules/tough-cookie/lib/pathMatch.js +61 -0
- data/node_modules/tough-cookie/lib/permuteDomain.js +56 -0
- data/node_modules/tough-cookie/lib/pubsuffix.js +98 -0
- data/node_modules/tough-cookie/lib/store.js +71 -0
- data/node_modules/tough-cookie/package.json +136 -0
- data/node_modules/tr46/.npmignore +4 -0
- data/node_modules/tr46/index.js +193 -0
- data/node_modules/tr46/lib/.gitkeep +0 -0
- data/node_modules/tr46/lib/mappingTable.json +1 -0
- data/node_modules/tr46/package.json +91 -0
- data/node_modules/tunnel-agent/LICENSE +55 -0
- data/node_modules/tunnel-agent/README.md +4 -0
- data/node_modules/tunnel-agent/index.js +243 -0
- data/node_modules/tunnel-agent/package.json +100 -0
- data/node_modules/tweetnacl/.npmignore +4 -0
- data/node_modules/tweetnacl/CHANGELOG.md +209 -0
- data/node_modules/tweetnacl/COPYING.txt +9 -0
- data/node_modules/tweetnacl/ISSUE_TEMPLATE.md +3 -0
- data/node_modules/tweetnacl/README.md +477 -0
- data/node_modules/tweetnacl/nacl-fast.js +2388 -0
- data/node_modules/tweetnacl/nacl-fast.min.js +2 -0
- data/node_modules/tweetnacl/nacl.d.ts +98 -0
- data/node_modules/tweetnacl/nacl.js +1175 -0
- data/node_modules/tweetnacl/nacl.min.js +1 -0
- data/node_modules/tweetnacl/package.json +121 -0
- data/node_modules/type-check/LICENSE +22 -0
- data/node_modules/type-check/README.md +210 -0
- data/node_modules/type-check/lib/check.js +126 -0
- data/node_modules/type-check/lib/index.js +16 -0
- data/node_modules/type-check/lib/parse-type.js +196 -0
- data/node_modules/type-check/package.json +102 -0
- data/node_modules/type-detect/.npmignore +11 -0
- data/node_modules/type-detect/History.md +52 -0
- data/node_modules/type-detect/README.md +226 -0
- data/node_modules/type-detect/ReleaseNotes.md +46 -0
- data/node_modules/type-detect/index.js +1 -0
- data/node_modules/type-detect/lib/type.js +134 -0
- data/node_modules/type-detect/package.json +93 -0
- data/node_modules/uuid/.npmignore +8 -0
- data/node_modules/uuid/.travis.yml +5 -0
- data/node_modules/uuid/AUTHORS +5 -0
- data/node_modules/uuid/HISTORY.md +28 -0
- data/node_modules/uuid/LICENSE.md +21 -0
- data/node_modules/uuid/README.md +132 -0
- data/node_modules/uuid/bin/uuid +26 -0
- data/node_modules/uuid/index.js +8 -0
- data/node_modules/uuid/lib/bytesToUuid.js +23 -0
- data/node_modules/uuid/lib/rng-browser.js +33 -0
- data/node_modules/uuid/lib/rng.js +10 -0
- data/node_modules/uuid/package.json +122 -0
- data/node_modules/uuid/test/mocha.opts +3 -0
- data/node_modules/uuid/test/test.js +96 -0
- data/node_modules/uuid/v1.js +103 -0
- data/node_modules/uuid/v4.js +29 -0
- data/node_modules/verror/.gitmodules +0 -0
- data/node_modules/verror/.npmignore +1 -0
- data/node_modules/verror/LICENSE +19 -0
- data/node_modules/verror/Makefile +35 -0
- data/node_modules/verror/Makefile.targ +285 -0
- data/node_modules/verror/README.md +120 -0
- data/node_modules/verror/examples/levels-verror.js +36 -0
- data/node_modules/verror/examples/levels-werror.js +34 -0
- data/node_modules/verror/examples/varargs.js +6 -0
- data/node_modules/verror/examples/verror.js +13 -0
- data/node_modules/verror/examples/werror.js +14 -0
- data/node_modules/verror/jsl.node.conf +139 -0
- data/node_modules/verror/lib/verror.js +157 -0
- data/node_modules/verror/package.json +78 -0
- data/node_modules/verror/tests/tst.inherit.js +100 -0
- data/node_modules/verror/tests/tst.verror.js +156 -0
- data/node_modules/verror/tests/tst.werror.js +179 -0
- data/node_modules/webidl-conversions/LICENSE.md +12 -0
- data/node_modules/webidl-conversions/README.md +53 -0
- data/node_modules/webidl-conversions/lib/index.js +189 -0
- data/node_modules/webidl-conversions/package.json +96 -0
- data/node_modules/whatwg-encoding/LICENSE.txt +19 -0
- data/node_modules/whatwg-encoding/lib/labels-to-names.json +207 -0
- data/node_modules/whatwg-encoding/lib/supported-names.json +37 -0
- data/node_modules/whatwg-encoding/lib/whatwg-encoding.js +47 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/.npmignore +6 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/.travis.yml +20 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/Changelog.md +93 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/LICENSE +21 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/README.md +157 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +554 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js +170 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/index.js +22 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js +187 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js +169 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js +174 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js +289 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/extend-node.js +214 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/index.js +141 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/streams.js +120 -0
- data/node_modules/whatwg-encoding/node_modules/iconv-lite/package.json +153 -0
- data/node_modules/whatwg-encoding/package.json +101 -0
- data/node_modules/whatwg-url/.eslintignore +3 -0
- data/node_modules/whatwg-url/LICENSE.txt +21 -0
- data/node_modules/whatwg-url/README.md +66 -0
- data/node_modules/whatwg-url/lib/URL-impl.js +216 -0
- data/node_modules/whatwg-url/lib/URL.js +209 -0
- data/node_modules/whatwg-url/lib/public-api.js +11 -0
- data/node_modules/whatwg-url/lib/url-state-machine.js +1173 -0
- data/node_modules/whatwg-url/lib/utils.js +20 -0
- data/node_modules/whatwg-url/package.json +103 -0
- data/node_modules/wordwrap/LICENSE +18 -0
- data/node_modules/wordwrap/README.markdown +70 -0
- data/node_modules/wordwrap/example/center.js +10 -0
- data/node_modules/wordwrap/example/meat.js +3 -0
- data/node_modules/wordwrap/index.js +76 -0
- data/node_modules/wordwrap/package.json +94 -0
- data/node_modules/wordwrap/test/break.js +32 -0
- data/node_modules/wordwrap/test/idleness.txt +63 -0
- data/node_modules/wordwrap/test/wrap.js +33 -0
- data/node_modules/xml-name-validator/LICENSE.txt +19 -0
- data/node_modules/xml-name-validator/README.md +36 -0
- data/node_modules/xml-name-validator/lib/generated-parser.js +504 -0
- data/node_modules/xml-name-validator/lib/grammar.pegjs +35 -0
- data/node_modules/xml-name-validator/lib/xml-name-validator.js +17 -0
- data/node_modules/xml-name-validator/package.json +97 -0
- data/node_modules/xtend/.jshintrc +30 -0
- data/node_modules/xtend/.npmignore +1 -0
- data/node_modules/xtend/LICENCE +19 -0
- data/node_modules/xtend/Makefile +4 -0
- data/node_modules/xtend/README.md +32 -0
- data/node_modules/xtend/immutable.js +19 -0
- data/node_modules/xtend/mutable.js +17 -0
- data/node_modules/xtend/package.json +117 -0
- data/node_modules/xtend/test.js +83 -0
- data/package.json +32 -0
- data/vendor/assets/javascripts/select_all.js +1 -1
- metadata +1870 -2
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function (nameForErrorMessage, window) {
|
4
|
+
if (!window) {
|
5
|
+
// Do nothing for window-less documents.
|
6
|
+
return;
|
7
|
+
}
|
8
|
+
|
9
|
+
const error = new Error(`Not implemented: ${nameForErrorMessage}`);
|
10
|
+
error.type = "not implemented";
|
11
|
+
|
12
|
+
window._virtualConsole.emit("jsdomError", error);
|
13
|
+
};
|
@@ -0,0 +1,275 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const parseContentType = require("content-type-parser");
|
4
|
+
const sniffHTMLEncoding = require("html-encoding-sniffer");
|
5
|
+
const whatwgEncoding = require("whatwg-encoding");
|
6
|
+
const parseDataUrl = require("../utils").parseDataUrl;
|
7
|
+
const fs = require("fs");
|
8
|
+
const request = require("request");
|
9
|
+
const documentBaseURLSerialized = require("../living/helpers/document-base-url").documentBaseURLSerialized;
|
10
|
+
const NODE_TYPE = require("../living/node-type");
|
11
|
+
|
12
|
+
/* eslint-disable no-restricted-modules */
|
13
|
+
// TODO: stop using the built-in URL in favor of the spec-compliant whatwg-url package
|
14
|
+
// This legacy usage is in the process of being purged.
|
15
|
+
const URL = require("url");
|
16
|
+
/* eslint-enable no-restricted-modules */
|
17
|
+
|
18
|
+
const IS_BROWSER = Object.prototype.toString.call(process) !== "[object process]";
|
19
|
+
|
20
|
+
function createResourceLoadHandler(element, resourceUrl, document, loadCallback) {
|
21
|
+
if (loadCallback === undefined) {
|
22
|
+
loadCallback = () => {
|
23
|
+
// do nothing
|
24
|
+
};
|
25
|
+
}
|
26
|
+
return (err, data, response) => {
|
27
|
+
const ev = document.createEvent("HTMLEvents");
|
28
|
+
|
29
|
+
if (!err) {
|
30
|
+
try {
|
31
|
+
loadCallback.call(element, data, resourceUrl, response);
|
32
|
+
ev.initEvent("load", false, false);
|
33
|
+
} catch (e) {
|
34
|
+
err = e;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
if (err) {
|
39
|
+
if (!err.isAbortError) {
|
40
|
+
ev.initEvent("error", false, false);
|
41
|
+
ev.error = err;
|
42
|
+
element.dispatchEvent(ev);
|
43
|
+
|
44
|
+
const error = new Error(`Could not load ${element.localName}: "${resourceUrl}"`);
|
45
|
+
error.detail = err;
|
46
|
+
error.type = "resource loading";
|
47
|
+
|
48
|
+
document._defaultView._virtualConsole.emit("jsdomError", error);
|
49
|
+
}
|
50
|
+
} else {
|
51
|
+
element.dispatchEvent(ev);
|
52
|
+
}
|
53
|
+
};
|
54
|
+
}
|
55
|
+
|
56
|
+
exports.readFile = function (filePath, options, callback) {
|
57
|
+
const readableStream = fs.createReadStream(filePath);
|
58
|
+
|
59
|
+
let data = new Buffer(0);
|
60
|
+
|
61
|
+
readableStream.on("error", callback);
|
62
|
+
|
63
|
+
readableStream.on("data", chunk => {
|
64
|
+
data = Buffer.concat([data, chunk]);
|
65
|
+
});
|
66
|
+
|
67
|
+
const defaultEncoding = options.defaultEncoding;
|
68
|
+
const detectMetaCharset = options.detectMetaCharset;
|
69
|
+
|
70
|
+
readableStream.on("end", () => {
|
71
|
+
// Not passing default encoding means binary
|
72
|
+
if (defaultEncoding) {
|
73
|
+
const encoding = detectMetaCharset ? sniffHTMLEncoding(data, { defaultEncoding }) :
|
74
|
+
whatwgEncoding.getBOMEncoding(data) || defaultEncoding;
|
75
|
+
const decoded = whatwgEncoding.decode(data, encoding);
|
76
|
+
callback(null, decoded, { headers: { "content-type": "text/plain;charset=" + encoding } });
|
77
|
+
} else {
|
78
|
+
callback(null, data);
|
79
|
+
}
|
80
|
+
});
|
81
|
+
|
82
|
+
return {
|
83
|
+
abort() {
|
84
|
+
readableStream.destroy();
|
85
|
+
const error = new Error("request canceled by user");
|
86
|
+
error.isAbortError = true;
|
87
|
+
callback(error);
|
88
|
+
}
|
89
|
+
};
|
90
|
+
};
|
91
|
+
|
92
|
+
function readDataUrl(dataUrl, options, callback) {
|
93
|
+
const defaultEncoding = options.defaultEncoding;
|
94
|
+
try {
|
95
|
+
const data = parseDataUrl(dataUrl);
|
96
|
+
// If default encoding does not exist, pass on binary data.
|
97
|
+
if (defaultEncoding) {
|
98
|
+
const contentType = parseContentType(data.type) || parseContentType("text/plain");
|
99
|
+
const sniffOptions = {
|
100
|
+
transportLayerEncodingLabel: contentType.get("charset"),
|
101
|
+
defaultEncoding
|
102
|
+
};
|
103
|
+
|
104
|
+
const encoding = options.detectMetaCharset ? sniffHTMLEncoding(data.buffer, sniffOptions) :
|
105
|
+
whatwgEncoding.getBOMEncoding(data.buffer) ||
|
106
|
+
whatwgEncoding.labelToName(contentType.get("charset")) || defaultEncoding;
|
107
|
+
const decoded = whatwgEncoding.decode(data.buffer, encoding);
|
108
|
+
|
109
|
+
contentType.set("charset", encoding);
|
110
|
+
data.type = contentType.toString();
|
111
|
+
|
112
|
+
callback(null, decoded, { headers: { "content-type": data.type } });
|
113
|
+
} else {
|
114
|
+
callback(null, data.buffer, { headers: { "content-type": data.type } });
|
115
|
+
}
|
116
|
+
} catch (err) {
|
117
|
+
callback(err, null);
|
118
|
+
}
|
119
|
+
return null;
|
120
|
+
}
|
121
|
+
|
122
|
+
// NOTE: request wraps tough-cookie cookie jar
|
123
|
+
// (see: https://github.com/request/request/blob/master/lib/cookies.js).
|
124
|
+
// Therefore, to pass our cookie jar to the request, we need to create
|
125
|
+
// request's wrapper and monkey patch it with our jar.
|
126
|
+
function wrapCookieJarForRequest(cookieJar) {
|
127
|
+
const jarWrapper = request.jar();
|
128
|
+
jarWrapper._jar = cookieJar;
|
129
|
+
return jarWrapper;
|
130
|
+
}
|
131
|
+
|
132
|
+
function fetch(urlObj, options, callback) {
|
133
|
+
if (urlObj.protocol === "data:") {
|
134
|
+
return readDataUrl(urlObj.href, options, callback);
|
135
|
+
} else if (urlObj.hostname) {
|
136
|
+
return exports.download(urlObj, options, callback);
|
137
|
+
}
|
138
|
+
const filePath = urlObj.pathname
|
139
|
+
.replace(/^file:\/\//, "")
|
140
|
+
.replace(/^\/([a-z]):\//i, "$1:/")
|
141
|
+
.replace(/%20/g, " ");
|
142
|
+
return exports.readFile(filePath, options, callback);
|
143
|
+
}
|
144
|
+
|
145
|
+
exports.enqueue = function (element, resourceUrl, callback) {
|
146
|
+
const document = element.nodeType === NODE_TYPE.DOCUMENT_NODE ? element : element._ownerDocument;
|
147
|
+
|
148
|
+
if (document._queue) {
|
149
|
+
const loadHandler = createResourceLoadHandler(element, resourceUrl || document.URL, document, callback);
|
150
|
+
return document._queue.push(loadHandler);
|
151
|
+
}
|
152
|
+
|
153
|
+
return () => {
|
154
|
+
// do nothing in queue-less documents
|
155
|
+
};
|
156
|
+
};
|
157
|
+
|
158
|
+
exports.download = function (url, options, callback) {
|
159
|
+
const requestOptions = {
|
160
|
+
pool: options.pool,
|
161
|
+
agent: options.agent,
|
162
|
+
agentOptions: options.agentOptions,
|
163
|
+
agentClass: options.agentClass,
|
164
|
+
strictSSL: options.strictSSL,
|
165
|
+
gzip: true,
|
166
|
+
jar: wrapCookieJarForRequest(options.cookieJar),
|
167
|
+
encoding: null,
|
168
|
+
headers: {
|
169
|
+
"User-Agent": options.userAgent,
|
170
|
+
"Accept-Language": "en",
|
171
|
+
Accept: options.accept || "*/*"
|
172
|
+
}
|
173
|
+
};
|
174
|
+
if (options.referrer && !IS_BROWSER) {
|
175
|
+
requestOptions.headers.referer = options.referrer;
|
176
|
+
}
|
177
|
+
if (options.proxy) {
|
178
|
+
requestOptions.proxy = options.proxy;
|
179
|
+
}
|
180
|
+
Object.assign(requestOptions.headers, options.headers);
|
181
|
+
|
182
|
+
const defaultEncoding = options.defaultEncoding;
|
183
|
+
const detectMetaCharset = options.detectMetaCharset;
|
184
|
+
|
185
|
+
const req = request(url, requestOptions, (error, response, bufferData) => {
|
186
|
+
if (!error) {
|
187
|
+
// If default encoding does not exist, pass on binary data.
|
188
|
+
if (defaultEncoding) {
|
189
|
+
const contentType = parseContentType(response.headers["content-type"]) || parseContentType("text/plain");
|
190
|
+
const sniffOptions = {
|
191
|
+
transportLayerEncodingLabel: contentType.get("charset"),
|
192
|
+
defaultEncoding
|
193
|
+
};
|
194
|
+
|
195
|
+
const encoding = detectMetaCharset ? sniffHTMLEncoding(bufferData, sniffOptions) :
|
196
|
+
whatwgEncoding.getBOMEncoding(bufferData) ||
|
197
|
+
whatwgEncoding.labelToName(contentType.get("charset")) || defaultEncoding;
|
198
|
+
const decoded = whatwgEncoding.decode(bufferData, encoding);
|
199
|
+
|
200
|
+
contentType.set("charset", encoding);
|
201
|
+
response.headers["content-type"] = contentType.toString();
|
202
|
+
|
203
|
+
callback(null, decoded, response);
|
204
|
+
} else {
|
205
|
+
callback(null, bufferData, response);
|
206
|
+
}
|
207
|
+
} else {
|
208
|
+
callback(error, null, response);
|
209
|
+
}
|
210
|
+
});
|
211
|
+
return {
|
212
|
+
abort() {
|
213
|
+
req.abort();
|
214
|
+
const error = new Error("request canceled by user");
|
215
|
+
error.isAbortError = true;
|
216
|
+
callback(error);
|
217
|
+
}
|
218
|
+
};
|
219
|
+
};
|
220
|
+
|
221
|
+
exports.load = function (element, urlString, options, callback) {
|
222
|
+
const document = element._ownerDocument;
|
223
|
+
const documentImpl = document.implementation;
|
224
|
+
|
225
|
+
if (!documentImpl._hasFeature("FetchExternalResources", element.tagName.toLowerCase())) {
|
226
|
+
return;
|
227
|
+
}
|
228
|
+
|
229
|
+
if (documentImpl._hasFeature("SkipExternalResources", urlString)) {
|
230
|
+
return;
|
231
|
+
}
|
232
|
+
|
233
|
+
const urlObj = URL.parse(urlString);
|
234
|
+
const enqueued = exports.enqueue(element, urlString, callback);
|
235
|
+
const customLoader = document._customResourceLoader;
|
236
|
+
const requestManager = document._requestManager;
|
237
|
+
const cookieJar = document._cookieJar;
|
238
|
+
|
239
|
+
options.accept = element._accept;
|
240
|
+
options.cookieJar = cookieJar;
|
241
|
+
options.referrer = document.URL;
|
242
|
+
options.pool = document._pool;
|
243
|
+
options.agentOptions = document._agentOptions;
|
244
|
+
options.strictSSL = document._strictSSL;
|
245
|
+
options.proxy = document._proxy;
|
246
|
+
options.userAgent = document._defaultView.navigator.userAgent;
|
247
|
+
|
248
|
+
let req = null;
|
249
|
+
function wrappedEnqueued() {
|
250
|
+
if (req && requestManager) {
|
251
|
+
requestManager.remove(req);
|
252
|
+
}
|
253
|
+
// do not trigger if the window is closed
|
254
|
+
if (element._ownerDocument && element._ownerDocument.defaultView.document) {
|
255
|
+
enqueued.apply(this, arguments);
|
256
|
+
}
|
257
|
+
}
|
258
|
+
if (typeof customLoader === "function") {
|
259
|
+
req = customLoader({
|
260
|
+
element,
|
261
|
+
url: urlObj,
|
262
|
+
cookie: cookieJar.getCookieStringSync(urlObj, { http: true }),
|
263
|
+
baseUrl: documentBaseURLSerialized(document),
|
264
|
+
defaultFetch(fetchCallback) {
|
265
|
+
return fetch(urlObj, options, fetchCallback);
|
266
|
+
}
|
267
|
+
},
|
268
|
+
wrappedEnqueued);
|
269
|
+
} else {
|
270
|
+
req = fetch(urlObj, options, wrappedEnqueued);
|
271
|
+
}
|
272
|
+
if (req && requestManager) {
|
273
|
+
requestManager.add(req);
|
274
|
+
}
|
275
|
+
};
|
@@ -0,0 +1,69 @@
|
|
1
|
+
"use strict";
|
2
|
+
const cssom = require("cssom");
|
3
|
+
const cssstyle = require("cssstyle");
|
4
|
+
|
5
|
+
module.exports = core => {
|
6
|
+
|
7
|
+
// What works now:
|
8
|
+
// - Accessing the rules defined in individual stylesheets
|
9
|
+
// - Modifications to style content attribute are reflected in style property
|
10
|
+
// - Modifications to style property are reflected in style content attribute
|
11
|
+
// TODO
|
12
|
+
// - Modifications to style element's textContent are reflected in sheet property.
|
13
|
+
// - Modifications to style element's sheet property are reflected in textContent.
|
14
|
+
// - Modifications to link.href property are reflected in sheet property.
|
15
|
+
// - Less-used features of link: disabled
|
16
|
+
// - Less-used features of style: disabled, scoped, title
|
17
|
+
// - CSSOM-View
|
18
|
+
// - getComputedStyle(): requires default stylesheet, cascading, inheritance,
|
19
|
+
// filtering by @media (screen? print?), layout for widths/heights
|
20
|
+
// - Load events are not in the specs, but apparently some browsers
|
21
|
+
// implement something. Should onload only fire after all @imports have been
|
22
|
+
// loaded, or only the primary sheet?
|
23
|
+
|
24
|
+
core.StyleSheet = cssom.StyleSheet;
|
25
|
+
core.MediaList = cssom.MediaList;
|
26
|
+
core.CSSStyleSheet = cssom.CSSStyleSheet;
|
27
|
+
core.CSSRule = cssom.CSSRule;
|
28
|
+
core.CSSStyleRule = cssom.CSSStyleRule;
|
29
|
+
core.CSSMediaRule = cssom.CSSMediaRule;
|
30
|
+
core.CSSImportRule = cssom.CSSImportRule;
|
31
|
+
core.CSSStyleDeclaration = cssstyle.CSSStyleDeclaration;
|
32
|
+
|
33
|
+
// Relavant specs
|
34
|
+
// http://www.w3.org/TR/DOM-Level-2-Style (2000)
|
35
|
+
// http://www.w3.org/TR/cssom-view/ (2008)
|
36
|
+
// http://dev.w3.org/csswg/cssom/ (2010) Meant to replace DOM Level 2 Style
|
37
|
+
// http://www.whatwg.org/specs/web-apps/current-work/multipage/ HTML5, of course
|
38
|
+
// http://dev.w3.org/csswg/css-style-attr/ not sure what's new here
|
39
|
+
|
40
|
+
// Objects that aren't in cssom library but should be:
|
41
|
+
// CSSRuleList (cssom just uses array)
|
42
|
+
// CSSFontFaceRule
|
43
|
+
// CSSPageRule
|
44
|
+
|
45
|
+
// These rules don't really make sense to implement, so CSSOM draft makes them
|
46
|
+
// obsolete.
|
47
|
+
// CSSCharsetRule
|
48
|
+
// CSSUnknownRule
|
49
|
+
|
50
|
+
// These objects are considered obsolete by CSSOM draft, although modern
|
51
|
+
// browsers implement them.
|
52
|
+
// CSSValue
|
53
|
+
// CSSPrimitiveValue
|
54
|
+
// CSSValueList
|
55
|
+
// RGBColor
|
56
|
+
// Rect
|
57
|
+
// Counter
|
58
|
+
|
59
|
+
// http://dev.w3.org/csswg/cssom/#stylesheetlist
|
60
|
+
function StyleSheetList() {}
|
61
|
+
|
62
|
+
StyleSheetList.prototype.__proto__ = Array.prototype;
|
63
|
+
|
64
|
+
StyleSheetList.prototype.item = function item(i) {
|
65
|
+
return Object.prototype.hasOwnProperty.call(this, i) ? this[i] : null;
|
66
|
+
};
|
67
|
+
|
68
|
+
core.StyleSheetList = StyleSheetList;
|
69
|
+
};
|
@@ -0,0 +1,1874 @@
|
|
1
|
+
/** Here is yet another implementation of XPath 1.0 in Javascript.
|
2
|
+
*
|
3
|
+
* My goal was to make it relatively compact, but as I fixed all the axis bugs
|
4
|
+
* the axes became more and more complicated. :-(.
|
5
|
+
*
|
6
|
+
* I have not implemented namespaces or case-sensitive axes for XML yet.
|
7
|
+
*
|
8
|
+
* How to test it in Chrome: You can make a Chrome extension that replaces
|
9
|
+
* the WebKit XPath parser with this one. But it takes a bit of effort to
|
10
|
+
* get around isolated world and same-origin restrictions:
|
11
|
+
* manifest.json:
|
12
|
+
{
|
13
|
+
"name": "XPathTest",
|
14
|
+
"version": "0.1",
|
15
|
+
"content_scripts": [{
|
16
|
+
"matches": ["http://localhost/*"], // or wildcard host
|
17
|
+
"js": ["xpath.js", "injection.js"],
|
18
|
+
"all_frames": true, "run_at": "document_start"
|
19
|
+
}]
|
20
|
+
}
|
21
|
+
* injection.js:
|
22
|
+
// goal: give my xpath object to the website's JS context.
|
23
|
+
var script = document.createElement('script');
|
24
|
+
script.textContent =
|
25
|
+
"document.addEventListener('xpathextend', function(e) {\n" +
|
26
|
+
" console.log('extending document with xpath...');\n" +
|
27
|
+
" e.detail(window);" +
|
28
|
+
"});";
|
29
|
+
document.documentElement.appendChild(script);
|
30
|
+
document.documentElement.removeChild(script);
|
31
|
+
var evt = document.createEvent('CustomEvent');
|
32
|
+
evt.initCustomEvent('xpathextend', true, true, this.xpath.extend);
|
33
|
+
document.dispatchEvent(evt);
|
34
|
+
*/
|
35
|
+
module.exports = core => {
|
36
|
+
var xpath = {};
|
37
|
+
|
38
|
+
// Helper function to deal with the migration of Attr to no longer have a nodeName property despite this codebase
|
39
|
+
// assuming it does.
|
40
|
+
function getNodeName(nodeOrAttr) {
|
41
|
+
return nodeOrAttr.constructor.name === 'Attr' ? nodeOrAttr.name : nodeOrAttr.nodeName;
|
42
|
+
}
|
43
|
+
|
44
|
+
/***************************************************************************
|
45
|
+
* Tokenization *
|
46
|
+
***************************************************************************/
|
47
|
+
/**
|
48
|
+
* The XPath lexer is basically a single regular expression, along with
|
49
|
+
* some helper functions to pop different types.
|
50
|
+
*/
|
51
|
+
var Stream = xpath.Stream = function Stream(str) {
|
52
|
+
this.original = this.str = str;
|
53
|
+
this.peeked = null;
|
54
|
+
// TODO: not really needed, but supposedly tokenizer also disambiguates
|
55
|
+
// a * b vs. node test *
|
56
|
+
this.prev = null; // for debugging
|
57
|
+
this.prevprev = null;
|
58
|
+
}
|
59
|
+
Stream.prototype = {
|
60
|
+
peek: function() {
|
61
|
+
if (this.peeked) return this.peeked;
|
62
|
+
var m = this.re.exec(this.str);
|
63
|
+
if (!m) return null;
|
64
|
+
this.str = this.str.substr(m[0].length);
|
65
|
+
return this.peeked = m[1];
|
66
|
+
},
|
67
|
+
/** Peek 2 tokens ahead. */
|
68
|
+
peek2: function() {
|
69
|
+
this.peek(); // make sure this.peeked is set
|
70
|
+
var m = this.re.exec(this.str);
|
71
|
+
if (!m) return null;
|
72
|
+
return m[1];
|
73
|
+
},
|
74
|
+
pop: function() {
|
75
|
+
var r = this.peek();
|
76
|
+
this.peeked = null;
|
77
|
+
this.prevprev = this.prev;
|
78
|
+
this.prev = r;
|
79
|
+
return r;
|
80
|
+
},
|
81
|
+
trypop: function(tokens) {
|
82
|
+
var tok = this.peek();
|
83
|
+
if (tok === tokens) return this.pop();
|
84
|
+
if (Array.isArray(tokens)) {
|
85
|
+
for (var i = 0; i < tokens.length; ++i) {
|
86
|
+
var t = tokens[i];
|
87
|
+
if (t == tok) return this.pop();;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
},
|
91
|
+
trypopfuncname: function() {
|
92
|
+
var tok = this.peek();
|
93
|
+
if (!this.isQnameRe.test(tok))
|
94
|
+
return null;
|
95
|
+
switch (tok) {
|
96
|
+
case 'comment': case 'text': case 'processing-instruction': case 'node':
|
97
|
+
return null;
|
98
|
+
}
|
99
|
+
if ('(' != this.peek2()) return null;
|
100
|
+
return this.pop();
|
101
|
+
},
|
102
|
+
trypopaxisname: function() {
|
103
|
+
var tok = this.peek();
|
104
|
+
switch (tok) {
|
105
|
+
case 'ancestor': case 'ancestor-or-self': case 'attribute':
|
106
|
+
case 'child': case 'descendant': case 'descendant-or-self':
|
107
|
+
case 'following': case 'following-sibling': case 'namespace':
|
108
|
+
case 'parent': case 'preceding': case 'preceding-sibling': case 'self':
|
109
|
+
if ('::' == this.peek2()) return this.pop();
|
110
|
+
}
|
111
|
+
return null;
|
112
|
+
},
|
113
|
+
trypopnametest: function() {
|
114
|
+
var tok = this.peek();
|
115
|
+
if ('*' === tok || this.startsWithNcNameRe.test(tok)) return this.pop();
|
116
|
+
return null;
|
117
|
+
},
|
118
|
+
trypopliteral: function() {
|
119
|
+
var tok = this.peek();
|
120
|
+
if (null == tok) return null;
|
121
|
+
var first = tok.charAt(0);
|
122
|
+
var last = tok.charAt(tok.length - 1);
|
123
|
+
if ('"' === first && '"' === last ||
|
124
|
+
"'" === first && "'" === last) {
|
125
|
+
this.pop();
|
126
|
+
return tok.substr(1, tok.length - 2);
|
127
|
+
}
|
128
|
+
},
|
129
|
+
trypopnumber: function() {
|
130
|
+
var tok = this.peek();
|
131
|
+
if (this.isNumberRe.test(tok)) return parseFloat(this.pop());
|
132
|
+
else return null;
|
133
|
+
},
|
134
|
+
trypopvarref: function() {
|
135
|
+
var tok = this.peek();
|
136
|
+
if (null == tok) return null;
|
137
|
+
if ('$' === tok.charAt(0)) return this.pop().substr(1);
|
138
|
+
else return null;
|
139
|
+
},
|
140
|
+
position: function() {
|
141
|
+
return this.original.length - this.str.length;
|
142
|
+
}
|
143
|
+
};
|
144
|
+
(function() {
|
145
|
+
// http://www.w3.org/TR/REC-xml-names/#NT-NCName
|
146
|
+
var nameStartCharsExceptColon =
|
147
|
+
'A-Z_a-z\xc0-\xd6\xd8-\xf6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF' +
|
148
|
+
'\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF' +
|
149
|
+
'\uFDF0-\uFFFD'; // JS doesn't support [#x10000-#xEFFFF]
|
150
|
+
var nameCharExceptColon = nameStartCharsExceptColon +
|
151
|
+
'\\-\\.0-9\xb7\u0300-\u036F\u203F-\u2040';
|
152
|
+
var ncNameChars = '[' + nameStartCharsExceptColon +
|
153
|
+
'][' + nameCharExceptColon + ']*'
|
154
|
+
// http://www.w3.org/TR/REC-xml-names/#NT-QName
|
155
|
+
var qNameChars = ncNameChars + '(?::' + ncNameChars + ')?';
|
156
|
+
var otherChars = '\\.\\.|[\\(\\)\\[\\].@,]|::'; // .. must come before [.]
|
157
|
+
var operatorChars =
|
158
|
+
'and|or|mod|div|' +
|
159
|
+
'//|!=|<=|>=|[*/|+\\-=<>]'; // //, !=, <=, >= before individual ones.
|
160
|
+
var literal = '"[^"]*"|' + "'[^']*'";
|
161
|
+
var numberChars = '[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+';
|
162
|
+
var variableReference = '\\$' + qNameChars;
|
163
|
+
var nameTestChars = '\\*|' + ncNameChars + ':\\*|' + qNameChars;
|
164
|
+
var optionalSpace = '[ \t\r\n]*'; // stricter than regexp \s.
|
165
|
+
var nodeType = 'comment|text|processing-instruction|node';
|
166
|
+
var re = new RegExp(
|
167
|
+
// numberChars before otherChars so that leading-decimal doesn't become .
|
168
|
+
'^' + optionalSpace + '(' + numberChars + '|' + otherChars + '|' +
|
169
|
+
nameTestChars + '|' + operatorChars + '|' + literal + '|' +
|
170
|
+
variableReference + ')'
|
171
|
+
// operatorName | nodeType | functionName | axisName are lumped into
|
172
|
+
// qName for now; we'll check them on pop.
|
173
|
+
);
|
174
|
+
Stream.prototype.re = re;
|
175
|
+
Stream.prototype.startsWithNcNameRe = new RegExp('^' + ncNameChars);
|
176
|
+
Stream.prototype.isQnameRe = new RegExp('^' + qNameChars + '$');
|
177
|
+
Stream.prototype.isNumberRe = new RegExp('^' + numberChars + '$');
|
178
|
+
})();
|
179
|
+
|
180
|
+
/***************************************************************************
|
181
|
+
* Parsing *
|
182
|
+
***************************************************************************/
|
183
|
+
var parse = xpath.parse = function parse(stream, a) {
|
184
|
+
var r = orExpr(stream,a);
|
185
|
+
var x, unparsed = [];
|
186
|
+
while (x = stream.pop()) {
|
187
|
+
unparsed.push(x);
|
188
|
+
}
|
189
|
+
if (unparsed.length)
|
190
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
191
|
+
'Position ' + stream.position() +
|
192
|
+
': Unparsed tokens: ' + unparsed.join(' '));
|
193
|
+
return r;
|
194
|
+
}
|
195
|
+
|
196
|
+
/**
|
197
|
+
* binaryL ::= subExpr
|
198
|
+
* | binaryL op subExpr
|
199
|
+
* so a op b op c becomes ((a op b) op c)
|
200
|
+
*/
|
201
|
+
function binaryL(subExpr, stream, a, ops) {
|
202
|
+
var lhs = subExpr(stream, a);
|
203
|
+
if (lhs == null) return null;
|
204
|
+
var op;
|
205
|
+
while (op = stream.trypop(ops)) {
|
206
|
+
var rhs = subExpr(stream, a);
|
207
|
+
if (rhs == null)
|
208
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
209
|
+
'Position ' + stream.position() +
|
210
|
+
': Expected something after ' + op);
|
211
|
+
lhs = a.node(op, lhs, rhs);
|
212
|
+
}
|
213
|
+
return lhs;
|
214
|
+
}
|
215
|
+
/**
|
216
|
+
* Too bad this is never used. If they made a ** operator (raise to power),
|
217
|
+
( we would use it.
|
218
|
+
* binaryR ::= subExpr
|
219
|
+
* | subExpr op binaryR
|
220
|
+
* so a op b op c becomes (a op (b op c))
|
221
|
+
*/
|
222
|
+
function binaryR(subExpr, stream, a, ops) {
|
223
|
+
var lhs = subExpr(stream, a);
|
224
|
+
if (lhs == null) return null;
|
225
|
+
var op = stream.trypop(ops);
|
226
|
+
if (op) {
|
227
|
+
var rhs = binaryR(stream, a);
|
228
|
+
if (rhs == null)
|
229
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
230
|
+
'Position ' + stream.position() +
|
231
|
+
': Expected something after ' + op);
|
232
|
+
return a.node(op, lhs, rhs);
|
233
|
+
} else {
|
234
|
+
return lhs;// TODO
|
235
|
+
}
|
236
|
+
}
|
237
|
+
/** [1] LocationPath::= RelativeLocationPath | AbsoluteLocationPath
|
238
|
+
* e.g. a, a/b, //a/b
|
239
|
+
*/
|
240
|
+
function locationPath(stream, a) {
|
241
|
+
return absoluteLocationPath(stream, a) ||
|
242
|
+
relativeLocationPath(null, stream, a);
|
243
|
+
}
|
244
|
+
/** [2] AbsoluteLocationPath::= '/' RelativeLocationPath? | AbbreviatedAbsoluteLocationPath
|
245
|
+
* [10] AbbreviatedAbsoluteLocationPath::= '//' RelativeLocationPath
|
246
|
+
*/
|
247
|
+
function absoluteLocationPath(stream, a) {
|
248
|
+
var op = stream.peek();
|
249
|
+
if ('/' === op || '//' === op) {
|
250
|
+
var lhs = a.node('Root');
|
251
|
+
return relativeLocationPath(lhs, stream, a, true);
|
252
|
+
} else {
|
253
|
+
return null;
|
254
|
+
}
|
255
|
+
}
|
256
|
+
/** [3] RelativeLocationPath::= Step | RelativeLocationPath '/' Step |
|
257
|
+
* | AbbreviatedRelativeLocationPath
|
258
|
+
* [11] AbbreviatedRelativeLocationPath::= RelativeLocationPath '//' Step
|
259
|
+
* e.g. p/a, etc.
|
260
|
+
*/
|
261
|
+
function relativeLocationPath(lhs, stream, a, isOnlyRootOk) {
|
262
|
+
if (null == lhs) {
|
263
|
+
lhs = step(stream, a);
|
264
|
+
if (null == lhs) return lhs;
|
265
|
+
}
|
266
|
+
var op;
|
267
|
+
while (op = stream.trypop(['/', '//'])) {
|
268
|
+
if ('//' === op) {
|
269
|
+
lhs = a.node('/', lhs,
|
270
|
+
a.node('Axis', 'descendant-or-self', 'node', undefined));
|
271
|
+
}
|
272
|
+
var rhs = step(stream, a);
|
273
|
+
if (null == rhs && '/' === op && isOnlyRootOk) return lhs;
|
274
|
+
else isOnlyRootOk = false;
|
275
|
+
if (null == rhs)
|
276
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
277
|
+
'Position ' + stream.position() +
|
278
|
+
': Expected step after ' + op);
|
279
|
+
lhs = a.node('/', lhs, rhs);
|
280
|
+
}
|
281
|
+
return lhs;
|
282
|
+
}
|
283
|
+
/** [4] Step::= AxisSpecifier NodeTest Predicate* | AbbreviatedStep
|
284
|
+
* [12] AbbreviatedStep::= '.' | '..'
|
285
|
+
* e.g. @href, self::p, p, a[@href], ., ..
|
286
|
+
*/
|
287
|
+
function step(stream, a) {
|
288
|
+
var abbrStep = stream.trypop(['.', '..']);
|
289
|
+
if ('.' === abbrStep) // A location step of . is short for self::node().
|
290
|
+
return a.node('Axis', 'self', 'node');
|
291
|
+
if ('..' === abbrStep) // A location step of .. is short for parent::node()
|
292
|
+
return a.node('Axis', 'parent', 'node');
|
293
|
+
|
294
|
+
var axis = axisSpecifier(stream, a);
|
295
|
+
var nodeType = nodeTypeTest(stream, a);
|
296
|
+
var nodeName;
|
297
|
+
if (null == nodeType) nodeName = nodeNameTest(stream, a);
|
298
|
+
if (null == axis && null == nodeType && null == nodeName) return null;
|
299
|
+
if (null == nodeType && null == nodeName)
|
300
|
+
throw new XPathException(
|
301
|
+
XPathException.INVALID_EXPRESSION_ERR,
|
302
|
+
'Position ' + stream.position() +
|
303
|
+
': Expected nodeTest after axisSpecifier ' + axis);
|
304
|
+
if (null == axis) axis = 'child';
|
305
|
+
if (null == nodeType) {
|
306
|
+
// When there's only a node name, then the node type is forced to be the
|
307
|
+
// principal node type of the axis.
|
308
|
+
// see http://www.w3.org/TR/xpath/#dt-principal-node-type
|
309
|
+
if ('attribute' === axis) nodeType = 'attribute';
|
310
|
+
else if ('namespace' === axis) nodeType = 'namespace';
|
311
|
+
else nodeType = 'element';
|
312
|
+
}
|
313
|
+
var lhs = a.node('Axis', axis, nodeType, nodeName);
|
314
|
+
var pred;
|
315
|
+
while (null != (pred = predicate(lhs, stream, a))) {
|
316
|
+
lhs = pred;
|
317
|
+
}
|
318
|
+
return lhs;
|
319
|
+
}
|
320
|
+
/** [5] AxisSpecifier::= AxisName '::' | AbbreviatedAxisSpecifier
|
321
|
+
* [6] AxisName::= 'ancestor' | 'ancestor-or-self' | 'attribute' | 'child'
|
322
|
+
* | 'descendant' | 'descendant-or-self' | 'following'
|
323
|
+
* | 'following-sibling' | 'namespace' | 'parent' |
|
324
|
+
* | 'preceding' | 'preceding-sibling' | 'self'
|
325
|
+
* [13] AbbreviatedAxisSpecifier::= '@'?
|
326
|
+
*/
|
327
|
+
function axisSpecifier(stream, a) {
|
328
|
+
var attr = stream.trypop('@');
|
329
|
+
if (null != attr) return 'attribute';
|
330
|
+
var axisName = stream.trypopaxisname();
|
331
|
+
if (null != axisName) {
|
332
|
+
var coloncolon = stream.trypop('::');
|
333
|
+
if (null == coloncolon)
|
334
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
335
|
+
'Position ' + stream.position() +
|
336
|
+
': Should not happen. Should be ::.');
|
337
|
+
return axisName;
|
338
|
+
}
|
339
|
+
}
|
340
|
+
/** [7] NodeTest::= NameTest | NodeType '(' ')' | 'processing-instruction' '(' Literal ')'
|
341
|
+
* [38] NodeType::= 'comment' | 'text' | 'processing-instruction' | 'node'
|
342
|
+
* I've split nodeTypeTest from nodeNameTest for convenience.
|
343
|
+
*/
|
344
|
+
function nodeTypeTest(stream, a) {
|
345
|
+
if ('(' !== stream.peek2()) {
|
346
|
+
return null;
|
347
|
+
}
|
348
|
+
var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);
|
349
|
+
if (null != type) {
|
350
|
+
if (null == stream.trypop('('))
|
351
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
352
|
+
'Position ' + stream.position() +
|
353
|
+
': Should not happen.');
|
354
|
+
var param = undefined;
|
355
|
+
if (type == 'processing-instruction') {
|
356
|
+
param = stream.trypopliteral();
|
357
|
+
}
|
358
|
+
if (null == stream.trypop(')'))
|
359
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
360
|
+
'Position ' + stream.position() +
|
361
|
+
': Expected close parens.');
|
362
|
+
return type
|
363
|
+
}
|
364
|
+
}
|
365
|
+
function nodeNameTest(stream, a) {
|
366
|
+
var name = stream.trypopnametest();
|
367
|
+
if (name != null) return name;
|
368
|
+
else return null;
|
369
|
+
}
|
370
|
+
/** [8] Predicate::= '[' PredicateExpr ']'
|
371
|
+
* [9] PredicateExpr::= Expr
|
372
|
+
*/
|
373
|
+
function predicate(lhs, stream, a) {
|
374
|
+
if (null == stream.trypop('[')) return null;
|
375
|
+
var expr = orExpr(stream, a);
|
376
|
+
if (null == expr)
|
377
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
378
|
+
'Position ' + stream.position() +
|
379
|
+
': Expected expression after [');
|
380
|
+
if (null == stream.trypop(']'))
|
381
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
382
|
+
'Position ' + stream.position() +
|
383
|
+
': Expected ] after expression.');
|
384
|
+
return a.node('Predicate', lhs, expr);
|
385
|
+
}
|
386
|
+
/** [14] Expr::= OrExpr
|
387
|
+
*/
|
388
|
+
/** [15] PrimaryExpr::= VariableReference | '(' Expr ')' | Literal | Number | FunctionCall
|
389
|
+
* e.g. $x, (3+4), "hi", 32, f(x)
|
390
|
+
*/
|
391
|
+
function primaryExpr(stream, a) {
|
392
|
+
var x = stream.trypopliteral();
|
393
|
+
if (null == x)
|
394
|
+
x = stream.trypopnumber();
|
395
|
+
if (null != x) {
|
396
|
+
return x;
|
397
|
+
}
|
398
|
+
var varRef = stream.trypopvarref();
|
399
|
+
if (null != varRef) return a.node('VariableReference', varRef);
|
400
|
+
var funCall = functionCall(stream, a);
|
401
|
+
if (null != funCall) {
|
402
|
+
return funCall;
|
403
|
+
}
|
404
|
+
if (stream.trypop('(')) {
|
405
|
+
var e = orExpr(stream, a);
|
406
|
+
if (null == e)
|
407
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
408
|
+
'Position ' + stream.position() +
|
409
|
+
': Expected expression after (.');
|
410
|
+
if (null == stream.trypop(')'))
|
411
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
412
|
+
'Position ' + stream.position() +
|
413
|
+
': Expected ) after expression.');
|
414
|
+
return e;
|
415
|
+
}
|
416
|
+
return null;
|
417
|
+
}
|
418
|
+
/** [16] FunctionCall::= FunctionName '(' ( Argument ( ',' Argument )* )? ')'
|
419
|
+
* [17] Argument::= Expr
|
420
|
+
*/
|
421
|
+
function functionCall(stream, a) {
|
422
|
+
var name = stream.trypopfuncname(stream, a);
|
423
|
+
if (null == name) return null;
|
424
|
+
if (null == stream.trypop('('))
|
425
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
426
|
+
'Position ' + stream.position() +
|
427
|
+
': Expected ( ) after function name.');
|
428
|
+
var params = [];
|
429
|
+
var first = true;
|
430
|
+
while (null == stream.trypop(')')) {
|
431
|
+
if (!first && null == stream.trypop(','))
|
432
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
433
|
+
'Position ' + stream.position() +
|
434
|
+
': Expected , between arguments of the function.');
|
435
|
+
first = false;
|
436
|
+
var param = orExpr(stream, a);
|
437
|
+
if (param == null)
|
438
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
439
|
+
'Position ' + stream.position() +
|
440
|
+
': Expected expression as argument of function.');
|
441
|
+
params.push(param);
|
442
|
+
}
|
443
|
+
return a.node('FunctionCall', name, params);
|
444
|
+
}
|
445
|
+
|
446
|
+
/** [18] UnionExpr::= PathExpr | UnionExpr '|' PathExpr
|
447
|
+
*/
|
448
|
+
function unionExpr(stream, a) { return binaryL(pathExpr, stream, a, '|'); }
|
449
|
+
/** [19] PathExpr ::= LocationPath
|
450
|
+
* | FilterExpr
|
451
|
+
* | FilterExpr '/' RelativeLocationPath
|
452
|
+
* | FilterExpr '//' RelativeLocationPath
|
453
|
+
* Unlike most other nodes, this one always generates a node because
|
454
|
+
* at this point all reverse nodesets must turn into a forward nodeset
|
455
|
+
*/
|
456
|
+
function pathExpr(stream, a) {
|
457
|
+
// We have to do FilterExpr before LocationPath because otherwise
|
458
|
+
// LocationPath will eat up the name from a function call.
|
459
|
+
var filter = filterExpr(stream, a);
|
460
|
+
if (null == filter) {
|
461
|
+
var loc = locationPath(stream, a);
|
462
|
+
if (null == loc) {
|
463
|
+
throw new Error
|
464
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
465
|
+
'Position ' + stream.position() +
|
466
|
+
': The expression shouldn\'t be empty...');
|
467
|
+
}
|
468
|
+
return a.node('PathExpr', loc);
|
469
|
+
}
|
470
|
+
var rel = relativeLocationPath(filter, stream, a, false);
|
471
|
+
if (filter === rel) return rel;
|
472
|
+
else return a.node('PathExpr', rel);
|
473
|
+
}
|
474
|
+
/** [20] FilterExpr::= PrimaryExpr | FilterExpr Predicate
|
475
|
+
* aka. FilterExpr ::= PrimaryExpr Predicate*
|
476
|
+
*/
|
477
|
+
function filterExpr(stream, a) {
|
478
|
+
var primary = primaryExpr(stream, a);
|
479
|
+
if (primary == null) return null;
|
480
|
+
var pred, lhs = primary;
|
481
|
+
while (null != (pred = predicate(lhs, stream, a))) {
|
482
|
+
lhs = pred;
|
483
|
+
}
|
484
|
+
return lhs;
|
485
|
+
}
|
486
|
+
|
487
|
+
/** [21] OrExpr::= AndExpr | OrExpr 'or' AndExpr
|
488
|
+
*/
|
489
|
+
function orExpr(stream, a) {
|
490
|
+
var orig = (stream.peeked || '') + stream.str
|
491
|
+
var r = binaryL(andExpr, stream, a, 'or');
|
492
|
+
var now = (stream.peeked || '') + stream.str;
|
493
|
+
return r;
|
494
|
+
}
|
495
|
+
/** [22] AndExpr::= EqualityExpr | AndExpr 'and' EqualityExpr
|
496
|
+
*/
|
497
|
+
function andExpr(stream, a) { return binaryL(equalityExpr, stream, a, 'and'); }
|
498
|
+
/** [23] EqualityExpr::= RelationalExpr | EqualityExpr '=' RelationalExpr
|
499
|
+
* | EqualityExpr '!=' RelationalExpr
|
500
|
+
*/
|
501
|
+
function equalityExpr(stream, a) { return binaryL(relationalExpr, stream, a, ['=','!=']); }
|
502
|
+
/** [24] RelationalExpr::= AdditiveExpr | RelationalExpr '<' AdditiveExpr
|
503
|
+
* | RelationalExpr '>' AdditiveExpr
|
504
|
+
* | RelationalExpr '<=' AdditiveExpr
|
505
|
+
* | RelationalExpr '>=' AdditiveExpr
|
506
|
+
*/
|
507
|
+
function relationalExpr(stream, a) { return binaryL(additiveExpr, stream, a, ['<','>','<=','>=']); }
|
508
|
+
/** [25] AdditiveExpr::= MultiplicativeExpr
|
509
|
+
* | AdditiveExpr '+' MultiplicativeExpr
|
510
|
+
* | AdditiveExpr '-' MultiplicativeExpr
|
511
|
+
*/
|
512
|
+
function additiveExpr(stream, a) { return binaryL(multiplicativeExpr, stream, a, ['+','-']); }
|
513
|
+
/** [26] MultiplicativeExpr::= UnaryExpr
|
514
|
+
* | MultiplicativeExpr MultiplyOperator UnaryExpr
|
515
|
+
* | MultiplicativeExpr 'div' UnaryExpr
|
516
|
+
* | MultiplicativeExpr 'mod' UnaryExpr
|
517
|
+
*/
|
518
|
+
function multiplicativeExpr(stream, a) { return binaryL(unaryExpr, stream, a, ['*','div','mod']); }
|
519
|
+
/** [27] UnaryExpr::= UnionExpr | '-' UnaryExpr
|
520
|
+
*/
|
521
|
+
function unaryExpr(stream, a) {
|
522
|
+
if (stream.trypop('-')) {
|
523
|
+
var e = unaryExpr(stream, a);
|
524
|
+
if (null == e)
|
525
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
526
|
+
'Position ' + stream.position() +
|
527
|
+
': Expected unary expression after -');
|
528
|
+
return a.node('UnaryMinus', e);
|
529
|
+
}
|
530
|
+
else return unionExpr(stream, a);
|
531
|
+
}
|
532
|
+
var astFactory = {
|
533
|
+
node: function() {return Array.prototype.slice.call(arguments);}
|
534
|
+
};
|
535
|
+
|
536
|
+
|
537
|
+
/***************************************************************************
|
538
|
+
* Optimizations (TODO) *
|
539
|
+
***************************************************************************/
|
540
|
+
/**
|
541
|
+
* Some things I've been considering:
|
542
|
+
* 1) a//b becomes a/descendant::b if there's no predicate that uses
|
543
|
+
* position() or last()
|
544
|
+
* 2) axis[pred]: when pred doesn't use position, evaluate it just once per
|
545
|
+
* node in the node-set rather than once per (node, position, last).
|
546
|
+
* For more optimizations, look up Gecko's optimizer:
|
547
|
+
* http://mxr.mozilla.org/mozilla-central/source/content/xslt/src/xpath/txXPathOptimizer.cpp
|
548
|
+
*/
|
549
|
+
// TODO
|
550
|
+
function optimize(ast) {
|
551
|
+
}
|
552
|
+
|
553
|
+
/***************************************************************************
|
554
|
+
* Evaluation: axes *
|
555
|
+
***************************************************************************/
|
556
|
+
|
557
|
+
/**
|
558
|
+
* Data types: For string, number, boolean, we just use Javascript types.
|
559
|
+
* Node-sets have the form
|
560
|
+
* {nodes: [node, ...]}
|
561
|
+
* or {nodes: [node, ...], pos: [[1], [2], ...], lasts: [[1], [2], ...]}
|
562
|
+
*
|
563
|
+
* Most of the time, only the node is used and the position information is
|
564
|
+
* discarded. But if you use a predicate, we need to try every value of
|
565
|
+
* position and last in case the predicate calls position() or last().
|
566
|
+
*/
|
567
|
+
|
568
|
+
/**
|
569
|
+
* The NodeMultiSet is a helper class to help generate
|
570
|
+
* {nodes:[], pos:[], lasts:[]} structures. It is useful for the
|
571
|
+
* descendant, descendant-or-self, following-sibling, and
|
572
|
+
* preceding-sibling axes for which we can use a stack to organize things.
|
573
|
+
*/
|
574
|
+
function NodeMultiSet(isReverseAxis) {
|
575
|
+
this.nodes = [];
|
576
|
+
this.pos = [];
|
577
|
+
this.lasts = [];
|
578
|
+
this.nextPos = [];
|
579
|
+
this.seriesIndexes = []; // index within nodes that each series begins.
|
580
|
+
this.isReverseAxis = isReverseAxis;
|
581
|
+
this._pushToNodes = isReverseAxis ? Array.prototype.unshift : Array.prototype.push;
|
582
|
+
}
|
583
|
+
NodeMultiSet.prototype = {
|
584
|
+
pushSeries: function pushSeries() {
|
585
|
+
this.nextPos.push(1);
|
586
|
+
this.seriesIndexes.push(this.nodes.length);
|
587
|
+
},
|
588
|
+
popSeries: function popSeries() {
|
589
|
+
console.assert(0 < this.nextPos.length, this.nextPos);
|
590
|
+
var last = this.nextPos.pop() - 1,
|
591
|
+
indexInPos = this.nextPos.length,
|
592
|
+
seriesBeginIndex = this.seriesIndexes.pop(),
|
593
|
+
seriesEndIndex = this.nodes.length;
|
594
|
+
for (var i = seriesBeginIndex; i < seriesEndIndex; ++i) {
|
595
|
+
console.assert(indexInPos < this.lasts[i].length);
|
596
|
+
console.assert(undefined === this.lasts[i][indexInPos]);
|
597
|
+
this.lasts[i][indexInPos] = last;
|
598
|
+
}
|
599
|
+
},
|
600
|
+
finalize: function() {
|
601
|
+
if (null == this.nextPos) return this;
|
602
|
+
console.assert(0 === this.nextPos.length);
|
603
|
+
var lastsJSON = JSON.stringify(this.lasts);
|
604
|
+
for (var i = 0; i < this.lasts.length; ++i) {
|
605
|
+
for (var j = 0; j < this.lasts[i].length; ++j) {
|
606
|
+
console.assert(null != this.lasts[i][j], i + ',' + j + ':' + lastsJSON);
|
607
|
+
}
|
608
|
+
}
|
609
|
+
this.pushSeries = this.popSeries = this.addNode = function() {
|
610
|
+
throw new Error('Already finalized.');
|
611
|
+
};
|
612
|
+
return this;
|
613
|
+
},
|
614
|
+
addNode: function addNode(node) {
|
615
|
+
console.assert(node);
|
616
|
+
this._pushToNodes.call(this.nodes, node)
|
617
|
+
this._pushToNodes.call(this.pos, this.nextPos.slice());
|
618
|
+
this._pushToNodes.call(this.lasts, new Array(this.nextPos.length));
|
619
|
+
for (var i = 0; i < this.nextPos.length; ++i) this.nextPos[i]++;
|
620
|
+
},
|
621
|
+
simplify: function() {
|
622
|
+
this.finalize();
|
623
|
+
return {nodes:this.nodes, pos:this.pos, lasts:this.lasts};
|
624
|
+
}
|
625
|
+
};
|
626
|
+
function eachContext(nodeMultiSet) {
|
627
|
+
var r = [];
|
628
|
+
for (var i = 0; i < nodeMultiSet.nodes.length; i++) {
|
629
|
+
var node = nodeMultiSet.nodes[i];
|
630
|
+
if (!nodeMultiSet.pos) {
|
631
|
+
r.push({nodes:[node], pos: [[i + 1]], lasts: [[nodeMultiSet.nodes.length]]});
|
632
|
+
} else {
|
633
|
+
for (var j = 0; j < nodeMultiSet.pos[i].length; ++j) {
|
634
|
+
r.push({nodes:[node], pos: [[nodeMultiSet.pos[i][j]]], lasts: [[nodeMultiSet.lasts[i][j]]]});
|
635
|
+
}
|
636
|
+
}
|
637
|
+
}
|
638
|
+
return r;
|
639
|
+
}
|
640
|
+
/** Matcher used in the axes.
|
641
|
+
*/
|
642
|
+
function NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase) {
|
643
|
+
this.nodeTypeNum = nodeTypeNum;
|
644
|
+
this.nodeName = nodeName;
|
645
|
+
this.shouldLowerCase = shouldLowerCase;
|
646
|
+
this.nodeNameTest =
|
647
|
+
null == nodeName ? this._alwaysTrue :
|
648
|
+
shouldLowerCase ? this._nodeNameLowerCaseEquals :
|
649
|
+
this._nodeNameEquals;
|
650
|
+
}
|
651
|
+
NodeMatcher.prototype = {
|
652
|
+
matches: function matches(node) {
|
653
|
+
if (0 === this.nodeTypeNum || this._nodeTypeMatches(node)) {
|
654
|
+
return this.nodeNameTest(getNodeName(node));
|
655
|
+
}
|
656
|
+
|
657
|
+
return false;
|
658
|
+
},
|
659
|
+
_nodeTypeMatches(nodeOrAttr) {
|
660
|
+
if (nodeOrAttr.constructor.name === 'Attr' && this.nodeTypeNum === 2) {
|
661
|
+
return true;
|
662
|
+
}
|
663
|
+
return nodeOrAttr.nodeType === this.nodeTypeNum;
|
664
|
+
},
|
665
|
+
_alwaysTrue: function(name) {return true;},
|
666
|
+
_nodeNameEquals: function _nodeNameEquals(name) {
|
667
|
+
return this.nodeName === name;
|
668
|
+
},
|
669
|
+
_nodeNameLowerCaseEquals: function _nodeNameLowerCaseEquals(name) {
|
670
|
+
return this.nodeName === name.toLowerCase();
|
671
|
+
}
|
672
|
+
};
|
673
|
+
|
674
|
+
function followingSiblingHelper(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase, shift, peek, followingNode, andSelf, isReverseAxis) {
|
675
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
676
|
+
var nodeMultiSet = new NodeMultiSet(isReverseAxis);
|
677
|
+
while (0 < nodeList.length) { // can be if for following, preceding
|
678
|
+
var node = shift.call(nodeList);
|
679
|
+
console.assert(node != null);
|
680
|
+
node = followingNode(node);
|
681
|
+
nodeMultiSet.pushSeries();
|
682
|
+
var numPushed = 1;
|
683
|
+
while (null != node) {
|
684
|
+
if (! andSelf && matcher.matches(node))
|
685
|
+
nodeMultiSet.addNode(node);
|
686
|
+
if (node === peek.call(nodeList)) {
|
687
|
+
shift.call(nodeList);
|
688
|
+
nodeMultiSet.pushSeries();
|
689
|
+
numPushed++;
|
690
|
+
}
|
691
|
+
if (andSelf && matcher.matches(node))
|
692
|
+
nodeMultiSet.addNode(node);
|
693
|
+
node = followingNode(node);
|
694
|
+
}
|
695
|
+
while (0 < numPushed--)
|
696
|
+
nodeMultiSet.popSeries();
|
697
|
+
}
|
698
|
+
return nodeMultiSet;
|
699
|
+
}
|
700
|
+
|
701
|
+
/** Returns the next non-descendant node in document order.
|
702
|
+
* This is the first node in following::node(), if node is the context.
|
703
|
+
*/
|
704
|
+
function followingNonDescendantNode(node) {
|
705
|
+
if (node.ownerElement) {
|
706
|
+
if (node.ownerElement.firstChild)
|
707
|
+
return node.ownerElement.firstChild;
|
708
|
+
node = node.ownerElement;
|
709
|
+
}
|
710
|
+
do {
|
711
|
+
if (node.nextSibling) return node.nextSibling;
|
712
|
+
} while (node = node.parentNode);
|
713
|
+
return null;
|
714
|
+
}
|
715
|
+
|
716
|
+
/** Returns the next node in a document-order depth-first search.
|
717
|
+
* See the definition of document order[1]:
|
718
|
+
* 1) element
|
719
|
+
* 2) namespace nodes
|
720
|
+
* 3) attributes
|
721
|
+
* 4) children
|
722
|
+
* [1]: http://www.w3.org/TR/xpath/#dt-document-order
|
723
|
+
*/
|
724
|
+
function followingNode(node) {
|
725
|
+
if (node.ownerElement) // attributes: following node of element.
|
726
|
+
node = node.ownerElement;
|
727
|
+
if (null != node.firstChild)
|
728
|
+
return node.firstChild;
|
729
|
+
do {
|
730
|
+
if (null != node.nextSibling) {
|
731
|
+
return node.nextSibling;
|
732
|
+
}
|
733
|
+
node = node.parentNode;
|
734
|
+
} while (node);
|
735
|
+
return null;
|
736
|
+
}
|
737
|
+
/** Returns the previous node in document order (excluding attributes
|
738
|
+
* and namespace nodes).
|
739
|
+
*/
|
740
|
+
function precedingNode(node) {
|
741
|
+
if (node.ownerElement)
|
742
|
+
return node.ownerElement;
|
743
|
+
if (null != node.previousSibling) {
|
744
|
+
node = node.previousSibling;
|
745
|
+
while (null != node.lastChild) {
|
746
|
+
node = node.lastChild;
|
747
|
+
}
|
748
|
+
return node;
|
749
|
+
}
|
750
|
+
if (null != node.parentNode) {
|
751
|
+
return node.parentNode;
|
752
|
+
}
|
753
|
+
return null;
|
754
|
+
}
|
755
|
+
/** This axis is inefficient if there are many nodes in the nodeList.
|
756
|
+
* But I think it's a pretty useless axis so it's ok. */
|
757
|
+
function followingHelper(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
758
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
759
|
+
var nodeMultiSet = new NodeMultiSet(false);
|
760
|
+
var cursor = nodeList[0];
|
761
|
+
var unorderedFollowingStarts = [];
|
762
|
+
for (var i = 0; i < nodeList.length; i++) {
|
763
|
+
var node = nodeList[i];
|
764
|
+
var start = followingNonDescendantNode(node);
|
765
|
+
if (start)
|
766
|
+
unorderedFollowingStarts.push(start);
|
767
|
+
}
|
768
|
+
if (0 === unorderedFollowingStarts.length)
|
769
|
+
return {nodes:[]};
|
770
|
+
var pos = [], nextPos = [];
|
771
|
+
var started = 0;
|
772
|
+
while (cursor = followingNode(cursor)) {
|
773
|
+
for (var i = unorderedFollowingStarts.length - 1; i >= 0; i--){
|
774
|
+
if (cursor === unorderedFollowingStarts[i]) {
|
775
|
+
nodeMultiSet.pushSeries();
|
776
|
+
unorderedFollowingStarts.splice(i,i+1);
|
777
|
+
started++;
|
778
|
+
}
|
779
|
+
}
|
780
|
+
if (started && matcher.matches(cursor)) {
|
781
|
+
nodeMultiSet.addNode(cursor);
|
782
|
+
}
|
783
|
+
}
|
784
|
+
console.assert(0 === unorderedFollowingStarts.length);
|
785
|
+
for (var i = 0; i < started; i++)
|
786
|
+
nodeMultiSet.popSeries();
|
787
|
+
return nodeMultiSet.finalize();
|
788
|
+
}
|
789
|
+
function precedingHelper(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
790
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
791
|
+
var cursor = nodeList.pop();
|
792
|
+
if (null == cursor) return {nodes:{}};
|
793
|
+
var r = {nodes:[], pos:[], lasts:[]};
|
794
|
+
var nextParents = [cursor.parentNode || cursor.ownerElement], nextPos = [1];
|
795
|
+
while (cursor = precedingNode(cursor)) {
|
796
|
+
if (cursor === nodeList[nodeList.length - 1]) {
|
797
|
+
nextParents.push(nodeList.pop());
|
798
|
+
nextPos.push(1);
|
799
|
+
}
|
800
|
+
var matches = matcher.matches(cursor);
|
801
|
+
var pos, someoneUsed = false;
|
802
|
+
if (matches)
|
803
|
+
pos = nextPos.slice();
|
804
|
+
|
805
|
+
for (var i = 0; i < nextParents.length; ++i) {
|
806
|
+
if (cursor === nextParents[i]) {
|
807
|
+
nextParents[i] = cursor.parentNode || cursor.ownerElement;
|
808
|
+
if (matches) {
|
809
|
+
pos[i] = null;
|
810
|
+
}
|
811
|
+
} else {
|
812
|
+
if (matches) {
|
813
|
+
pos[i] = nextPos[i]++;
|
814
|
+
someoneUsed = true;
|
815
|
+
}
|
816
|
+
}
|
817
|
+
}
|
818
|
+
if (someoneUsed) {
|
819
|
+
r.nodes.unshift(cursor);
|
820
|
+
r.pos.unshift(pos);
|
821
|
+
}
|
822
|
+
}
|
823
|
+
for (var i = 0; i < r.pos.length; ++i) {
|
824
|
+
var lasts = [];
|
825
|
+
r.lasts.push(lasts);
|
826
|
+
for (var j = r.pos[i].length - 1; j >= 0; j--) {
|
827
|
+
if (null == r.pos[i][j]) {
|
828
|
+
r.pos[i].splice(j, j+1);
|
829
|
+
} else {
|
830
|
+
lasts.unshift(nextPos[j] - 1);
|
831
|
+
}
|
832
|
+
}
|
833
|
+
}
|
834
|
+
return r;
|
835
|
+
}
|
836
|
+
|
837
|
+
/** node-set, axis -> node-set */
|
838
|
+
function descendantDfs(nodeMultiSet, node, remaining, matcher, andSelf, attrIndices, attrNodes) {
|
839
|
+
while (0 < remaining.length && null != remaining[0].ownerElement) {
|
840
|
+
var attr = remaining.shift();
|
841
|
+
if (andSelf && matcher.matches(attr)) {
|
842
|
+
attrNodes.push(attr);
|
843
|
+
attrIndices.push(nodeMultiSet.nodes.length);
|
844
|
+
}
|
845
|
+
}
|
846
|
+
if (null != node && !andSelf) {
|
847
|
+
if (matcher.matches(node))
|
848
|
+
nodeMultiSet.addNode(node);
|
849
|
+
}
|
850
|
+
var pushed = false;
|
851
|
+
if (null == node) {
|
852
|
+
if (0 === remaining.length) return;
|
853
|
+
node = remaining.shift();
|
854
|
+
nodeMultiSet.pushSeries();
|
855
|
+
pushed = true;
|
856
|
+
} else if (0 < remaining.length && node === remaining[0]) {
|
857
|
+
nodeMultiSet.pushSeries();
|
858
|
+
pushed = true;
|
859
|
+
remaining.shift();
|
860
|
+
}
|
861
|
+
if (andSelf) {
|
862
|
+
if (matcher.matches(node))
|
863
|
+
nodeMultiSet.addNode(node);
|
864
|
+
}
|
865
|
+
// TODO: use optimization. Also try element.getElementsByTagName
|
866
|
+
// var nodeList = 1 === nodeTypeNum && null != node.children ? node.children : node.childNodes;
|
867
|
+
var nodeList = node.childNodes;
|
868
|
+
for (var j = 0; j < nodeList.length; ++j) {
|
869
|
+
var child = nodeList[j];
|
870
|
+
descendantDfs(nodeMultiSet, child, remaining, matcher, andSelf, attrIndices, attrNodes);
|
871
|
+
}
|
872
|
+
if (pushed) {
|
873
|
+
nodeMultiSet.popSeries();
|
874
|
+
}
|
875
|
+
}
|
876
|
+
function descenantHelper(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase, andSelf) {
|
877
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
878
|
+
var nodeMultiSet = new NodeMultiSet(false);
|
879
|
+
var attrIndices = [], attrNodes = [];
|
880
|
+
while (0 < nodeList.length) {
|
881
|
+
// var node = nodeList.shift();
|
882
|
+
descendantDfs(nodeMultiSet, null, nodeList, matcher, andSelf, attrIndices, attrNodes);
|
883
|
+
}
|
884
|
+
nodeMultiSet.finalize();
|
885
|
+
for (var i = attrNodes.length-1; i >= 0; --i) {
|
886
|
+
nodeMultiSet.nodes.splice(attrIndices[i], attrIndices[i], attrNodes[i]);
|
887
|
+
nodeMultiSet.pos.splice(attrIndices[i], attrIndices[i], [1]);
|
888
|
+
nodeMultiSet.lasts.splice(attrIndices[i], attrIndices[i], [1]);
|
889
|
+
}
|
890
|
+
return nodeMultiSet;
|
891
|
+
}
|
892
|
+
/**
|
893
|
+
*/
|
894
|
+
function ancestorHelper(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase, andSelf) {
|
895
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
896
|
+
var ancestors = []; // array of non-empty arrays of matching ancestors
|
897
|
+
for (var i = 0; i < nodeList.length; ++i) {
|
898
|
+
var node = nodeList[i];
|
899
|
+
var isFirst = true;
|
900
|
+
var a = [];
|
901
|
+
while (null != node) {
|
902
|
+
if (!isFirst || andSelf) {
|
903
|
+
if (matcher.matches(node))
|
904
|
+
a.push(node);
|
905
|
+
}
|
906
|
+
isFirst = false;
|
907
|
+
node = node.parentNode || node.ownerElement;
|
908
|
+
}
|
909
|
+
if (0 < a.length)
|
910
|
+
ancestors.push(a);
|
911
|
+
}
|
912
|
+
var lasts = [];
|
913
|
+
for (var i = 0; i < ancestors.length; ++i) lasts.push(ancestors[i].length);
|
914
|
+
var nodeMultiSet = new NodeMultiSet(true);
|
915
|
+
var newCtx = {nodes:[], pos:[], lasts:[]};
|
916
|
+
while (0 < ancestors.length) {
|
917
|
+
var pos = [ancestors[0].length];
|
918
|
+
var last = [lasts[0]];
|
919
|
+
var node = ancestors[0].pop();
|
920
|
+
for (var i = ancestors.length - 1; i > 0; --i) {
|
921
|
+
if (node === ancestors[i][ancestors[i].length - 1]) {
|
922
|
+
pos.push(ancestors[i].length);
|
923
|
+
last.push(lasts[i]);
|
924
|
+
ancestors[i].pop();
|
925
|
+
if (0 === ancestors[i].length) {
|
926
|
+
ancestors.splice(i, i+1);
|
927
|
+
lasts.splice(i, i+1);
|
928
|
+
}
|
929
|
+
}
|
930
|
+
}
|
931
|
+
if (0 === ancestors[0].length) {
|
932
|
+
ancestors.shift();
|
933
|
+
lasts.shift();
|
934
|
+
}
|
935
|
+
newCtx.nodes.push(node);
|
936
|
+
newCtx.pos.push(pos);
|
937
|
+
newCtx.lasts.push(last);
|
938
|
+
}
|
939
|
+
return newCtx;
|
940
|
+
}
|
941
|
+
/** Helper function for sortDocumentOrder. Returns a list of indices, from the
|
942
|
+
* node to the root, of positions within parent.
|
943
|
+
* For convenience, the node is the first element of the array.
|
944
|
+
*/
|
945
|
+
function addressVector(node) {
|
946
|
+
var r = [node];
|
947
|
+
if (null != node.ownerElement) {
|
948
|
+
node = node.ownerElement;
|
949
|
+
r.push(-1);
|
950
|
+
}
|
951
|
+
while (null != node) {
|
952
|
+
var i = 0;
|
953
|
+
while (null != node.previousSibling) {
|
954
|
+
node = node.previousSibling;
|
955
|
+
i++;
|
956
|
+
}
|
957
|
+
r.push(i);
|
958
|
+
node = node.parentNode
|
959
|
+
}
|
960
|
+
return r;
|
961
|
+
}
|
962
|
+
function addressComparator(a, b) {
|
963
|
+
var minlen = Math.min(a.length - 1, b.length - 1), // not including [0]=node
|
964
|
+
alen = a.length,
|
965
|
+
blen = b.length;
|
966
|
+
if (a[0] === b[0]) return 0;
|
967
|
+
var c;
|
968
|
+
for (var i = 0; i < minlen; ++i) {
|
969
|
+
c = a[alen - i - 1] - b[blen - i - 1];
|
970
|
+
if (0 !== c)
|
971
|
+
break;
|
972
|
+
}
|
973
|
+
if (null == c || 0 === c) {
|
974
|
+
// All equal until one of the nodes. The longer one is the descendant.
|
975
|
+
c = alen - blen;
|
976
|
+
}
|
977
|
+
if (0 === c)
|
978
|
+
c = getNodeName(a) - getNodeName(b);
|
979
|
+
if (0 === c)
|
980
|
+
c = 1;
|
981
|
+
return c;
|
982
|
+
}
|
983
|
+
var sortUniqDocumentOrder = xpath.sortUniqDocumentOrder = function(nodes) {
|
984
|
+
var a = [];
|
985
|
+
for (var i = 0; i < nodes.length; i++) {
|
986
|
+
var node = nodes[i];
|
987
|
+
var v = addressVector(node);
|
988
|
+
a.push(v);
|
989
|
+
}
|
990
|
+
a.sort(addressComparator);
|
991
|
+
var b = [];
|
992
|
+
for (var i = 0; i < a.length; i++) {
|
993
|
+
if (0 < i && a[i][0] === a[i - 1][0])
|
994
|
+
continue;
|
995
|
+
b.push(a[i][0]);
|
996
|
+
}
|
997
|
+
return b;
|
998
|
+
}
|
999
|
+
/** Sort node multiset. Does not do any de-duping. */
|
1000
|
+
function sortNodeMultiSet(nodeMultiSet) {
|
1001
|
+
var a = [];
|
1002
|
+
for (var i = 0; i < nodeMultiSet.nodes.length; i++) {
|
1003
|
+
var v = addressVector(nodeMultiSet.nodes[i]);
|
1004
|
+
a.push({v:v, n:nodeMultiSet.nodes[i],
|
1005
|
+
p:nodeMultiSet.pos[i], l:nodeMultiSet.lasts[i]});
|
1006
|
+
}
|
1007
|
+
a.sort(compare);
|
1008
|
+
var r = {nodes:[], pos:[], lasts:[]};
|
1009
|
+
for (var i = 0; i < a.length; ++i) {
|
1010
|
+
r.nodes.push(a[i].n);
|
1011
|
+
r.pos.push(a[i].p);
|
1012
|
+
r.lasts.push(a[i].l);
|
1013
|
+
}
|
1014
|
+
function compare(x, y) {
|
1015
|
+
return addressComparator(x.v, y.v);
|
1016
|
+
}
|
1017
|
+
return r;
|
1018
|
+
}
|
1019
|
+
/** Returns an array containing all the ancestors down to a node.
|
1020
|
+
* The array starts with document.
|
1021
|
+
*/
|
1022
|
+
function nodeAndAncestors(node) {
|
1023
|
+
var ancestors = [node];
|
1024
|
+
var p = node;
|
1025
|
+
while (p = p.parentNode || p.ownerElement) {
|
1026
|
+
ancestors.unshift(p);
|
1027
|
+
}
|
1028
|
+
return ancestors;
|
1029
|
+
}
|
1030
|
+
function compareSiblings(a, b) {
|
1031
|
+
if (a === b) return 0;
|
1032
|
+
var c = a;
|
1033
|
+
while (c = c.previousSibling) {
|
1034
|
+
if (c === b)
|
1035
|
+
return 1; // b < a
|
1036
|
+
}
|
1037
|
+
c = b;
|
1038
|
+
while (c = c.previousSibling) {
|
1039
|
+
if (c === a)
|
1040
|
+
return -1; // a < b
|
1041
|
+
}
|
1042
|
+
throw new Error('a and b are not siblings: ' + xpath.stringifyObject(a) + ' vs ' + xpath.stringifyObject(b));
|
1043
|
+
}
|
1044
|
+
/** The merge in merge-sort.*/
|
1045
|
+
function mergeNodeLists(x, y) {
|
1046
|
+
var a, b, aanc, banc, r = [];
|
1047
|
+
if ('object' !== typeof x)
|
1048
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
1049
|
+
'Invalid LHS for | operator ' +
|
1050
|
+
'(expected node-set): ' + x);
|
1051
|
+
if ('object' !== typeof y)
|
1052
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
1053
|
+
'Invalid LHS for | operator ' +
|
1054
|
+
'(expected node-set): ' + y);
|
1055
|
+
while (true) {
|
1056
|
+
if (null == a) {
|
1057
|
+
a = x.shift();
|
1058
|
+
if (null != a)
|
1059
|
+
aanc = addressVector(a);
|
1060
|
+
}
|
1061
|
+
if (null == b) {
|
1062
|
+
b = y.shift();
|
1063
|
+
if (null != b)
|
1064
|
+
banc = addressVector(b);
|
1065
|
+
}
|
1066
|
+
if (null == a || null == b) break;
|
1067
|
+
var c = addressComparator(aanc, banc);
|
1068
|
+
if (c < 0) {
|
1069
|
+
r.push(a);
|
1070
|
+
a = null;
|
1071
|
+
aanc = null;
|
1072
|
+
} else if (c > 0) {
|
1073
|
+
r.push(b);
|
1074
|
+
b = null;
|
1075
|
+
banc = null;
|
1076
|
+
} else if (getNodeName(a) < getNodeName(b)) { // attributes
|
1077
|
+
r.push(a);
|
1078
|
+
a = null;
|
1079
|
+
aanc = null;
|
1080
|
+
} else if (getNodeName(a) > getNodeName(b)) { // attributes
|
1081
|
+
r.push(b);
|
1082
|
+
b = null;
|
1083
|
+
banc = null;
|
1084
|
+
} else if (a !== b) {
|
1085
|
+
// choose b arbitrarily
|
1086
|
+
r.push(b);
|
1087
|
+
b = null;
|
1088
|
+
banc = null;
|
1089
|
+
} else {
|
1090
|
+
console.assert(a === b, c);
|
1091
|
+
// just skip b without pushing it.
|
1092
|
+
b = null;
|
1093
|
+
banc = null;
|
1094
|
+
}
|
1095
|
+
}
|
1096
|
+
while (a) {
|
1097
|
+
r.push(a);
|
1098
|
+
a = x.shift();
|
1099
|
+
}
|
1100
|
+
while (b) {
|
1101
|
+
r.push(b);
|
1102
|
+
b = y.shift();
|
1103
|
+
}
|
1104
|
+
return r;
|
1105
|
+
}
|
1106
|
+
function comparisonHelper(test, x, y, isNumericComparison) {
|
1107
|
+
var coersion;
|
1108
|
+
if (isNumericComparison)
|
1109
|
+
coersion = fn.number;
|
1110
|
+
else coersion =
|
1111
|
+
'boolean' === typeof x || 'boolean' === typeof y ? fn['boolean'] :
|
1112
|
+
'number' === typeof x || 'number' === typeof y ? fn.number :
|
1113
|
+
fn.string;
|
1114
|
+
if ('object' === typeof x && 'object' === typeof y) {
|
1115
|
+
var aMap = {};
|
1116
|
+
for (var i = 0; i < x.nodes.length; ++i) {
|
1117
|
+
var xi = coersion({nodes:[x.nodes[i]]});
|
1118
|
+
for (var j = 0; j < y.nodes.length; ++j) {
|
1119
|
+
var yj = coersion({nodes:[y.nodes[j]]});
|
1120
|
+
if (test(xi, yj)) return true;
|
1121
|
+
}
|
1122
|
+
}
|
1123
|
+
return false;
|
1124
|
+
} else if ('object' === typeof x && x.nodes && x.nodes.length) {
|
1125
|
+
for (var i = 0; i < x.nodes.length; ++i) {
|
1126
|
+
var xi = coersion({nodes:[x.nodes[i]]}), yc = coersion(y);
|
1127
|
+
if (test(xi, yc))
|
1128
|
+
return true;
|
1129
|
+
}
|
1130
|
+
return false;
|
1131
|
+
} else if ('object' === typeof y && x.nodes && x.nodes.length) {
|
1132
|
+
for (var i = 0; i < x.nodes.length; ++i) {
|
1133
|
+
var yi = coersion({nodes:[y.nodes[i]]}), xc = coersion(x);
|
1134
|
+
if (test(xc, yi))
|
1135
|
+
return true;
|
1136
|
+
}
|
1137
|
+
return false;
|
1138
|
+
} else {
|
1139
|
+
var xc = coersion(x), yc = coersion(y);
|
1140
|
+
return test(xc, yc);
|
1141
|
+
}
|
1142
|
+
}
|
1143
|
+
var axes = xpath.axes = {
|
1144
|
+
'ancestor':
|
1145
|
+
function ancestor(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1146
|
+
return ancestorHelper(
|
1147
|
+
nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase, false);
|
1148
|
+
},
|
1149
|
+
'ancestor-or-self':
|
1150
|
+
function ancestorOrSelf(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1151
|
+
return ancestorHelper(
|
1152
|
+
nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase, true);
|
1153
|
+
},
|
1154
|
+
'attribute':
|
1155
|
+
function attribute(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1156
|
+
// TODO: figure out whether positions should be undefined here.
|
1157
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
1158
|
+
var nodeMultiSet = new NodeMultiSet(false);
|
1159
|
+
if (null != nodeName) {
|
1160
|
+
// TODO: with namespace
|
1161
|
+
for (var i = 0; i < nodeList.length; ++i) {
|
1162
|
+
var node = nodeList[i];
|
1163
|
+
if (null == node.getAttributeNode)
|
1164
|
+
continue; // only Element has .getAttributeNode
|
1165
|
+
var attr = node.getAttributeNode(nodeName);
|
1166
|
+
if (null != attr && matcher.matches(attr)) {
|
1167
|
+
nodeMultiSet.pushSeries();
|
1168
|
+
nodeMultiSet.addNode(attr);
|
1169
|
+
nodeMultiSet.popSeries();
|
1170
|
+
}
|
1171
|
+
}
|
1172
|
+
} else {
|
1173
|
+
for (var i = 0; i < nodeList.length; ++i) {
|
1174
|
+
var node = nodeList[i];
|
1175
|
+
if (null != node.attributes) {
|
1176
|
+
nodeMultiSet.pushSeries();
|
1177
|
+
for (var j = 0; j < node.attributes.length; j++) { // all nodes have .attributes
|
1178
|
+
var attr = node.attributes[j];
|
1179
|
+
if (matcher.matches(attr)) // TODO: I think this check is unnecessary
|
1180
|
+
nodeMultiSet.addNode(attr);
|
1181
|
+
}
|
1182
|
+
nodeMultiSet.popSeries();
|
1183
|
+
}
|
1184
|
+
}
|
1185
|
+
}
|
1186
|
+
return nodeMultiSet.finalize();
|
1187
|
+
},
|
1188
|
+
'child':
|
1189
|
+
function child(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1190
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
1191
|
+
var nodeMultiSet = new NodeMultiSet(false);
|
1192
|
+
for (var i = 0; i < nodeList.length; ++i) {
|
1193
|
+
var n = nodeList[i];
|
1194
|
+
if (n.ownerElement) // skip attribute nodes' text child.
|
1195
|
+
continue;
|
1196
|
+
if (n.childNodes) {
|
1197
|
+
nodeMultiSet.pushSeries();
|
1198
|
+
var childList = 1 === nodeTypeNum && null != n.children ?
|
1199
|
+
n.children : n.childNodes;
|
1200
|
+
for (var j = 0; j < childList.length; ++j) {
|
1201
|
+
var child = childList[j];
|
1202
|
+
if (matcher.matches(child)) {
|
1203
|
+
nodeMultiSet.addNode(child);
|
1204
|
+
}
|
1205
|
+
// don't have to do de-duping because children have parent,
|
1206
|
+
// which are current context.
|
1207
|
+
}
|
1208
|
+
nodeMultiSet.popSeries();
|
1209
|
+
}
|
1210
|
+
}
|
1211
|
+
nodeMultiSet.finalize();
|
1212
|
+
return sortNodeMultiSet(nodeMultiSet);
|
1213
|
+
},
|
1214
|
+
'descendant':
|
1215
|
+
function descenant(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1216
|
+
return descenantHelper(
|
1217
|
+
nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase, false);
|
1218
|
+
},
|
1219
|
+
'descendant-or-self':
|
1220
|
+
function descenantOrSelf(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1221
|
+
return descenantHelper(
|
1222
|
+
nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase, true);
|
1223
|
+
},
|
1224
|
+
'following':
|
1225
|
+
function following(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1226
|
+
return followingHelper(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase);
|
1227
|
+
},
|
1228
|
+
'following-sibling':
|
1229
|
+
function followingSibling(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1230
|
+
return followingSiblingHelper(
|
1231
|
+
nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase,
|
1232
|
+
Array.prototype.shift, function() {return this[0];},
|
1233
|
+
function(node) {return node.nextSibling;});
|
1234
|
+
},
|
1235
|
+
'namespace':
|
1236
|
+
function namespace(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1237
|
+
// TODO
|
1238
|
+
},
|
1239
|
+
'parent':
|
1240
|
+
function parent(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1241
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
1242
|
+
var nodes = [], pos = [];
|
1243
|
+
for (var i = 0; i < nodeList.length; ++i) {
|
1244
|
+
var parent = nodeList[i].parentNode || nodeList[i].ownerElement;
|
1245
|
+
if (null == parent)
|
1246
|
+
continue;
|
1247
|
+
if (!matcher.matches(parent))
|
1248
|
+
continue;
|
1249
|
+
if (nodes.length > 0 && parent === nodes[nodes.length-1])
|
1250
|
+
continue;
|
1251
|
+
nodes.push(parent);
|
1252
|
+
pos.push([1]);
|
1253
|
+
}
|
1254
|
+
return {nodes:nodes, pos:pos, lasts:pos};
|
1255
|
+
},
|
1256
|
+
'preceding':
|
1257
|
+
function preceding(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1258
|
+
return precedingHelper(
|
1259
|
+
nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase);
|
1260
|
+
},
|
1261
|
+
'preceding-sibling':
|
1262
|
+
function precedingSibling(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1263
|
+
return followingSiblingHelper(
|
1264
|
+
nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase,
|
1265
|
+
Array.prototype.pop, function() {return this[this.length-1];},
|
1266
|
+
function(node) {return node.previousSibling},
|
1267
|
+
false, true);
|
1268
|
+
},
|
1269
|
+
'self':
|
1270
|
+
function self(nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase) {
|
1271
|
+
var nodes = [], pos = [];
|
1272
|
+
var matcher = new NodeMatcher(nodeTypeNum, nodeName, shouldLowerCase);
|
1273
|
+
for (var i = 0; i < nodeList.length; ++i) {
|
1274
|
+
if (matcher.matches(nodeList[i])) {
|
1275
|
+
nodes.push(nodeList[i]);
|
1276
|
+
pos.push([1]);
|
1277
|
+
}
|
1278
|
+
}
|
1279
|
+
return {nodes: nodes, pos: pos, lasts: pos}
|
1280
|
+
}
|
1281
|
+
};
|
1282
|
+
|
1283
|
+
/***************************************************************************
|
1284
|
+
* Evaluation: functions *
|
1285
|
+
***************************************************************************/
|
1286
|
+
var fn = {
|
1287
|
+
'number': function number(optObject) {
|
1288
|
+
if ('number' === typeof optObject)
|
1289
|
+
return optObject;
|
1290
|
+
if ('string' === typeof optObject)
|
1291
|
+
return parseFloat(optObject); // note: parseFloat(' ') -> NaN, unlike +' ' -> 0.
|
1292
|
+
if ('boolean' === typeof optObject)
|
1293
|
+
return +optObject;
|
1294
|
+
return fn.number(fn.string.call(this, optObject)); // for node-sets
|
1295
|
+
},
|
1296
|
+
'string': function string(optObject) {
|
1297
|
+
if (null == optObject)
|
1298
|
+
return fn.string(this);
|
1299
|
+
if ('string' === typeof optObject || 'boolean' === typeof optObject ||
|
1300
|
+
'number' === typeof optObject)
|
1301
|
+
return '' + optObject;
|
1302
|
+
if (0 == optObject.nodes.length) return '';
|
1303
|
+
if (null != optObject.nodes[0].textContent)
|
1304
|
+
return optObject.nodes[0].textContent;
|
1305
|
+
return optObject.nodes[0].nodeValue;
|
1306
|
+
},
|
1307
|
+
'boolean': function booleanVal(x) {
|
1308
|
+
return 'object' === typeof x ? x.nodes.length > 0 : !!x;
|
1309
|
+
},
|
1310
|
+
'last': function last() {
|
1311
|
+
console.assert(Array.isArray(this.pos));
|
1312
|
+
console.assert(Array.isArray(this.lasts));
|
1313
|
+
console.assert(1 === this.pos.length);
|
1314
|
+
console.assert(1 === this.lasts.length);
|
1315
|
+
console.assert(1 === this.lasts[0].length);
|
1316
|
+
return this.lasts[0][0];
|
1317
|
+
},
|
1318
|
+
'position': function position() {
|
1319
|
+
console.assert(Array.isArray(this.pos));
|
1320
|
+
console.assert(Array.isArray(this.lasts));
|
1321
|
+
console.assert(1 === this.pos.length);
|
1322
|
+
console.assert(1 === this.lasts.length);
|
1323
|
+
console.assert(1 === this.pos[0].length);
|
1324
|
+
return this.pos[0][0];
|
1325
|
+
},
|
1326
|
+
'count': function count(nodeSet) {
|
1327
|
+
if ('object' !== typeof nodeSet)
|
1328
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
1329
|
+
'Position ' + stream.position() +
|
1330
|
+
': Function count(node-set) ' +
|
1331
|
+
'got wrong argument type: ' + nodeSet);
|
1332
|
+
return nodeSet.nodes.length;
|
1333
|
+
},
|
1334
|
+
'id': function id(object) {
|
1335
|
+
var r = {nodes: []};
|
1336
|
+
var doc = this.nodes[0].ownerDocument || this.nodes[0];
|
1337
|
+
console.assert(doc);
|
1338
|
+
var ids;
|
1339
|
+
if ('object' === typeof object) {
|
1340
|
+
// for node-sets, map id over each node value.
|
1341
|
+
ids = [];
|
1342
|
+
for (var i = 0; i < object.nodes.length; ++i) {
|
1343
|
+
var idNode = object.nodes[i];
|
1344
|
+
var idsString = fn.string({nodes:[idNode]});
|
1345
|
+
var a = idsString.split(/[ \t\r\n]+/g);
|
1346
|
+
Array.prototype.push.apply(ids, a);
|
1347
|
+
}
|
1348
|
+
} else {
|
1349
|
+
var idsString = fn.string(object);
|
1350
|
+
var a = idsString.split(/[ \t\r\n]+/g);
|
1351
|
+
ids = a;
|
1352
|
+
}
|
1353
|
+
for (var i = 0; i < ids.length; ++i) {
|
1354
|
+
var id = ids[i];
|
1355
|
+
if (0 === id.length)
|
1356
|
+
continue;
|
1357
|
+
var node = doc.getElementById(id);
|
1358
|
+
if (null != node)
|
1359
|
+
r.nodes.push(node);
|
1360
|
+
}
|
1361
|
+
r.nodes = sortUniqDocumentOrder(r.nodes);
|
1362
|
+
return r;
|
1363
|
+
},
|
1364
|
+
'local-name': function(nodeSet) {
|
1365
|
+
if (null == nodeSet)
|
1366
|
+
return fn.name(this);
|
1367
|
+
if (null == nodeSet.nodes) {
|
1368
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
1369
|
+
'argument to name() must be a node-set. got ' + nodeSet);
|
1370
|
+
}
|
1371
|
+
// TODO: namespaced version
|
1372
|
+
return nodeSet.nodes[0].localName;
|
1373
|
+
},
|
1374
|
+
'namespace-uri': function(nodeSet) {
|
1375
|
+
// TODO
|
1376
|
+
throw new Error('not implemented yet');
|
1377
|
+
},
|
1378
|
+
'name': function(nodeSet) {
|
1379
|
+
if (null == nodeSet)
|
1380
|
+
return fn.name(this);
|
1381
|
+
if (null == nodeSet.nodes) {
|
1382
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
1383
|
+
'argument to name() must be a node-set. got ' + nodeSet);
|
1384
|
+
}
|
1385
|
+
return nodeSet.nodes[0].name;
|
1386
|
+
},
|
1387
|
+
'concat': function concat(x) {
|
1388
|
+
var l = [];
|
1389
|
+
for (var i = 0; i < arguments.length; ++i) {
|
1390
|
+
l.push(fn.string(arguments[i]));
|
1391
|
+
}
|
1392
|
+
return l.join('');
|
1393
|
+
},
|
1394
|
+
'starts-with': function startsWith(a, b) {
|
1395
|
+
var as = fn.string(a), bs = fn.string(b);
|
1396
|
+
return as.substr(0, bs.length) === bs;
|
1397
|
+
},
|
1398
|
+
'contains': function contains(a, b) {
|
1399
|
+
var as = fn.string(a), bs = fn.string(b);
|
1400
|
+
var i = as.indexOf(bs);
|
1401
|
+
if (-1 === i) return false;
|
1402
|
+
return true;
|
1403
|
+
},
|
1404
|
+
'substring-before': function substringBefore(a, b) {
|
1405
|
+
var as = fn.string(a), bs = fn.string(b);
|
1406
|
+
var i = as.indexOf(bs);
|
1407
|
+
if (-1 === i) return '';
|
1408
|
+
return as.substr(0, i);
|
1409
|
+
},
|
1410
|
+
'substring-after': function substringBefore(a, b) {
|
1411
|
+
var as = fn.string(a), bs = fn.string(b);
|
1412
|
+
var i = as.indexOf(bs);
|
1413
|
+
if (-1 === i) return '';
|
1414
|
+
return as.substr(i + bs.length);
|
1415
|
+
},
|
1416
|
+
'substring': function substring(string, start, optEnd) {
|
1417
|
+
if (null == string || null == start) {
|
1418
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
1419
|
+
'Must be at least 2 arguments to string()');
|
1420
|
+
}
|
1421
|
+
var sString = fn.string(string),
|
1422
|
+
iStart = fn.round(start),
|
1423
|
+
iEnd = optEnd == null ? null : fn.round(optEnd);
|
1424
|
+
// Note that xpath string positions user 1-based index
|
1425
|
+
if (iEnd == null)
|
1426
|
+
return sString.substr(iStart - 1);
|
1427
|
+
else
|
1428
|
+
return sString.substr(iStart - 1, iEnd);
|
1429
|
+
},
|
1430
|
+
'string-length': function stringLength(optString) {
|
1431
|
+
return fn.string.call(this, optString).length;
|
1432
|
+
},
|
1433
|
+
'normalize-space': function normalizeSpace(optString) {
|
1434
|
+
var s = fn.string.call(this, optString);
|
1435
|
+
return s.replace(/[ \t\r\n]+/g, ' ').replace(/^ | $/g, '');
|
1436
|
+
},
|
1437
|
+
'translate': function translate(string, from, to) {
|
1438
|
+
var sString = fn.string.call(this, string),
|
1439
|
+
sFrom = fn.string(from),
|
1440
|
+
sTo = fn.string(to);
|
1441
|
+
var eachCharRe = [];
|
1442
|
+
var map = {};
|
1443
|
+
for (var i = 0; i < sFrom.length; ++i) {
|
1444
|
+
var c = sFrom.charAt(i);
|
1445
|
+
map[c] = sTo.charAt(i); // returns '' if beyond length of sTo.
|
1446
|
+
// copied from goog.string.regExpEscape in the Closure library.
|
1447
|
+
eachCharRe.push(
|
1448
|
+
c.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1').
|
1449
|
+
replace(/\x08/g, '\\x08'));
|
1450
|
+
}
|
1451
|
+
var re = new RegExp(eachCharRe.join('|'), 'g');
|
1452
|
+
return sString.replace(re, function(c) {return map[c];});
|
1453
|
+
},
|
1454
|
+
/// Boolean functions
|
1455
|
+
'not': function not(x) {
|
1456
|
+
var bx = fn['boolean'](x);
|
1457
|
+
return !bx;
|
1458
|
+
},
|
1459
|
+
'true': function trueVal() { return true; },
|
1460
|
+
'false': function falseVal() { return false; },
|
1461
|
+
// TODO
|
1462
|
+
'lang': function lang(string) { throw new Error('Not implemented');},
|
1463
|
+
'sum': function sum(optNodeSet) {
|
1464
|
+
if (null == optNodeSet) return fn.sum(this);
|
1465
|
+
// for node-sets, map id over each node value.
|
1466
|
+
var sum = 0;
|
1467
|
+
for (var i = 0; i < optNodeSet.nodes.length; ++i) {
|
1468
|
+
var node = optNodeSet.nodes[i];
|
1469
|
+
var x = fn.number({nodes:[node]});
|
1470
|
+
sum += x;
|
1471
|
+
}
|
1472
|
+
return sum;
|
1473
|
+
},
|
1474
|
+
'floor': function floor(number) {
|
1475
|
+
return Math.floor(fn.number(number));
|
1476
|
+
},
|
1477
|
+
'ceiling': function ceiling(number) {
|
1478
|
+
return Math.ceil(fn.number(number));
|
1479
|
+
},
|
1480
|
+
'round': function round(number) {
|
1481
|
+
return Math.round(fn.number(number));
|
1482
|
+
}
|
1483
|
+
};
|
1484
|
+
/***************************************************************************
|
1485
|
+
* Evaluation: operators *
|
1486
|
+
***************************************************************************/
|
1487
|
+
var more = {
|
1488
|
+
UnaryMinus: function(x) { return -fn.number(x); },
|
1489
|
+
'+': function(x, y) { return fn.number(x) + fn.number(y); },
|
1490
|
+
'-': function(x, y) { return fn.number(x) - fn.number(y); },
|
1491
|
+
'*': function(x, y) { return fn.number(x) * fn.number(y); },
|
1492
|
+
'div': function(x, y) { return fn.number(x) / fn.number(y); },
|
1493
|
+
'mod': function(x, y) { return fn.number(x) % fn.number(y); },
|
1494
|
+
'<': function(x, y) {
|
1495
|
+
return comparisonHelper(function(x, y) { return fn.number(x) < fn.number(y);}, x, y, true);
|
1496
|
+
},
|
1497
|
+
'<=': function(x, y) {
|
1498
|
+
return comparisonHelper(function(x, y) { return fn.number(x) <= fn.number(y);}, x, y, true);
|
1499
|
+
},
|
1500
|
+
'>': function(x, y) {
|
1501
|
+
return comparisonHelper(function(x, y) { return fn.number(x) > fn.number(y);}, x, y, true);
|
1502
|
+
},
|
1503
|
+
'>=': function(x, y) {
|
1504
|
+
return comparisonHelper(function(x, y) { return fn.number(x) >= fn.number(y);}, x, y, true);
|
1505
|
+
},
|
1506
|
+
'and': function(x, y) { return fn['boolean'](x) && fn['boolean'](y); },
|
1507
|
+
'or': function(x, y) { return fn['boolean'](x) || fn['boolean'](y); },
|
1508
|
+
'|': function(x, y) { return {nodes: mergeNodeLists(x.nodes, y.nodes)}; },
|
1509
|
+
'=': function(x, y) {
|
1510
|
+
// optimization for two node-sets case: avoid n^2 comparisons.
|
1511
|
+
if ('object' === typeof x && 'object' === typeof y) {
|
1512
|
+
var aMap = {};
|
1513
|
+
for (var i = 0; i < x.nodes.length; ++i) {
|
1514
|
+
var s = fn.string({nodes:[x.nodes[i]]});
|
1515
|
+
aMap[s] = true;
|
1516
|
+
}
|
1517
|
+
for (var i = 0; i < y.nodes.length; ++i) {
|
1518
|
+
var s = fn.string({nodes:[y.nodes[i]]});
|
1519
|
+
if (aMap[s]) return true;
|
1520
|
+
}
|
1521
|
+
return false;
|
1522
|
+
} else {
|
1523
|
+
return comparisonHelper(function(x, y) {return x === y;}, x, y);
|
1524
|
+
}
|
1525
|
+
},
|
1526
|
+
'!=': function(x, y) {
|
1527
|
+
// optimization for two node-sets case: avoid n^2 comparisons.
|
1528
|
+
if ('object' === typeof x && 'object' === typeof y) {
|
1529
|
+
if (0 === x.nodes.length || 0 === y.nodes.length) return false;
|
1530
|
+
var aMap = {};
|
1531
|
+
for (var i = 0; i < x.nodes.length; ++i) {
|
1532
|
+
var s = fn.string({nodes:[x.nodes[i]]});
|
1533
|
+
aMap[s] = true;
|
1534
|
+
}
|
1535
|
+
for (var i = 0; i < y.nodes.length; ++i) {
|
1536
|
+
var s = fn.string({nodes:[y.nodes[i]]});
|
1537
|
+
if (!aMap[s]) return true;
|
1538
|
+
}
|
1539
|
+
return false;
|
1540
|
+
} else {
|
1541
|
+
return comparisonHelper(function(x, y) {return x !== y;}, x, y);
|
1542
|
+
}
|
1543
|
+
}
|
1544
|
+
};
|
1545
|
+
var nodeTypes = xpath.nodeTypes = {
|
1546
|
+
'node': 0,
|
1547
|
+
'attribute': 2,
|
1548
|
+
'comment': 8, // this.doc.COMMENT_NODE,
|
1549
|
+
'text': 3, // this.doc.TEXT_NODE,
|
1550
|
+
'processing-instruction': 7, // this.doc.PROCESSING_INSTRUCTION_NODE,
|
1551
|
+
'element': 1 //this.doc.ELEMENT_NODE
|
1552
|
+
};
|
1553
|
+
/** For debugging and unit tests: returnjs a stringified version of the
|
1554
|
+
* argument. */
|
1555
|
+
var stringifyObject = xpath.stringifyObject = function stringifyObject(ctx) {
|
1556
|
+
var seenKey = 'seen' + Math.floor(Math.random()*1000000000);
|
1557
|
+
return JSON.stringify(helper(ctx));
|
1558
|
+
|
1559
|
+
function helper(ctx) {
|
1560
|
+
if (Array.isArray(ctx)) {
|
1561
|
+
return ctx.map(function(x) {return helper(x);});
|
1562
|
+
}
|
1563
|
+
if ('object' !== typeof ctx) return ctx;
|
1564
|
+
if (null == ctx) return ctx;
|
1565
|
+
// if (ctx.toString) return ctx.toString();
|
1566
|
+
if (null != ctx.outerHTML) return ctx.outerHTML;
|
1567
|
+
if (null != ctx.nodeValue) return ctx.nodeName + '=' + ctx.nodeValue;
|
1568
|
+
if (ctx[seenKey]) return '[circular]';
|
1569
|
+
ctx[seenKey] = true;
|
1570
|
+
var nicer = {};
|
1571
|
+
for (var key in ctx) {
|
1572
|
+
if (seenKey === key)
|
1573
|
+
continue;
|
1574
|
+
try {
|
1575
|
+
nicer[key] = helper(ctx[key]);
|
1576
|
+
} catch (e) {
|
1577
|
+
nicer[key] = '[exception: ' + e.message + ']';
|
1578
|
+
}
|
1579
|
+
}
|
1580
|
+
delete ctx[seenKey];
|
1581
|
+
return nicer;
|
1582
|
+
}
|
1583
|
+
}
|
1584
|
+
var Evaluator = xpath.Evaluator = function Evaluator(doc) {
|
1585
|
+
this.doc = doc;
|
1586
|
+
}
|
1587
|
+
Evaluator.prototype = {
|
1588
|
+
val: function val(ast, ctx) {
|
1589
|
+
console.assert(ctx.nodes);
|
1590
|
+
|
1591
|
+
if ('number' === typeof ast || 'string' === typeof ast) return ast;
|
1592
|
+
if (more[ast[0]]) {
|
1593
|
+
var evaluatedParams = [];
|
1594
|
+
for (var i = 1; i < ast.length; ++i) {
|
1595
|
+
evaluatedParams.push(this.val(ast[i], ctx));
|
1596
|
+
}
|
1597
|
+
var r = more[ast[0]].apply(ctx, evaluatedParams);
|
1598
|
+
return r;
|
1599
|
+
}
|
1600
|
+
switch (ast[0]) {
|
1601
|
+
case 'Root': return {nodes: [this.doc]};
|
1602
|
+
case 'FunctionCall':
|
1603
|
+
var functionName = ast[1], functionParams = ast[2];
|
1604
|
+
if (null == fn[functionName])
|
1605
|
+
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,
|
1606
|
+
'Unknown function: ' + functionName);
|
1607
|
+
var evaluatedParams = [];
|
1608
|
+
for (var i = 0; i < functionParams.length; ++i) {
|
1609
|
+
evaluatedParams.push(this.val(functionParams[i], ctx));
|
1610
|
+
}
|
1611
|
+
var r = fn[functionName].apply(ctx, evaluatedParams);
|
1612
|
+
return r;
|
1613
|
+
case 'Predicate':
|
1614
|
+
var lhs = this.val(ast[1], ctx);
|
1615
|
+
var ret = {nodes: []};
|
1616
|
+
var contexts = eachContext(lhs);
|
1617
|
+
for (var i = 0; i < contexts.length; ++i) {
|
1618
|
+
var singleNodeSet = contexts[i];
|
1619
|
+
var rhs = this.val(ast[2], singleNodeSet);
|
1620
|
+
var success;
|
1621
|
+
if ('number' === typeof rhs) {
|
1622
|
+
success = rhs === singleNodeSet.pos[0][0];
|
1623
|
+
} else {
|
1624
|
+
success = fn['boolean'](rhs);
|
1625
|
+
}
|
1626
|
+
if (success) {
|
1627
|
+
var node = singleNodeSet.nodes[0];
|
1628
|
+
ret.nodes.push(node);
|
1629
|
+
// skip over all the rest of the same node.
|
1630
|
+
while (i+1 < contexts.length && node === contexts[i+1].nodes[0]) {
|
1631
|
+
i++;
|
1632
|
+
}
|
1633
|
+
}
|
1634
|
+
}
|
1635
|
+
return ret;
|
1636
|
+
case 'PathExpr':
|
1637
|
+
// turn the path into an expressoin; i.e., remove the position
|
1638
|
+
// information of the last axis.
|
1639
|
+
var x = this.val(ast[1], ctx);
|
1640
|
+
// Make the nodeset a forward-direction-only one.
|
1641
|
+
if (x.finalize) { // it is a NodeMultiSet
|
1642
|
+
return {nodes: x.nodes};
|
1643
|
+
} else {
|
1644
|
+
return x;
|
1645
|
+
}
|
1646
|
+
case '/':
|
1647
|
+
// TODO: don't generate '/' nodes, just Axis nodes.
|
1648
|
+
var lhs = this.val(ast[1], ctx);
|
1649
|
+
console.assert(null != lhs);
|
1650
|
+
var r = this.val(ast[2], lhs);
|
1651
|
+
console.assert(null != r);
|
1652
|
+
return r;
|
1653
|
+
case 'Axis':
|
1654
|
+
// All the axis tests from Step. We only get AxisSpecifier NodeTest,
|
1655
|
+
// not the predicate (which is applied later)
|
1656
|
+
var axis = ast[1],
|
1657
|
+
nodeType = ast[2],
|
1658
|
+
nodeTypeNum = nodeTypes[nodeType],
|
1659
|
+
shouldLowerCase = true, // TODO: give option
|
1660
|
+
nodeName = ast[3] && shouldLowerCase ? ast[3].toLowerCase() : ast[3];
|
1661
|
+
nodeName = nodeName === '*' ? null : nodeName;
|
1662
|
+
if ('object' !== typeof ctx) return {nodes:[], pos:[]};
|
1663
|
+
var nodeList = ctx.nodes.slice(); // TODO: is copy needed?
|
1664
|
+
var r = axes[axis](nodeList /*destructive!*/, nodeTypeNum, nodeName, shouldLowerCase);
|
1665
|
+
return r;
|
1666
|
+
}
|
1667
|
+
}
|
1668
|
+
};
|
1669
|
+
var evaluate = xpath.evaluate = function evaluate(expr, doc, context) {
|
1670
|
+
//var astFactory = new AstEvaluatorFactory(doc, context);
|
1671
|
+
var stream = new Stream(expr);
|
1672
|
+
var ast = parse(stream, astFactory);
|
1673
|
+
var val = new Evaluator(doc).val(ast, {nodes: [context]});
|
1674
|
+
return val;
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
/***************************************************************************
|
1678
|
+
* DOM interface *
|
1679
|
+
***************************************************************************/
|
1680
|
+
var XPathException = xpath.XPathException = function XPathException(code, message) {
|
1681
|
+
var e = new Error(message);
|
1682
|
+
e.name = 'XPathException';
|
1683
|
+
e.code = code;
|
1684
|
+
return e;
|
1685
|
+
}
|
1686
|
+
XPathException.INVALID_EXPRESSION_ERR = 51;
|
1687
|
+
XPathException.TYPE_ERR = 52;
|
1688
|
+
|
1689
|
+
|
1690
|
+
var XPathEvaluator = xpath.XPathEvaluator = function XPathEvaluator() {}
|
1691
|
+
XPathEvaluator.prototype = {
|
1692
|
+
createExpression: function(expression, resolver) {
|
1693
|
+
return new XPathExpression(expression, resolver);
|
1694
|
+
},
|
1695
|
+
createNSResolver: function(nodeResolver) {
|
1696
|
+
// TODO
|
1697
|
+
},
|
1698
|
+
evaluate: function evaluate(expression, contextNode, resolver, type, result) {
|
1699
|
+
var expr = new XPathExpression(expression, resolver);
|
1700
|
+
return expr.evaluate(contextNode, type, result);
|
1701
|
+
}
|
1702
|
+
};
|
1703
|
+
|
1704
|
+
|
1705
|
+
var XPathExpression = xpath.XPathExpression = function XPathExpression(expression, resolver, optDoc) {
|
1706
|
+
var stream = new Stream(expression);
|
1707
|
+
this._ast = parse(stream, astFactory);
|
1708
|
+
this._doc = optDoc;
|
1709
|
+
}
|
1710
|
+
XPathExpression.prototype = {
|
1711
|
+
evaluate: function evaluate(contextNode, type, result) {
|
1712
|
+
if (null == contextNode.nodeType)
|
1713
|
+
throw new Error('bad argument (expected context node): ' + contextNode);
|
1714
|
+
var doc = contextNode.ownerDocument || contextNode;
|
1715
|
+
if (null != this._doc && this._doc !== doc) {
|
1716
|
+
throw new core.DOMException(
|
1717
|
+
core.DOMException.WRONG_DOCUMENT_ERR,
|
1718
|
+
'The document must be the same as the context node\'s document.');
|
1719
|
+
}
|
1720
|
+
var evaluator = new Evaluator(doc);
|
1721
|
+
var value = evaluator.val(this._ast, {nodes: [contextNode]});
|
1722
|
+
if (XPathResult.NUMBER_TYPE === type)
|
1723
|
+
value = fn.number(value);
|
1724
|
+
else if (XPathResult.STRING_TYPE === type)
|
1725
|
+
value = fn.string(value);
|
1726
|
+
else if (XPathResult.BOOLEAN_TYPE === type)
|
1727
|
+
value = fn['boolean'](value);
|
1728
|
+
else if (XPathResult.ANY_TYPE !== type &&
|
1729
|
+
XPathResult.UNORDERED_NODE_ITERATOR_TYPE !== type &&
|
1730
|
+
XPathResult.ORDERED_NODE_ITERATOR_TYPE !== type &&
|
1731
|
+
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE !== type &&
|
1732
|
+
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE !== type &&
|
1733
|
+
XPathResult.ANY_UNORDERED_NODE_TYPE !== type &&
|
1734
|
+
XPathResult.FIRST_ORDERED_NODE_TYPE !== type)
|
1735
|
+
throw new core.DOMException(
|
1736
|
+
core.DOMException.NOT_SUPPORTED_ERR,
|
1737
|
+
'You must provide an XPath result type (0=any).');
|
1738
|
+
else if (XPathResult.ANY_TYPE !== type &&
|
1739
|
+
'object' !== typeof value)
|
1740
|
+
throw new XPathException(
|
1741
|
+
XPathException.TYPE_ERR,
|
1742
|
+
'Value should be a node-set: ' + value);
|
1743
|
+
return new XPathResult(doc, value, type);
|
1744
|
+
}
|
1745
|
+
}
|
1746
|
+
|
1747
|
+
var XPathResult = xpath.XPathResult = function XPathResult(doc, value, resultType) {
|
1748
|
+
this._value = value;
|
1749
|
+
this._resultType = resultType;
|
1750
|
+
this._i = 0;
|
1751
|
+
|
1752
|
+
// TODO: we removed mutation events but didn't take care of this. No tests fail, so that's nice, but eventually we
|
1753
|
+
// should fix this, preferably by entirely replacing our XPath implementation.
|
1754
|
+
// this._invalidated = false;
|
1755
|
+
// if (this.resultType === XPathResult.UNORDERED_NODE_ITERATOR_TYPE ||
|
1756
|
+
// this.resultType === XPathResult.ORDERED_NODE_ITERATOR_TYPE) {
|
1757
|
+
// doc.addEventListener('DOMSubtreeModified', invalidate, true);
|
1758
|
+
// var self = this;
|
1759
|
+
// function invalidate() {
|
1760
|
+
// self._invalidated = true;
|
1761
|
+
// doc.removeEventListener('DOMSubtreeModified', invalidate, true);
|
1762
|
+
// }
|
1763
|
+
// }
|
1764
|
+
}
|
1765
|
+
XPathResult.ANY_TYPE = 0;
|
1766
|
+
XPathResult.NUMBER_TYPE = 1;
|
1767
|
+
XPathResult.STRING_TYPE = 2;
|
1768
|
+
XPathResult.BOOLEAN_TYPE = 3;
|
1769
|
+
XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4;
|
1770
|
+
XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5;
|
1771
|
+
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6;
|
1772
|
+
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7;
|
1773
|
+
XPathResult.ANY_UNORDERED_NODE_TYPE = 8;
|
1774
|
+
XPathResult.FIRST_ORDERED_NODE_TYPE = 9;
|
1775
|
+
var proto = {
|
1776
|
+
// XPathResultType
|
1777
|
+
get resultType() {
|
1778
|
+
if (this._resultType) return this._resultType;
|
1779
|
+
switch (typeof this._value) {
|
1780
|
+
case 'number': return XPathResult.NUMBER_TYPE;
|
1781
|
+
case 'string': return XPathResult.STRING_TYPE;
|
1782
|
+
case 'boolean': return XPathResult.BOOLEAN_TYPE;
|
1783
|
+
default: return XPathResult.UNORDERED_NODE_ITERATOR_TYPE;
|
1784
|
+
}
|
1785
|
+
},
|
1786
|
+
get numberValue() {
|
1787
|
+
if (XPathResult.NUMBER_TYPE !== this.resultType)
|
1788
|
+
throw new XPathException(XPathException.TYPE_ERR,
|
1789
|
+
'You should have asked for a NUMBER_TYPE.');
|
1790
|
+
return this._value;
|
1791
|
+
},
|
1792
|
+
get stringValue() {
|
1793
|
+
if (XPathResult.STRING_TYPE !== this.resultType)
|
1794
|
+
throw new XPathException(XPathException.TYPE_ERR,
|
1795
|
+
'You should have asked for a STRING_TYPE.');
|
1796
|
+
return this._value;
|
1797
|
+
},
|
1798
|
+
get booleanValue() {
|
1799
|
+
if (XPathResult.BOOLEAN_TYPE !== this.resultType)
|
1800
|
+
throw new XPathException(XPathException.TYPE_ERR,
|
1801
|
+
'You should have asked for a BOOLEAN_TYPE.');
|
1802
|
+
return this._value;
|
1803
|
+
},
|
1804
|
+
get singleNodeValue() {
|
1805
|
+
if (XPathResult.ANY_UNORDERED_NODE_TYPE !== this.resultType &&
|
1806
|
+
XPathResult.FIRST_ORDERED_NODE_TYPE !== this.resultType)
|
1807
|
+
throw new XPathException(
|
1808
|
+
XPathException.TYPE_ERR,
|
1809
|
+
'You should have asked for a FIRST_ORDERED_NODE_TYPE.');
|
1810
|
+
return this._value.nodes[0] || null;
|
1811
|
+
},
|
1812
|
+
get invalidIteratorState() {
|
1813
|
+
if (XPathResult.UNORDERED_NODE_ITERATOR_TYPE !== this.resultType &&
|
1814
|
+
XPathResult.ORDERED_NODE_ITERATOR_TYPE !== this.resultType)
|
1815
|
+
return false;
|
1816
|
+
return !!this._invalidated;
|
1817
|
+
},
|
1818
|
+
get snapshotLength() {
|
1819
|
+
if (XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE !== this.resultType &&
|
1820
|
+
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE !== this.resultType)
|
1821
|
+
throw new XPathException(
|
1822
|
+
XPathException.TYPE_ERR,
|
1823
|
+
'You should have asked for a ORDERED_NODE_SNAPSHOT_TYPE.');
|
1824
|
+
return this._value.nodes.length;
|
1825
|
+
},
|
1826
|
+
iterateNext: function iterateNext() {
|
1827
|
+
if (XPathResult.UNORDERED_NODE_ITERATOR_TYPE !== this.resultType &&
|
1828
|
+
XPathResult.ORDERED_NODE_ITERATOR_TYPE !== this.resultType)
|
1829
|
+
throw new XPathException(
|
1830
|
+
XPathException.TYPE_ERR,
|
1831
|
+
'You should have asked for a ORDERED_NODE_ITERATOR_TYPE.');
|
1832
|
+
if (this.invalidIteratorState)
|
1833
|
+
throw new core.DOMException(
|
1834
|
+
core.DOMException.INVALID_STATE_ERR,
|
1835
|
+
'The document has been mutated since the result was returned');
|
1836
|
+
return this._value.nodes[this._i++] || null;
|
1837
|
+
},
|
1838
|
+
snapshotItem: function snapshotItem(index) {
|
1839
|
+
if (XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE !== this.resultType &&
|
1840
|
+
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE !== this.resultType)
|
1841
|
+
throw new XPathException(
|
1842
|
+
XPathException.TYPE_ERR,
|
1843
|
+
'You should have asked for a ORDERED_NODE_SNAPSHOT_TYPE.');
|
1844
|
+
return this._value.nodes[index] || null;
|
1845
|
+
}
|
1846
|
+
};
|
1847
|
+
// so you can access ANY_TYPE etc. from the instances:
|
1848
|
+
XPathResult.prototype = Object.create(XPathResult,
|
1849
|
+
Object.keys(proto).reduce(function (descriptors, name) {
|
1850
|
+
descriptors[name] = Object.getOwnPropertyDescriptor(proto, name);
|
1851
|
+
return descriptors;
|
1852
|
+
}, {
|
1853
|
+
constructor: {
|
1854
|
+
value: XPathResult,
|
1855
|
+
writable: true,
|
1856
|
+
configurable: true
|
1857
|
+
}
|
1858
|
+
}));
|
1859
|
+
|
1860
|
+
core.XPathException = XPathException;
|
1861
|
+
core.XPathExpression = XPathExpression;
|
1862
|
+
core.XPathResult = XPathResult;
|
1863
|
+
core.XPathEvaluator = XPathEvaluator;
|
1864
|
+
|
1865
|
+
core.Document.prototype.createExpression =
|
1866
|
+
XPathEvaluator.prototype.createExpression;
|
1867
|
+
|
1868
|
+
core.Document.prototype.createNSResolver =
|
1869
|
+
XPathEvaluator.prototype.createNSResolver;
|
1870
|
+
|
1871
|
+
core.Document.prototype.evaluate = XPathEvaluator.prototype.evaluate;
|
1872
|
+
|
1873
|
+
return xpath; // for tests
|
1874
|
+
};
|