How to use read method in pyatom

Best Python code snippet using pyatom_python

SEA3D.js

Source:SEA3D.js Github

copy

Full Screen

...2399 // progress2400 } else if ( xhr.readyState === 4 ) {2401 if ( xhr.status === 200 || xhr.status === 0 ) {2402 // complete2403 file.read( this.response );2404 } else {2405 this.dispatchError( 1001, "Couldn't load [" + url + "] [" + xhr.status + "]" );2406 }2407 }2408 }2409 xhr.send();...

Full Screen

Full Screen

attributes.js

Source:attributes.js Github

copy

Full Screen

1function getProperty(propertyName) {2 return el => el[propertyName];3}4function getAttribute(attributeName) {5 return el => {6 if (el.namespaceURI === '') {7 throw new Error('Not an HTML element.');8 }9 return el.getAttribute(attributeName);10 };11}12function getSVGProperty(propertyName) {13 return el => el[propertyName];14}15function getSVGAttribute(attributeName) {16 return el => {17 if (el.namespaceURI !== 'http://www.w3.org/2000/svg') {18 throw new Error('Not an SVG element.');19 }20 return el.getAttribute(attributeName);21 };22}23const attributes = [24 {name: 'about', read: getAttribute('about')},25 {name: 'aBoUt', read: getAttribute('about')},26 {27 name: 'accent-Height',28 containerTagName: 'svg',29 tagName: 'font-face',30 read: getSVGAttribute('accent-height'),31 },32 {33 name: 'accent-height',34 containerTagName: 'svg',35 tagName: 'font-face',36 read: getSVGAttribute('accent-height'),37 },38 {39 name: 'accentHeight',40 containerTagName: 'svg',41 tagName: 'font-face',42 read: getSVGAttribute('accent-height'),43 },44 {name: 'accept', tagName: 'input'},45 {name: 'accept-charset', tagName: 'form', read: getProperty('acceptCharset')},46 {name: 'accept-Charset', tagName: 'form', read: getProperty('acceptCharset')},47 {name: 'acceptCharset', tagName: 'form'},48 {name: 'accessKey'},49 {50 name: 'accumulate',51 containerTagName: 'svg',52 tagName: 'animate',53 read: getSVGAttribute('accumulate'),54 },55 {name: 'action', tagName: 'form', overrideStringValue: 'https://reactjs.com'},56 {57 name: 'additive',58 containerTagName: 'svg',59 tagName: 'animate',60 read: getSVGAttribute('additive'),61 },62 {63 name: 'alignment-baseline',64 containerTagName: 'svg',65 tagName: 'textPath',66 read: getSVGAttribute('alignment-baseline'),67 },68 {69 name: 'alignmentBaseline',70 containerTagName: 'svg',71 tagName: 'textPath',72 read: getSVGAttribute('alignment-baseline'),73 },74 {75 name: 'allowFullScreen',76 tagName: 'iframe',77 read: getProperty('allowFullscreen'),78 },79 {80 name: 'allowfullscreen',81 tagName: 'iframe',82 read: getProperty('allowFullscreen'),83 },84 {name: 'allowFullscreen', tagName: 'iframe'},85 {86 name: 'allowReorder',87 containerTagName: 'svg',88 tagName: 'switch',89 read: getSVGAttribute('allowReorder'),90 },91 {92 name: 'alphabetic',93 containerTagName: 'svg',94 tagName: 'font-face',95 read: getSVGAttribute('alphabetic'),96 },97 {name: 'alt', tagName: 'img'},98 {99 name: 'amplitude',100 containerTagName: 'svg',101 tagName: 'feFuncA',102 read: getSVGProperty('amplitude'),103 },104 {105 name: 'arabic-form',106 containerTagName: 'svg',107 tagName: 'glyph',108 read: getSVGAttribute('arabic-form'),109 },110 {111 name: 'arabicForm',112 containerTagName: 'svg',113 tagName: 'glyph',114 read: getSVGAttribute('arabic-form'),115 },116 {name: 'aria', read: getAttribute('aria')},117 {name: 'aria-', read: getAttribute('aria-')},118 {name: 'aria-invalidattribute', read: getAttribute('aria-invalidattribute')},119 {name: 'as', tagName: 'link'},120 {121 name: 'ascent',122 containerTagName: 'svg',123 tagName: 'font-face',124 read: getSVGAttribute('ascent'),125 },126 {name: 'async', tagName: 'script'},127 {128 name: 'attributeName',129 containerTagName: 'svg',130 tagName: 'animate',131 read: getSVGAttribute('attributeName'),132 },133 {134 name: 'attributeType',135 containerTagName: 'svg',136 tagName: 'animate',137 read: getSVGAttribute('attributeType'),138 },139 {140 name: 'autoCapitalize',141 tagName: 'input',142 read: getProperty('autocapitalize'),143 overrideStringValue: 'words',144 },145 {146 name: 'autoComplete',147 tagName: 'input',148 overrideStringValue: 'email',149 read: getProperty('autocomplete'),150 },151 {152 name: 'autoCorrect',153 tagName: 'input',154 overrideStringValue: 'off',155 read: getAttribute('autocorrect'),156 },157 {name: 'autoPlay', tagName: 'video', read: getProperty('autoplay')},158 {159 name: 'autoReverse',160 containerTagName: 'svg',161 tagName: 'animate',162 read: getSVGAttribute('autoreverse'),163 },164 {name: 'autoSave', tagName: 'input', read: getAttribute('autosave')},165 {166 name: 'azimuth',167 containerTagName: 'svg',168 tagName: 'feDistantLight',169 read: getSVGProperty('azimuth'),170 },171 {172 name: 'baseFrequency',173 containerTagName: 'svg',174 tagName: 'feTurbulence',175 read: getSVGAttribute('baseFrequency'),176 },177 {178 name: 'baseline-shift',179 containerTagName: 'svg',180 tagName: 'textPath',181 read: getSVGAttribute('baseline-shift'),182 },183 {184 name: 'baselineShift',185 containerTagName: 'svg',186 tagName: 'textPath',187 read: getSVGAttribute('baseline-shift'),188 },189 {name: 'baseProfile', tagName: 'svg', read: getSVGAttribute('baseProfile')},190 {191 name: 'bbox',192 containerTagName: 'svg',193 tagName: 'font-face',194 read: getSVGAttribute('bbox'),195 },196 {197 name: 'begin',198 containerTagName: 'svg',199 tagName: 'animate',200 read: getSVGAttribute('begin'),201 },202 {203 name: 'bias',204 containerTagName: 'svg',205 tagName: 'feConvolveMatrix',206 read: getSVGProperty('bias'),207 },208 {209 name: 'by',210 containerTagName: 'svg',211 tagName: 'animate',212 read: getSVGAttribute('by'),213 },214 {215 name: 'calcMode',216 containerTagName: 'svg',217 tagName: 'animate',218 overrideStringValue: 'discrete',219 read: getSVGAttribute('calcMode'),220 },221 {222 name: 'cap-height',223 containerTagName: 'svg',224 tagName: 'font-face',225 read: getSVGAttribute('cap-height'),226 },227 {228 name: 'capHeight',229 containerTagName: 'svg',230 tagName: 'font-face',231 read: getSVGAttribute('cap-height'),232 },233 {234 name: 'capture',235 tagName: 'input',236 overrideStringValue: 'environment',237 read: getAttribute('capture'),238 },239 {name: 'cellPadding', tagName: 'table'},240 {name: 'cellSpacing', tagName: 'table'},241 {242 name: 'challenge',243 tagName: 'keygen',244 read: getAttribute('challenge'), // The property is not supported in Chrome.245 },246 {name: 'charSet', tagName: 'script', read: getProperty('charset')},247 {name: 'checked', tagName: 'input', extraProps: {onChange() {}}},248 {name: 'Checked', tagName: 'input', read: getAttribute('Checked')},249 {name: 'Children', read: getAttribute('children')},250 {name: 'children'},251 {252 name: 'cite',253 tagName: 'blockquote',254 overrideStringValue: 'http://reactjs.com/',255 },256 {name: 'class', read: getAttribute('class')},257 {name: 'classID', tagName: 'object', read: getAttribute('classid')},258 {name: 'className'},259 {name: 'clip', tagName: 'svg', read: getAttribute('clip')},260 {261 name: 'clip-path',262 containerTagName: 'svg',263 tagName: 'path',264 read: getSVGAttribute('clip-path'),265 },266 {267 name: 'clipPath',268 containerTagName: 'svg',269 tagName: 'path',270 read: getSVGAttribute('clip-path'),271 },272 {273 name: 'clipPathUnits',274 containerTagName: 'svg',275 tagName: 'clipPath',276 overrideStringValue: 'objectBoundingBox',277 read: getSVGProperty('clipPathUnits'),278 },279 {280 name: 'clip-rule',281 containerTagName: 'svg',282 tagName: 'path',283 read: getSVGAttribute('clip-rule'),284 },285 {286 name: 'clipRule',287 containerTagName: 'svg',288 tagName: 'path',289 read: getSVGAttribute('clip-rule'),290 },291 {292 name: 'color',293 containerTagName: 'svg',294 tagName: 'text',295 read: getSVGAttribute('color'),296 },297 {298 name: 'color-interpolation',299 containerTagName: 'svg',300 tagName: 'animate',301 overrideStringValue: 'sRGB',302 read: getSVGAttribute('color-interpolation'),303 },304 {305 name: 'colorInterpolation',306 containerTagName: 'svg',307 tagName: 'animate',308 overrideStringValue: 'sRGB',309 read: getSVGAttribute('color-interpolation'),310 },311 {312 name: 'color-interpolation-filters',313 containerTagName: 'svg',314 tagName: 'feComposite',315 overrideStringValue: 'sRGB',316 read: getSVGAttribute('color-interpolation-filters'),317 },318 {319 name: 'colorInterpolationFilters',320 containerTagName: 'svg',321 tagName: 'feComposite',322 overrideStringValue: 'sRGB',323 read: getSVGAttribute('color-interpolation-filters'),324 },325 {326 name: 'color-profile',327 containerTagName: 'svg',328 tagName: 'image',329 overrideStringValue: 'sRGB',330 read: getSVGAttribute('color-profile'),331 },332 {333 name: 'colorProfile',334 containerTagName: 'svg',335 tagName: 'image',336 overrideStringValue: 'sRGB',337 read: getSVGAttribute('color-profile'),338 },339 {340 name: 'color-rendering',341 containerTagName: 'svg',342 tagName: 'animate',343 overrideStringValue: 'optimizeSpeed',344 read: getSVGAttribute('color-rendering'),345 },346 {347 name: 'colorRendering',348 containerTagName: 'svg',349 tagName: 'animate',350 overrideStringValue: 'optimizeSpeed',351 read: getSVGAttribute('color-rendering'),352 },353 {name: 'cols', tagName: 'textarea'},354 {name: 'colSpan', containerTagName: 'tr', tagName: 'td'},355 {name: 'content', tagName: 'meta'},356 {name: 'contentEditable'},357 {358 name: 'contentScriptType',359 tagName: 'svg',360 read: getSVGAttribute('contentScriptType'),361 },362 {363 name: 'contentStyleType',364 tagName: 'svg',365 read: getSVGAttribute('contentStyleType'),366 },367 {name: 'contextMenu', read: getAttribute('contextmenu')}, // TODO: Read the property by rendering a menu with the ID.368 {name: 'controls', tagName: 'video'},369 {name: 'coords', tagName: 'a'},370 {name: 'crossOrigin', tagName: 'script'},371 {name: 'cursor', tag: 'svg', read: getAttribute('cursor')},372 {373 name: 'cx',374 containerTagName: 'svg',375 tagName: 'circle',376 overrideStringValue: '10px',377 read: getSVGProperty('cx'),378 },379 {380 name: 'cy',381 containerTagName: 'svg',382 tagName: 'circle',383 overrideStringValue: '10%',384 read: getSVGProperty('cy'),385 },386 {387 name: 'd',388 containerTagName: 'svg',389 tagName: 'path',390 read: getSVGAttribute('d'),391 },392 {393 name: 'dangerouslySetInnerHTML',394 read: getAttribute('dangerouslySetInnerHTML'),395 },396 {397 name: 'DangerouslySetInnerHTML',398 read: getAttribute('DangerouslySetInnerHTML'),399 },400 {name: 'data', read: getAttribute('data')},401 {name: 'data-', read: getAttribute('data-')},402 {name: 'data-unknownattribute', read: getAttribute('data-unknownattribute')},403 {name: 'datatype', read: getAttribute('datatype')},404 {405 name: 'dateTime',406 tagName: 'time',407 overrideStringValue: '2001-05-15T19:00',408 read: getAttribute('datetime'),409 },410 {411 name: 'decelerate',412 containerTagName: 'svg',413 tagName: 'animate',414 read: getSVGAttribute('decelerate'),415 },416 {name: 'default', tagName: 'track'},417 {418 name: 'defaultchecked',419 tagName: 'input',420 read: getAttribute('defaultchecked'),421 },422 {name: 'defaultChecked', tagName: 'input'},423 {name: 'defaultValue', tagName: 'input'},424 {name: 'defaultValuE', tagName: 'input', read: getAttribute('defaultValuE')},425 {name: 'defer', tagName: 'script'},426 {427 name: 'descent',428 containerTagName: 'svg',429 tagName: 'font-face',430 read: getSVGAttribute('descent'),431 },432 {433 name: 'diffuseConstant',434 containerTagName: 'svg',435 tagName: 'feDiffuseLighting',436 read: getSVGProperty('diffuseConstant'),437 },438 {name: 'dir', overrideStringValue: 'rtl'},439 {440 name: 'direction',441 containerTagName: 'svg',442 tagName: 'text',443 overrideStringValue: 'rtl',444 read: getSVGAttribute('direction'),445 },446 {name: 'disabled', tagName: 'input'},447 {448 name: 'display',449 tagName: 'svg',450 overrideStringValue: 'list-item',451 read: getAttribute('display'),452 },453 {454 name: 'divisor',455 containerTagName: 'svg',456 tagName: 'feConvolveMatrix',457 read: getSVGProperty('divisor'),458 },459 {460 name: 'dominant-baseline',461 containerTagName: 'svg',462 tagName: 'text',463 read: getSVGAttribute('dominant-baseline'),464 },465 {466 name: 'dominantBaseline',467 containerTagName: 'svg',468 tagName: 'text',469 read: getSVGAttribute('dominant-baseline'),470 },471 {name: 'download', tagName: 'a'},472 {name: 'dOwNlOaD', tagName: 'a', read: getAttribute('dOwNlOaD')},473 {name: 'draggable'},474 {475 name: 'dur',476 containerTagName: 'svg',477 tagName: 'animate',478 read: getSVGAttribute('dur'),479 },480 {481 name: 'dx',482 containerTagName: 'svg',483 tagName: 'text',484 overrideStringValue: '1pt 2px 3em',485 read: getSVGProperty('dx'),486 },487 {488 name: 'dX',489 containerTagName: 'svg',490 tagName: 'text',491 overrideStringValue: '1pt 2px 3em',492 read: getSVGProperty('dx'),493 },494 {495 name: 'dy',496 containerTagName: 'svg',497 tagName: 'text',498 overrideStringValue: '1 2 3',499 read: getSVGProperty('dy'),500 },501 {502 name: 'dY',503 containerTagName: 'svg',504 tagName: 'text',505 overrideStringValue: '1 2 3',506 read: getSVGProperty('dy'),507 },508 {509 name: 'edgeMode',510 containerTagName: 'svg',511 tagName: 'feConvolveMatrix',512 overrideStringValue: 'wrap',513 read: getSVGProperty('edgeMode'),514 },515 {516 name: 'elevation',517 containerTagName: 'svg',518 tagName: 'feDistantLight',519 read: getSVGProperty('elevation'),520 },521 {522 name: 'enable-background',523 containerTagName: 'svg',524 tagName: 'path',525 read: getSVGAttribute('enable-background'),526 },527 {528 name: 'enableBackground',529 containerTagName: 'svg',530 tagName: 'path',531 read: getSVGAttribute('enable-background'),532 },533 {534 name: 'encType',535 tagName: 'form',536 overrideStringValue: 'text/plain',537 read: getProperty('enctype'),538 },539 {540 name: 'end',541 containerTagName: 'svg',542 tagName: 'animate',543 read: getSVGAttribute('end'),544 },545 {546 name: 'exponent',547 read: getSVGProperty('exponent'),548 containerTagName: 'svg',549 tagName: 'feFuncA',550 },551 {552 name: 'externalResourcesRequired',553 containerTagName: 'svg',554 tagName: 'path',555 read: getSVGAttribute('externalResourcesRequired'),556 },557 {558 name: 'fill',559 containerTagName: 'svg',560 tagName: 'path',561 read: getSVGAttribute('fill'),562 },563 {564 name: 'fillOpacity',565 containerTagName: 'svg',566 tagName: 'circle',567 read: getSVGAttribute('fill-opacity'),568 },569 {570 name: 'fill-opacity',571 containerTagName: 'svg',572 tagName: 'circle',573 read: getSVGAttribute('fill-opacity'),574 },575 {576 name: 'fillRule',577 containerTagName: 'svg',578 tagName: 'circle',579 read: getSVGAttribute('fill-rule'),580 },581 {582 name: 'fill-rule',583 containerTagName: 'svg',584 tagName: 'circle',585 read: getSVGAttribute('fill-rule'),586 },587 {588 name: 'filter',589 containerTagName: 'svg',590 tagName: 'g',591 read: getSVGAttribute('filter'),592 },593 {594 name: 'filterRes',595 containerTagName: 'svg',596 tagName: 'filter',597 read: getSVGAttribute('filterRes'),598 },599 {600 name: 'filterUnits',601 containerTagName: 'svg',602 tagName: 'filter',603 overrideStringValue: 'userSpaceOnUse',604 read: getSVGProperty('filterUnits'),605 },606 {607 name: 'flood-color',608 containerTagName: 'svg',609 tagName: 'feflood',610 overrideStringValue: 'currentColor',611 read: getSVGAttribute('flood-color'),612 },613 {614 name: 'floodColor',615 containerTagName: 'svg',616 tagName: 'feflood',617 overrideStringValue: 'currentColor',618 read: getSVGAttribute('flood-color'),619 },620 {621 name: 'flood-opacity',622 containerTagName: 'svg',623 tagName: 'feflood',624 overrideStringValue: 'inherit',625 read: getSVGAttribute('flood-opacity'),626 },627 {628 name: 'floodOpacity',629 containerTagName: 'svg',630 tagName: 'feflood',631 overrideStringValue: 'inherit',632 read: getSVGAttribute('flood-opacity'),633 },634 {name: 'focusable', tagName: 'p', read: getAttribute('focusable')},635 {636 name: 'font-family',637 read: getSVGAttribute('font-family'),638 containerTagName: 'svg',639 tagName: 'font-face',640 },641 {642 name: 'font-size',643 read: getSVGAttribute('font-size'),644 containerTagName: 'svg',645 tagName: 'font-face',646 },647 {648 name: 'font-size-adjust',649 containerTagName: 'svg',650 tagName: 'text',651 read: getSVGAttribute('font-size-adjust'),652 },653 {654 name: 'font-stretch',655 read: getSVGAttribute('font-stretch'),656 containerTagName: 'svg',657 tagName: 'font-face',658 },659 {660 name: 'font-style',661 read: getSVGAttribute('font-style'),662 containerTagName: 'svg',663 tagName: 'font-face',664 },665 {666 name: 'font-variant',667 read: getSVGAttribute('font-variant'),668 containerTagName: 'svg',669 tagName: 'font-face',670 },671 {672 name: 'font-weight',673 read: getSVGAttribute('font-weight'),674 containerTagName: 'svg',675 tagName: 'font-face',676 },677 {678 name: 'fontFamily',679 read: getSVGAttribute('font-family'),680 containerTagName: 'svg',681 tagName: 'font-face',682 },683 {684 name: 'fontSize',685 read: getSVGAttribute('font-size'),686 containerTagName: 'svg',687 tagName: 'font-face',688 },689 {690 name: 'fontSizeAdjust',691 containerTagName: 'svg',692 tagName: 'text',693 read: getSVGAttribute('font-size-adjust'),694 },695 {696 name: 'fontStretch',697 read: getSVGAttribute('font-stretch'),698 containerTagName: 'svg',699 tagName: 'font-face',700 },701 {702 name: 'fontStyle',703 read: getSVGAttribute('font-style'),704 containerTagName: 'svg',705 tagName: 'font-face',706 },707 {708 name: 'fontVariant',709 read: getSVGAttribute('font-variant'),710 containerTagName: 'svg',711 tagName: 'font-face',712 },713 {714 name: 'fontWeight',715 read: getSVGAttribute('font-weight'),716 containerTagName: 'svg',717 tagName: 'font-face',718 },719 {name: 'for', tagName: 'label', read: getProperty('htmlFor')},720 {name: 'fOr', tagName: 'label', read: getProperty('htmlFor')},721 {name: 'form', read: getAttribute('form')}, // TODO: Read the property by rendering into a form with i722 {723 name: 'formAction',724 tagName: 'input',725 overrideStringValue: 'https://reactjs.com',726 },727 {728 name: 'format',729 read: getSVGAttribute('format'),730 containerTagName: 'svg',731 tagName: 'altGlyph',732 },733 {name: 'formEncType', tagName: 'input', read: getProperty('formEnctype')},734 {name: 'formMethod', tagName: 'input', overrideStringValue: 'POST'},735 {name: 'formNoValidate', tagName: 'input'},736 {name: 'formTarget', tagName: 'input'},737 {name: 'frameBorder', tagName: 'iframe'},738 {739 name: 'from',740 read: getSVGAttribute('from'),741 containerTagName: 'svg',742 tagName: 'animate',743 },744 {745 name: 'fx',746 read: getSVGProperty('fx'),747 containerTagName: 'svg',748 overrideStringValue: '10px',749 tagName: 'radialGradient',750 },751 {752 name: 'fX',753 containerTagName: 'svg',754 tagName: 'radialGradient',755 overrideStringValue: '10px',756 read: getSVGProperty('fx'),757 },758 {759 name: 'fY',760 containerTagName: 'svg',761 tagName: 'radialGradient',762 overrideStringValue: '20em',763 read: getSVGProperty('fy'),764 },765 {766 name: 'fy',767 read: getSVGProperty('fy'),768 containerTagName: 'svg',769 overrideStringValue: '20em',770 tagName: 'radialGradient',771 },772 {773 name: 'G1',774 containerTagName: 'svg',775 tagName: 'hkern',776 read: getSVGAttribute('g1'),777 },778 {779 name: 'g1',780 read: getSVGAttribute('g1'),781 containerTagName: 'svg',782 tagName: 'hkern',783 },784 {785 name: 'G2',786 containerTagName: 'svg',787 tagName: 'hkern',788 read: getSVGAttribute('g2'),789 },790 {791 name: 'g2',792 read: getSVGAttribute('g2'),793 containerTagName: 'svg',794 tagName: 'hkern',795 },796 {797 name: 'glyph-name',798 read: getSVGAttribute('glyph-name'),799 containerTagName: 'svg',800 tagName: 'glyph',801 },802 {803 name: 'glyph-orientation-horizontal',804 containerTagName: 'svg',805 tagName: 'text',806 read: getSVGAttribute('glyph-orientation-horizontal'),807 },808 {809 name: 'glyph-orientation-vertical',810 containerTagName: 'svg',811 tagName: 'text',812 read: getSVGAttribute('glyph-orientation-vertical'),813 },814 {815 name: 'glyphName',816 read: getSVGAttribute('glyph-name'),817 containerTagName: 'svg',818 tagName: 'glyph',819 },820 {821 name: 'glyphOrientationHorizontal',822 containerTagName: 'svg',823 tagName: 'text',824 read: getSVGAttribute('glyph-orientation-horizontal'),825 },826 {827 name: 'glyphOrientationVertical',828 containerTagName: 'svg',829 tagName: 'text',830 read: getSVGAttribute('glyph-orientation-vertical'),831 },832 {833 name: 'glyphRef',834 read: getSVGAttribute('glyph-ref'),835 containerTagName: 'svg',836 tagName: 'altGlyph',837 },838 {839 name: 'gradientTransform',840 read: getSVGProperty('gradientTransform'),841 containerTagName: 'svg',842 overrideStringValue:843 'translate(-10,-20) scale(2) rotate(45) translate(5,10)',844 tagName: 'linearGradient',845 },846 {847 name: 'gradientUnits',848 read: getSVGProperty('gradientUnits'),849 containerTagName: 'svg',850 overrideStringValue: 'userSpaceOnUse',851 tagName: 'linearGradient',852 },853 {854 name: 'hanging',855 read: getSVGAttribute('hanging'),856 containerTagName: 'svg',857 tagName: 'font-face',858 },859 // Disabled because it crashes other tests with React 15.860 // TODO: re-enable when we no longer compare to 15.861 // {name: 'hasOwnProperty', read: getAttribute('hasOwnProperty')},862 {name: 'headers', containerTagName: 'tr', tagName: 'td'},863 {name: 'height', tagName: 'img'},864 {865 name: 'height',866 containerTagName: 'svg',867 tagName: 'rect',868 read: getSVGProperty('height'),869 overrideStringValue: '100%',870 },871 {name: 'hidden'},872 {name: 'high', tagName: 'meter'},873 {874 name: 'horiz-adv-x',875 read: getSVGAttribute('horiz-adv-x'),876 containerTagName: 'svg',877 tagName: 'font',878 },879 {880 name: 'horiz-origin-x',881 read: getSVGAttribute('horiz-origin-x'),882 containerTagName: 'svg',883 tagName: 'font',884 },885 {886 name: 'horizAdvX',887 read: getSVGAttribute('horiz-adv-x'),888 containerTagName: 'svg',889 tagName: 'font',890 },891 {892 name: 'horizOriginX',893 read: getSVGAttribute('horiz-origin-x'),894 containerTagName: 'svg',895 tagName: 'font',896 },897 {name: 'href', tagName: 'a', overrideStringValue: 'https://reactjs.com'},898 {name: 'hrefLang', read: getAttribute('hreflang')},899 {name: 'htmlFor', tagName: 'label'},900 {name: 'http-equiv', tagName: 'meta', read: getProperty('httpEquiv')},901 {name: 'httpEquiv', tagName: 'meta'},902 {name: 'icon', tagName: 'command', read: getAttribute('icon')},903 {name: 'id'},904 {name: 'ID', read: getProperty('id')},905 {906 name: 'ideographic',907 read: getSVGAttribute('ideographic'),908 containerTagName: 'svg',909 tagName: 'font-face',910 },911 {912 name: 'image-rendering',913 tagName: 'svg',914 read: getSVGAttribute('image-rendering'),915 },916 {917 name: 'imageRendering',918 tagName: 'svg',919 read: getSVGAttribute('image-rendering'),920 },921 {922 name: 'in',923 read: getSVGAttribute('in'),924 containerTagName: 'svg',925 tagName: 'feBlend',926 },927 {928 name: 'in2',929 read: getSVGProperty('in2'),930 containerTagName: 'svg',931 tagName: 'feBlend',932 },933 {name: 'initialChecked', read: getAttribute('initialchecked')},934 {name: 'initialValue', read: getAttribute('initialvalue')},935 {name: 'inlist', read: getAttribute('inlist')},936 {name: 'inputMode', tagName: 'input', read: getAttribute('inputmode')}, // TODO: Should use property but it's not implemented in Chrome937 {name: 'integrity', tagName: 'script'},938 {939 name: 'intercept',940 read: getSVGProperty('intercept'),941 containerTagName: 'svg',942 tagName: 'feFuncA',943 },944 {945 name: 'is',946 tagName: 'button',947 overrideStringValue: 'x-test-element',948 read: getAttribute('is'), // TODO: This could check if this is an extended custom element but this is a controversial spec.949 },950 {name: 'itemID', read: getAttribute('itemid')},951 {name: 'itemProp', read: getAttribute('itemprop')},952 {name: 'itemRef', read: getAttribute('itemref')},953 {name: 'itemScope', read: getAttribute('itemscope')},954 {name: 'itemType', read: getAttribute('itemtype')},955 {956 name: 'k',957 read: getSVGAttribute('k'),958 containerTagName: 'svg',959 tagName: 'hkern',960 },961 {962 name: 'K',963 containerTagName: 'svg',964 tagName: 'hkern',965 read: getSVGAttribute('k'),966 },967 {968 name: 'K1',969 containerTagName: 'svg',970 tagName: 'feComposite',971 read: getSVGProperty('k1'),972 },973 {974 name: 'k1',975 read: getSVGProperty('k1'),976 containerTagName: 'svg',977 tagName: 'feComposite',978 },979 {980 name: 'k2',981 read: getSVGProperty('k2'),982 containerTagName: 'svg',983 tagName: 'feComposite',984 },985 {986 name: 'k3',987 read: getSVGProperty('k3'),988 containerTagName: 'svg',989 tagName: 'feComposite',990 },991 {992 name: 'k4',993 read: getSVGProperty('k4'),994 containerTagName: 'svg',995 tagName: 'feComposite',996 },997 {998 name: 'kernelMatrix',999 read: getSVGProperty('kernelMatrix'),1000 containerTagName: 'svg',1001 tagName: 'feConvolveMatrix',1002 overrideStringValue: '1 2 3,4',1003 },1004 {1005 name: 'kernelUnitLength',1006 read: getSVGAttribute('kernelUnitLength'),1007 containerTagName: 'svg',1008 tagName: 'feConvolveMatrix',1009 },1010 {1011 name: 'kerning',1012 containerTagName: 'svg',1013 tagName: 'text',1014 read: getSVGAttribute('kerning'),1015 },1016 {name: 'keyParams', read: getAttribute('keyParams')},1017 {1018 name: 'keyPoints',1019 read: getSVGAttribute('keyPoints'),1020 containerTagName: 'svg',1021 tagName: 'animateMotion',1022 },1023 {1024 name: 'keySplines',1025 read: getSVGAttribute('keySplines'),1026 containerTagName: 'svg',1027 tagName: 'animate',1028 },1029 {1030 name: 'keyTimes',1031 read: getSVGAttribute('keyTimes'),1032 containerTagName: 'svg',1033 tagName: 'animate',1034 },1035 {name: 'keyType', read: getAttribute('keyType')},1036 {name: 'kind', tagName: 'track', overrideStringValue: 'captions'},1037 {name: 'label', tagName: 'track'},1038 {name: 'LANG', read: getProperty('lang')},1039 {name: 'lang'},1040 {name: 'length', read: getAttribute('length')},1041 {1042 name: 'lengthAdjust',1043 read: getSVGProperty('lengthAdjust'),1044 containerTagName: 'svg',1045 tagName: 'text',1046 overrideStringValue: 'spacingAndGlyphs',1047 },1048 {1049 name: 'letter-spacing',1050 containerTagName: 'svg',1051 tagName: 'text',1052 read: getSVGAttribute('letter-spacing'),1053 },1054 {1055 name: 'letterSpacing',1056 containerTagName: 'svg',1057 tagName: 'text',1058 read: getSVGAttribute('letter-spacing'),1059 },1060 {1061 name: 'lighting-color',1062 containerTagName: 'svg',1063 tagName: 'feDiffuseLighting',1064 read: getSVGAttribute('lighting-color'),1065 },1066 {1067 name: 'lightingColor',1068 containerTagName: 'svg',1069 tagName: 'feDiffuseLighting',1070 read: getSVGAttribute('lighting-color'),1071 },1072 {1073 name: 'limitingConeAngle',1074 read: getSVGProperty('limitingConeAngle'),1075 containerTagName: 'svg',1076 tagName: 'feSpotLight',1077 },1078 {name: 'list', read: getAttribute('list')}, // TODO: This should match the ID of a datalist element and then read property.1079 {1080 name: 'local',1081 read: getSVGAttribute('local'),1082 containerTagName: 'svg',1083 tagName: 'color-profile',1084 },1085 {name: 'loop', tagName: 'audio'},1086 {name: 'low', tagName: 'meter'},1087 {name: 'manifest', read: getAttribute('manifest')},1088 {name: 'marginHeight', containerTagName: 'frameset', tagName: 'frame'},1089 {name: 'marginWidth', containerTagName: 'frameset', tagName: 'frame'},1090 {1091 name: 'marker-end',1092 containerTagName: 'svg',1093 tagName: 'line',1094 read: getSVGAttribute('marker-end'),1095 },1096 {1097 name: 'marker-mid',1098 containerTagName: 'svg',1099 tagName: 'line',1100 read: getSVGAttribute('marker-mid'),1101 },1102 {1103 name: 'marker-start',1104 containerTagName: 'svg',1105 tagName: 'line',1106 read: getSVGAttribute('marker-start'),1107 },1108 {1109 name: 'markerEnd',1110 containerTagName: 'svg',1111 tagName: 'line',1112 read: getSVGAttribute('marker-end'),1113 },1114 {1115 name: 'markerHeight',1116 read: getSVGProperty('markerHeight'),1117 containerTagName: 'svg',1118 tagName: 'marker',1119 },1120 {1121 name: 'markerMid',1122 containerTagName: 'svg',1123 tagName: 'line',1124 read: getSVGAttribute('marker-mid'),1125 },1126 {1127 name: 'markerStart',1128 containerTagName: 'svg',1129 tagName: 'line',1130 read: getSVGAttribute('marker-start'),1131 },1132 {1133 name: 'markerUnits',1134 read: getSVGProperty('markerUnits'),1135 containerTagName: 'svg',1136 tagName: 'marker',1137 },1138 {1139 name: 'markerWidth',1140 read: getSVGProperty('markerWidth'),1141 containerTagName: 'svg',1142 tagName: 'marker',1143 },1144 {1145 name: 'mask',1146 containerTagName: 'svg',1147 tagName: 'path',1148 read: getSVGAttribute('mask'),1149 },1150 {1151 name: 'maskContentUnits',1152 read: getSVGProperty('maskContentUnits'),1153 containerTagName: 'svg',1154 tagName: 'mask',1155 overrideStringValue: 'objectBoundingBox',1156 },1157 {1158 name: 'maskUnits',1159 read: getSVGProperty('maskUnits'),1160 containerTagName: 'svg',1161 tagName: 'mask',1162 overrideStringValue: 'userSpaceOnUse',1163 },1164 {1165 name: 'mathematical',1166 read: getSVGAttribute('mathematical'),1167 containerTagName: 'svg',1168 tagName: 'font-face',1169 },1170 {name: 'max', tagName: 'input'},1171 {name: 'max', tagName: 'meter'},1172 {name: 'max', tagName: 'progress'},1173 {1174 name: 'max',1175 containerTagName: 'svg',1176 tagName: 'animate',1177 read: getSVGAttribute('max'),1178 },1179 {name: 'maxLength', tagName: 'textarea'},1180 {name: 'media', tagName: 'link'},1181 {1182 name: 'media',1183 containerTagName: 'svg',1184 tagName: 'style',1185 read: getSVGProperty('media'),1186 },1187 {name: 'mediaGroup', tagName: 'video', read: getAttribute('mediagroup')}, // TODO: Not yet implemented in Chrome.1188 {name: 'method', tagName: 'form', overrideStringValue: 'POST'},1189 {1190 name: 'method',1191 containerTagName: 'svg',1192 tagName: 'textPath',1193 read: getSVGProperty('method'),1194 overrideStringValue: 'stretch',1195 },1196 {name: 'min', tagName: 'input'},1197 {name: 'min', tagName: 'meter'},1198 {1199 name: 'min',1200 containerTagName: 'svg',1201 tagName: 'animate',1202 read: getSVGAttribute('min'),1203 },1204 {name: 'minLength', tagName: 'input'},1205 {1206 name: 'mode',1207 read: getSVGProperty('mode'),1208 containerTagName: 'svg',1209 tagName: 'feBlend',1210 overrideStringValue: 'multiply',1211 },1212 {name: 'multiple', tagName: 'select'},1213 {name: 'muted', tagName: 'video'},1214 {name: 'name', tagName: 'input'},1215 {1216 name: 'name',1217 containerTagName: 'svg',1218 tagName: 'color-profile',1219 read: getSVGAttribute('color-profile'),1220 },1221 {name: 'noModule', tagName: 'script'},1222 {name: 'nonce', read: getAttribute('nonce')},1223 {name: 'noValidate', tagName: 'form'},1224 {1225 name: 'numOctaves',1226 read: getSVGProperty('numOctaves'),1227 containerTagName: 'svg',1228 tagName: 'feTurbulence',1229 },1230 {1231 name: 'offset',1232 read: getSVGProperty('offset'),1233 containerTagName: 'svg',1234 tagName: 'stop',1235 },1236 {name: 'on-click'}, // TODO: Check for event subscriptions1237 {name: 'on-unknownevent'}, // TODO: Check for event subscriptions1238 {name: 'onclick'}, // TODO: Check for event subscriptions1239 {name: 'onClick'}, // TODO: Check for event subscriptions1240 {name: 'onunknownevent'}, // TODO: Check for event subscriptions1241 {name: 'onUnknownEvent'}, // TODO: Check for event subscriptions1242 {1243 name: 'opacity',1244 containerTagName: 'svg',1245 tagName: 'path',1246 read: getSVGAttribute('opacity'),1247 },1248 {name: 'open', tagName: 'details'},1249 {1250 name: 'operator',1251 read: getSVGProperty('operator'),1252 containerTagName: 'svg',1253 tagName: 'feComposite',1254 overrideStringValue: 'xor',1255 },1256 {name: 'optimum', tagName: 'meter'},1257 {1258 name: 'order',1259 read: getSVGAttribute('order'),1260 containerTagName: 'svg',1261 tagName: 'feConvolveMatrix',1262 },1263 {1264 name: 'orient',1265 read: getSVGAttribute('orient'),1266 containerTagName: 'svg',1267 tagName: 'marker',1268 },1269 {1270 name: 'orientation',1271 read: getSVGAttribute('orientation'),1272 containerTagName: 'svg',1273 tagName: 'glyph',1274 },1275 {1276 name: 'origin',1277 read: getSVGAttribute('origin'),1278 containerTagName: 'svg',1279 tagName: 'animateMotion',1280 },1281 {1282 name: 'overflow',1283 containerTagName: 'svg',1284 tagName: 'path',1285 read: getSVGAttribute('overflow'),1286 },1287 {1288 name: 'overline-position',1289 read: getSVGAttribute('overline-position'),1290 containerTagName: 'svg',1291 tagName: 'font-face',1292 },1293 {1294 name: 'overline-thickness',1295 read: getSVGAttribute('overline-thickness'),1296 containerTagName: 'svg',1297 tagName: 'font-face',1298 },1299 {1300 name: 'overlinePosition',1301 read: getSVGAttribute('overline-position'),1302 containerTagName: 'svg',1303 tagName: 'font-face',1304 },1305 {1306 name: 'overlineThickness',1307 read: getSVGAttribute('overline-thickness'),1308 containerTagName: 'svg',1309 tagName: 'font-face',1310 },1311 {1312 name: 'paint-order',1313 containerTagName: 'svg',1314 tagName: 'path',1315 read: getSVGAttribute('paint-order'),1316 },1317 {1318 name: 'paintOrder',1319 containerTagName: 'svg',1320 tagName: 'path',1321 read: getSVGAttribute('paint-order'),1322 },1323 {1324 name: 'panose-1',1325 read: getSVGAttribute('panose-1'),1326 containerTagName: 'svg',1327 tagName: 'font-face',1328 },1329 {1330 name: 'panose1',1331 containerTagName: 'svg',1332 tagName: 'font-face',1333 read: getSVGAttribute('panose-1'),1334 },1335 {1336 name: 'pathLength',1337 read: getSVGProperty('pathLength'),1338 containerTagName: 'svg',1339 tagName: 'path',1340 },1341 {name: 'pattern', tagName: 'input'},1342 {1343 name: 'patternContentUnits',1344 read: getSVGProperty('patternContentUnits'),1345 containerTagName: 'svg',1346 tagName: 'pattern',1347 overrideStringValue: 'objectBoundingBox',1348 },1349 {1350 name: 'patternTransform',1351 read: getSVGProperty('patternTransform'),1352 containerTagName: 'svg',1353 tagName: 'pattern',1354 overrideStringValue:1355 'translate(-10,-20) scale(2) rotate(45) translate(5,10)',1356 },1357 {1358 name: 'patternUnits',1359 read: getSVGProperty('patternUnits'),1360 containerTagName: 'svg',1361 tagName: 'pattern',1362 overrideStringValue: 'userSpaceOnUse',1363 },1364 {name: 'placeholder', tagName: 'input'},1365 {name: 'playsInline', read: getAttribute('playsinline')},1366 {1367 name: 'pointer-events',1368 containerTagName: 'svg',1369 tagName: 'path',1370 read: getSVGAttribute('pointer-events'),1371 },1372 {1373 name: 'pointerEvents',1374 containerTagName: 'svg',1375 tagName: 'path',1376 read: getSVGAttribute('pointer-events'),1377 },1378 {1379 name: 'points',1380 read: getSVGProperty('points'),1381 containerTagName: 'svg',1382 tagName: 'polygon',1383 overrideStringValue: '350,75 379,161 469,161',1384 },1385 {1386 name: 'pointsAtX',1387 read: getSVGProperty('pointsAtX'),1388 containerTagName: 'svg',1389 tagName: 'feSpotLight',1390 },1391 {1392 name: 'pointsAtY',1393 read: getSVGProperty('pointsAtY'),1394 containerTagName: 'svg',1395 tagName: 'feSpotLight',1396 },1397 {1398 name: 'pointsAtZ',1399 read: getSVGProperty('pointsAtZ'),1400 containerTagName: 'svg',1401 tagName: 'feSpotLight',1402 },1403 {1404 name: 'poster',1405 tagName: 'video',1406 overrideStringValue: 'https://reactjs.com',1407 },1408 {name: 'prefix', read: getAttribute('prefix')},1409 {name: 'preload', tagName: 'video', overrideStringValue: 'none'},1410 {1411 name: 'preserveAlpha',1412 read: getSVGProperty('preserveAlpha'),1413 containerTagName: 'svg',1414 tagName: 'feConvolveMatrix',1415 },1416 {1417 name: 'preserveAspectRatio',1418 read: getSVGProperty('preserveAspectRatio'),1419 containerTagName: 'svg',1420 tagName: 'feImage',1421 overrideStringValue: 'xMinYMin slice',1422 },1423 {1424 name: 'primitiveUnits',1425 read: getSVGProperty('primitiveUnits'),1426 containerTagName: 'svg',1427 tagName: 'filter',1428 overrideStringValue: 'objectBoundingBox',1429 },1430 {name: 'profile', read: getAttribute('profile')},1431 {name: 'property', read: getAttribute('property')},1432 {name: 'props', read: getAttribute('props')},1433 {1434 name: 'r',1435 read: getSVGProperty('r'),1436 containerTagName: 'svg',1437 tagName: 'circle',1438 overrideStringValue: '10pt',1439 },1440 {name: 'radioGroup', tagName: 'command', read: getAttribute('radiogroup')},1441 {1442 name: 'radius',1443 read: getSVGAttribute('radius'),1444 containerTagName: 'svg',1445 tagName: 'feMorphology',1446 },1447 {name: 'readOnly', tagName: 'input'},1448 {name: 'referrerPolicy', tagName: 'iframe'},1449 {1450 name: 'refX',1451 read: getSVGProperty('refX'),1452 containerTagName: 'svg',1453 tagName: 'marker',1454 overrideStringValue: '5em',1455 },1456 {1457 name: 'refY',1458 read: getSVGProperty('refY'),1459 containerTagName: 'svg',1460 tagName: 'marker',1461 overrideStringValue: '6em',1462 },1463 {name: 'rel', tagName: 'a'},1464 {1465 name: 'rendering-intent',1466 read: getSVGAttribute('rendering-intent'),1467 containerTagName: 'svg',1468 tagName: 'color-profile',1469 },1470 {1471 name: 'renderingIntent',1472 read: getSVGAttribute('rendering-intent'),1473 containerTagName: 'svg',1474 tagName: 'color-profile',1475 },1476 {1477 name: 'repeatCount',1478 read: getSVGAttribute('repeatcount'),1479 containerTagName: 'svg',1480 tagName: 'animate',1481 },1482 {1483 name: 'repeatDur',1484 read: getSVGAttribute('repeatdur'),1485 containerTagName: 'svg',1486 tagName: 'animate',1487 },1488 {name: 'required', tagName: 'input'},1489 {1490 name: 'requiredExtensions',1491 read: getSVGProperty('requiredExtensions'),1492 containerTagName: 'svg',1493 tagName: 'a',1494 },1495 {1496 name: 'requiredFeatures',1497 read: getSVGAttribute('requiredFeatures'),1498 containerTagName: 'svg',1499 tagName: 'a',1500 },1501 {name: 'resource', read: getAttribute('resource')},1502 {1503 name: 'restart',1504 read: getSVGAttribute('resource'),1505 containerTagName: 'svg',1506 tagName: 'animate',1507 },1508 {1509 name: 'result',1510 read: getSVGProperty('result'),1511 containerTagName: 'svg',1512 tagName: 'feBlend',1513 },1514 {name: 'results', tagName: 'input', read: getAttribute('results')}, // TODO: Should use property but it's not supported in Chrome.1515 {name: 'reversed', tagName: 'ol'},1516 {name: 'role', read: getAttribute('role')},1517 {1518 name: 'rotate',1519 read: getSVGAttribute('role'),1520 containerTagName: 'svg',1521 tagName: 'altGlyph',1522 },1523 {name: 'rows', tagName: 'textarea'},1524 {name: 'rowSpan', containerTagName: 'tr', tagName: 'td'},1525 {1526 name: 'rx',1527 read: getSVGProperty('rx'),1528 containerTagName: 'svg',1529 tagName: 'ellipse',1530 overrideStringValue: '1px',1531 },1532 {1533 name: 'ry',1534 read: getSVGProperty('ry'),1535 containerTagName: 'svg',1536 tagName: 'ellipse',1537 overrideStringValue: '2px',1538 },1539 {1540 name: 'sandbox',1541 tagName: 'iframe',1542 overrideStringValue: 'allow-forms allow-scripts',1543 },1544 {1545 name: 'scale',1546 read: getSVGProperty('scale'),1547 containerTagName: 'svg',1548 tagName: 'feDisplacementMap',1549 },1550 {1551 name: 'scope',1552 containerTagName: 'tr',1553 tagName: 'th',1554 overrideStringValue: 'row',1555 },1556 {name: 'scoped', tagName: 'style', read: getAttribute('scoped')},1557 {name: 'scrolling', tagName: 'iframe', overrideStringValue: 'no'},1558 {name: 'seamless', tagName: 'iframe', read: getAttribute('seamless')},1559 {name: 'security', tagName: 'iframe', read: getAttribute('security')},1560 {1561 name: 'seed',1562 read: getSVGProperty('seed'),1563 containerTagName: 'svg',1564 tagName: 'feTurbulence',1565 },1566 {name: 'selected', tagName: 'option', containerTagName: 'select'},1567 {name: 'selectedIndex', tagName: 'select'},1568 {name: 'shape', tagName: 'a'},1569 {1570 name: 'shape-rendering',1571 tagName: 'svg',1572 read: getSVGAttribute('shape-rendering'),1573 },1574 {1575 name: 'shapeRendering',1576 tagName: 'svg',1577 read: getSVGAttribute('shape-rendering'),1578 },1579 {name: 'size', tagName: 'input'},1580 {name: 'sizes', tagName: 'link'},1581 {1582 name: 'slope',1583 read: getSVGAttribute('slope'),1584 containerTagName: 'svg',1585 tagName: 'font-face',1586 },1587 {1588 name: 'spacing',1589 read: getSVGProperty('spacing'),1590 containerTagName: 'svg',1591 tagName: 'textPath',1592 overrideStringValue: 'auto',1593 },1594 {name: 'span', containerTagName: 'colgroup', tagName: 'col'},1595 {1596 name: 'specularConstant',1597 read: getSVGProperty('specularConstant'),1598 containerTagName: 'svg',1599 tagName: 'feSpecularLighting',1600 },1601 {1602 name: 'specularExponent',1603 read: getSVGProperty('specularConstant'),1604 containerTagName: 'svg',1605 tagName: 'feSpecularLighting',1606 },1607 {name: 'speed', read: getAttribute('speed')},1608 {1609 name: 'spellCheck',1610 overrideStringValue: 'false',1611 tagName: 'input',1612 read: getProperty('spellcheck'),1613 },1614 {1615 name: 'spellcheck',1616 overrideStringValue: 'false',1617 tagName: 'input',1618 read: getProperty('spellcheck'),1619 },1620 {1621 name: 'spreadMethod',1622 read: getSVGProperty('spreadMethod'),1623 containerTagName: 'svg',1624 tagName: 'linearGradient',1625 overrideStringValue: 'reflect',1626 },1627 {name: 'src', tagName: 'img', overrideStringValue: 'https://reactjs.com'},1628 {1629 name: 'srcDoc',1630 tagName: 'iframe',1631 overrideStringValue: '<p>Hi</p>',1632 read: getProperty('srcdoc'),1633 },1634 {1635 name: 'srcdoc',1636 tagName: 'iframe',1637 overrideStringValue: '<p>Hi</p>',1638 read: getProperty('srcdoc'),1639 },1640 {1641 name: 'srcLang',1642 containerTagName: 'audio',1643 tagName: 'track',1644 overrideStringValue: 'en',1645 read: getProperty('srclang'),1646 },1647 {1648 name: 'srclang',1649 containerTagName: 'audio',1650 tagName: 'track',1651 overrideStringValue: 'en',1652 read: getProperty('srclang'),1653 },1654 {name: 'srcSet', tagName: 'img'},1655 {name: 'srcset', tagName: 'img'},1656 {name: 'start', tagName: 'ol'},1657 {1658 name: 'startOffset',1659 read: getSVGProperty('startOffset'),1660 containerTagName: 'svg',1661 tagName: 'textPath',1662 },1663 {name: 'state', read: getAttribute('state')},1664 {1665 name: 'stdDeviation',1666 read: getSVGAttribute('stdDeviation'),1667 containerTagName: 'svg',1668 tagName: 'feGaussianBlur',1669 },1670 {1671 name: 'stemh',1672 read: getSVGAttribute('stemh'),1673 containerTagName: 'svg',1674 tagName: 'font-face',1675 },1676 {1677 name: 'stemv',1678 read: getSVGAttribute('stemv'),1679 containerTagName: 'svg',1680 tagName: 'font-face',1681 },1682 {name: 'step', read: getAttribute('step')},1683 {1684 name: 'stitchTiles',1685 read: getSVGProperty('stitchTiles'),1686 containerTagName: 'svg',1687 tagName: 'feTurbulence',1688 overrideStringValue: 'stitch',1689 },1690 {1691 name: 'stop-color',1692 containerTagName: 'svg',1693 tagName: 'stop',1694 read: getSVGAttribute('stop-color'),1695 },1696 {1697 name: 'stop-opacity',1698 containerTagName: 'svg',1699 tagName: 'stop',1700 read: getSVGAttribute('stop-opacity'),1701 },1702 {1703 name: 'stopColor',1704 containerTagName: 'svg',1705 tagName: 'stop',1706 read: getSVGAttribute('stop-color'),1707 },1708 {1709 name: 'stopOpacity',1710 containerTagName: 'svg',1711 tagName: 'stop',1712 read: getSVGAttribute('stop-opacity'),1713 },1714 {1715 name: 'strikethrough-position',1716 read: getSVGAttribute('strikethrough-position'),1717 containerTagName: 'svg',1718 tagName: 'font-face',1719 },1720 {1721 name: 'strikethrough-thickness',1722 read: getSVGAttribute('strikethrough-thickness'),1723 containerTagName: 'svg',1724 tagName: 'font-face',1725 },1726 {1727 name: 'strikethroughPosition',1728 read: getSVGAttribute('strikethrough-position'),1729 containerTagName: 'svg',1730 tagName: 'font-face',1731 },1732 {1733 name: 'strikethroughThickness',1734 read: getSVGAttribute('strikethrough-thickness'),1735 containerTagName: 'svg',1736 tagName: 'font-face',1737 },1738 {1739 name: 'string',1740 read: getSVGAttribute('string'),1741 containerTagName: 'svg',1742 tagName: 'font-face-format',1743 },1744 {1745 name: 'stroke',1746 containerTagName: 'svg',1747 tagName: 'path',1748 read: getSVGAttribute('stroke'),1749 },1750 {1751 name: 'stroke-dasharray',1752 containerTagName: 'svg',1753 tagName: 'path',1754 read: getSVGAttribute('stroke-dasharray'),1755 },1756 {1757 name: 'stroke-Dasharray',1758 containerTagName: 'svg',1759 tagName: 'path',1760 read: getSVGAttribute('stroke-dasharray'),1761 },1762 {1763 name: 'stroke-dashoffset',1764 containerTagName: 'svg',1765 tagName: 'path',1766 read: getSVGAttribute('stroke-dashoffset'),1767 },1768 {1769 name: 'stroke-linecap',1770 containerTagName: 'svg',1771 tagName: 'path',1772 read: getSVGAttribute('stroke-linecap'),1773 },1774 {1775 name: 'stroke-linejoin',1776 containerTagName: 'svg',1777 tagName: 'path',1778 read: getSVGAttribute('stroke-linejoin'),1779 },1780 {1781 name: 'stroke-miterlimit',1782 containerTagName: 'svg',1783 tagName: 'path',1784 read: getSVGAttribute('stroke-miterlimit'),1785 },1786 {1787 name: 'stroke-opacity',1788 containerTagName: 'svg',1789 tagName: 'path',1790 read: getSVGAttribute('stroke-opacity'),1791 },1792 {1793 name: 'stroke-width',1794 containerTagName: 'svg',1795 tagName: 'path',1796 read: getSVGAttribute('stroke-width'),1797 },1798 {1799 name: 'strokeDasharray',1800 containerTagName: 'svg',1801 tagName: 'path',1802 read: getSVGAttribute('stroke-dasharray'),1803 },1804 {1805 name: 'strokeDashoffset',1806 containerTagName: 'svg',1807 tagName: 'path',1808 read: getSVGAttribute('stroke-dashoffset'),1809 },1810 {1811 name: 'strokeLinecap',1812 containerTagName: 'svg',1813 tagName: 'path',1814 read: getSVGAttribute('stroke-linecap'),1815 },1816 {1817 name: 'strokeLinejoin',1818 containerTagName: 'svg',1819 tagName: 'path',1820 read: getSVGAttribute('stroke-linejoin'),1821 },1822 {1823 name: 'strokeMiterlimit',1824 containerTagName: 'svg',1825 tagName: 'path',1826 read: getSVGAttribute('stroke-miterlimit'),1827 },1828 {1829 name: 'strokeOpacity',1830 containerTagName: 'svg',1831 tagName: 'path',1832 read: getSVGAttribute('stroke-opacity'),1833 },1834 {1835 name: 'strokeWidth',1836 containerTagName: 'svg',1837 tagName: 'path',1838 read: getSVGAttribute('stroke-width'),1839 },1840 {name: 'style'},1841 {name: 'summary', tagName: 'table'},1842 {1843 name: 'suppressContentEditableWarning',1844 read: getAttribute('suppresscontenteditablewarning'),1845 },1846 {1847 name: 'surfaceScale',1848 read: getSVGProperty('surfaceScale'),1849 containerTagName: 'svg',1850 tagName: 'feDiffuseLighting',1851 },1852 {1853 name: 'systemLanguage',1854 overrideStringValue: 'en',1855 read: getSVGProperty('systemLanguage'),1856 containerTagName: 'svg',1857 tagName: 'a',1858 },1859 {name: 'tabIndex'},1860 {1861 name: 'tabIndex',1862 read: getSVGProperty('tabIndex'),1863 tagName: 'svg',1864 },1865 {1866 name: 'tableValues',1867 read: getSVGProperty('tableValues'),1868 containerTagName: 'svg',1869 tagName: 'feFuncA',1870 overrideStringValue: '0 1 2 3',1871 },1872 {1873 name: 'target',1874 read: getSVGProperty('target'),1875 containerTagName: 'svg',1876 tagName: 'a',1877 },1878 {1879 name: 'targetX',1880 read: getSVGProperty('targetX'),1881 containerTagName: 'svg',1882 tagName: 'feConvolveMatrix',1883 },1884 {1885 name: 'targetY',1886 read: getSVGProperty('targetY'),1887 containerTagName: 'svg',1888 tagName: 'feConvolveMatrix',1889 },1890 {1891 name: 'text-anchor',1892 containerTagName: 'svg',1893 tagName: 'text',1894 read: getSVGAttribute('text-anchor'),1895 },1896 {1897 name: 'text-decoration',1898 containerTagName: 'svg',1899 tagName: 'text',1900 read: getSVGAttribute('text-decoration'),1901 },1902 {1903 name: 'text-rendering',1904 tagName: 'svg',1905 read: getSVGAttribute('text-rendering'),1906 },1907 {1908 name: 'textAnchor',1909 containerTagName: 'svg',1910 tagName: 'text',1911 read: getSVGAttribute('text-anchor'),1912 },1913 {1914 name: 'textDecoration',1915 containerTagName: 'svg',1916 tagName: 'text',1917 read: getSVGAttribute('text-decoration'),1918 },1919 {1920 name: 'textLength',1921 read: getSVGProperty('textLength'),1922 containerTagName: 'svg',1923 tagName: 'text',1924 },1925 {1926 name: 'textRendering',1927 tagName: 'svg',1928 read: getSVGAttribute('text-rendering'),1929 },1930 {name: 'title'},1931 {1932 name: 'to',1933 read: getSVGAttribute('to'),1934 containerTagName: 'svg',1935 tagName: 'set',1936 },1937 {1938 name: 'transform',1939 read: getSVGProperty('transform'),1940 containerTagName: 'svg',1941 tagName: 'a',1942 overrideStringValue:1943 'translate(-10,-20) scale(2) rotate(45) translate(5,10)',1944 },1945 {name: 'type', tagName: 'button', overrideStringValue: 'reset'},1946 {1947 name: 'type',1948 containerTagName: 'svg',1949 tagName: 'feFuncA',1950 read: getSVGProperty('type'),1951 overrideStringValue: 'discrete',1952 },1953 {name: 'typeof', read: getAttribute('typeof')},1954 {1955 name: 'u1',1956 read: getSVGAttribute('u1'),1957 containerTagName: 'svg',1958 tagName: 'hkern',1959 },1960 {1961 name: 'u2',1962 read: getSVGAttribute('u2'),1963 containerTagName: 'svg',1964 tagName: 'hkern',1965 },1966 {1967 name: 'underline-position',1968 read: getSVGAttribute('underline-position'),1969 containerTagName: 'svg',1970 tagName: 'font-face',1971 },1972 {1973 name: 'underline-thickness',1974 read: getSVGAttribute('underline-thickness'),1975 containerTagName: 'svg',1976 tagName: 'font-face',1977 },1978 {1979 name: 'underlinePosition',1980 read: getSVGAttribute('underline-position'),1981 containerTagName: 'svg',1982 tagName: 'font-face',1983 },1984 {1985 name: 'underlineThickness',1986 read: getSVGAttribute('underline-thickness'),1987 containerTagName: 'svg',1988 tagName: 'font-face',1989 },1990 {1991 name: 'unicode',1992 read: getSVGAttribute('unicode'),1993 containerTagName: 'svg',1994 tagName: 'glyph',1995 },1996 {1997 name: 'unicode-bidi',1998 containerTagName: 'svg',1999 tagName: 'text',2000 read: getSVGAttribute('unicode-bidi'),2001 },2002 {2003 name: 'unicode-range',2004 read: getSVGAttribute('unicode-range'),2005 containerTagName: 'svg',2006 tagName: 'font-face',2007 },2008 {2009 name: 'unicodeBidi',2010 containerTagName: 'svg',2011 tagName: 'text',2012 read: getSVGAttribute('unicode-bidi'),2013 },2014 {2015 name: 'unicodeRange',2016 read: getSVGAttribute('unicode-range'),2017 containerTagName: 'svg',2018 tagName: 'font-face',2019 },2020 {2021 name: 'units-per-em',2022 read: getSVGAttribute('units-per-em'),2023 containerTagName: 'svg',2024 tagName: 'font-face',2025 },2026 {2027 name: 'unitsPerEm',2028 read: getSVGAttribute('unites-per-em'),2029 containerTagName: 'svg',2030 tagName: 'font-face',2031 },2032 {name: 'unknown', read: getAttribute('unknown')},2033 {2034 name: 'unselectable',2035 read: getAttribute('unselectable'),2036 tagName: 'span',2037 overrideStringValue: 'on',2038 },2039 {name: 'useMap', tagName: 'img'},2040 {2041 name: 'v-alphabetic',2042 read: getSVGAttribute('v-alphabetic'),2043 containerTagName: 'svg',2044 tagName: 'font-face',2045 },2046 {2047 name: 'v-hanging',2048 read: getSVGAttribute('v-hanging'),2049 containerTagName: 'svg',2050 tagName: 'font-face',2051 },2052 {2053 name: 'v-ideographic',2054 read: getSVGAttribute('v-ideographic'),2055 containerTagName: 'svg',2056 tagName: 'font-face',2057 },2058 {2059 name: 'v-mathematical',2060 read: getSVGAttribute('v-mathematical'),2061 containerTagName: 'svg',2062 tagName: 'font-face',2063 },2064 {2065 name: 'vAlphabetic',2066 read: getSVGAttribute('v-alphabetic'),2067 containerTagName: 'svg',2068 tagName: 'font-face',2069 },2070 {name: 'value', tagName: 'input', extraProps: {onChange() {}}},2071 {name: 'value', tagName: 'input', type: 'email', extraProps: {onChange() {}}},2072 {2073 name: 'value',2074 tagName: 'input',2075 type: 'number',2076 extraProps: {onChange() {}},2077 },2078 {name: 'value', tagName: 'textarea', extraProps: {onChange() {}}},2079 {2080 name: 'value',2081 containerTagName: 'select',2082 tagName: 'option',2083 extraProps: {onChange() {}},2084 },2085 {2086 name: 'Value',2087 containerTagName: 'select',2088 tagName: 'option',2089 read: getProperty('value'),2090 },2091 {2092 name: 'values',2093 read: getSVGProperty('values'),2094 containerTagName: 'svg',2095 tagName: 'feColorMatrix',2096 overrideStringValue: '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0',2097 },2098 {2099 name: 'vector-effect',2100 containerTagName: 'svg',2101 tagName: 'line',2102 read: getSVGAttribute('vector-effect'),2103 },2104 {2105 name: 'vectorEffect',2106 containerTagName: 'svg',2107 tagName: 'line',2108 read: getSVGAttribute('vector-effect'),2109 },2110 {name: 'version', containerTagName: 'document', tagName: 'html'},2111 {name: 'version', tagName: 'svg', read: getSVGAttribute('version')},2112 {2113 name: 'vert-adv-y',2114 read: getSVGAttribute('vert-origin-y'),2115 containerTagName: 'svg',2116 tagName: 'font',2117 },2118 {2119 name: 'vert-origin-x',2120 read: getSVGAttribute('vert-origin-y'),2121 containerTagName: 'svg',2122 tagName: 'font',2123 },2124 {2125 name: 'vert-origin-y',2126 read: getSVGAttribute('vert-origin-y'),2127 containerTagName: 'svg',2128 tagName: 'font',2129 },2130 {2131 name: 'vertAdvY',2132 read: getSVGAttribute('vert-adv-y'),2133 containerTagName: 'svg',2134 tagName: 'font',2135 },2136 {2137 name: 'vertOriginX',2138 read: getSVGAttribute('vert-origin-x'),2139 containerTagName: 'svg',2140 tagName: 'font',2141 },2142 {2143 name: 'vertOriginY',2144 read: getSVGAttribute('vert-origin-y'),2145 containerTagName: 'svg',2146 tagName: 'font',2147 },2148 {2149 name: 'vHanging',2150 read: getSVGAttribute('v-hanging'),2151 containerTagName: 'svg',2152 tagName: 'font-face',2153 },2154 {2155 name: 'vIdeographic',2156 read: getSVGAttribute('v-ideographic'),2157 containerTagName: 'svg',2158 tagName: 'font-face',2159 },2160 {2161 name: 'viewBox',2162 read: getSVGProperty('viewBox'),2163 containerTagName: 'svg',2164 tagName: 'marker',2165 overrideStringValue: '0 0 1500 1000',2166 },2167 {2168 name: 'viewTarget',2169 read: getSVGAttribute('viewTarget'),2170 containerTagName: 'svg',2171 tagName: 'view',2172 },2173 {name: 'visibility', read: getAttribute('visibility')},2174 {2175 name: 'visibility',2176 containerTagName: 'svg',2177 tagName: 'path',2178 read: getSVGAttribute('visibility'),2179 },2180 {2181 name: 'vMathematical',2182 read: getSVGAttribute('v-mathematical'),2183 containerTagName: 'svg',2184 tagName: 'font-face',2185 },2186 {name: 'vocab', read: getAttribute('vocab')},2187 {name: 'width', tagName: 'img'},2188 {2189 name: 'width',2190 containerTagName: 'svg',2191 tagName: 'rect',2192 read: getSVGProperty('width'),2193 },2194 {2195 name: 'widths',2196 read: getSVGAttribute('widths'),2197 containerTagName: 'svg',2198 tagName: 'font-face',2199 },2200 {name: 'wmode', read: getAttribute('wmode'), tagName: 'embed'},2201 {2202 name: 'word-spacing',2203 containerTagName: 'svg',2204 tagName: 'text',2205 read: getSVGAttribute('word-spacing'),2206 },2207 {2208 name: 'wordSpacing',2209 containerTagName: 'svg',2210 tagName: 'text',2211 read: getSVGAttribute('word-spacing'),2212 },2213 {name: 'wrap', tagName: 'textarea'},2214 {2215 name: 'writing-mode',2216 containerTagName: 'svg',2217 tagName: 'text',2218 read: getSVGAttribute('writing-mode'),2219 },2220 {2221 name: 'writingMode',2222 containerTagName: 'svg',2223 tagName: 'text',2224 read: getSVGAttribute('writing-mode'),2225 },2226 {2227 name: 'x',2228 read: getSVGAttribute('x'),2229 containerTagName: 'svg',2230 tagName: 'altGlyph',2231 },2232 {2233 name: 'x-height',2234 read: getSVGAttribute('x-height'),2235 containerTagName: 'svg',2236 tagName: 'font-face',2237 },2238 {2239 name: 'x1',2240 read: getSVGProperty('x1'),2241 containerTagName: 'svg',2242 tagName: 'line',2243 },2244 {2245 name: 'x2',2246 read: getSVGProperty('x2'),2247 containerTagName: 'svg',2248 tagName: 'line',2249 },2250 {2251 name: 'xChannelSelector',2252 read: getSVGProperty('xChannelSelector'),2253 containerTagName: 'svg',2254 tagName: 'feDisplacementMap',2255 overrideStringValue: 'R',2256 },2257 {2258 name: 'xHeight',2259 read: getSVGAttribute('x-height'),2260 containerTagName: 'svg',2261 tagName: 'font-face',2262 },2263 {name: 'XLink:Actuate', read: getAttribute('XLink:Actuate')},2264 {name: 'xlink:actuate', read: getAttribute('xlink:actuate')},2265 {name: 'xlink:arcrole', read: getAttribute('xlink:arcrole')},2266 {name: 'xlink:href', read: getAttribute('xlink:href')},2267 {name: 'xlink:role', read: getAttribute('xlink:role')},2268 {name: 'xlink:show', read: getAttribute('xlink:show')},2269 {name: 'xlink:title', read: getAttribute('xlink:title')},2270 {name: 'xlink:type', read: getAttribute('xlink:type')},2271 {name: 'xlinkActuate', read: getAttribute('xlink:actuate')},2272 {name: 'XlinkActuate', read: getAttribute('Xlink:actuate')},2273 {name: 'xlinkArcrole', read: getAttribute('xlink:arcrole')},2274 {name: 'xlinkHref', read: getAttribute('xlink:href')},2275 {name: 'xlinkRole', read: getAttribute('xlink:role')},2276 {name: 'xlinkShow', read: getAttribute('xlink:show')},2277 {name: 'xlinkTitle', read: getAttribute('xlink:title')},2278 {name: 'xlinkType', read: getAttribute('xlink:type')},2279 {name: 'xml:base', read: getAttribute('xml:base')},2280 {name: 'xml:lang', read: getAttribute('xml:lang')},2281 {name: 'xml:space', read: getAttribute('xml:space')},2282 {name: 'xmlBase', read: getAttribute('xml:base')},2283 {name: 'xmlLang', read: getAttribute('xml:lang')},2284 {name: 'xmlns', read: getProperty('namespaceURI'), tagName: 'svg'},2285 {name: 'xmlns:xlink', read: getAttribute('xmlns:xlink')},2286 {name: 'xmlnsXlink', read: getAttribute('xmlns:xlink')},2287 {name: 'xmlSpace', read: getAttribute('xml:space')},2288 {2289 name: 'y',2290 read: getSVGAttribute('y'),2291 containerTagName: 'svg',2292 tagName: 'altGlyph',2293 },2294 {2295 name: 'y1',2296 read: getSVGProperty('y1'),2297 containerTagName: 'svg',2298 tagName: 'line',2299 },2300 {2301 name: 'y2',2302 read: getSVGProperty('y2'),2303 containerTagName: 'svg',2304 tagName: 'line',2305 },2306 {2307 name: 'yChannelSelector',2308 read: getSVGProperty('yChannelSelector'),2309 containerTagName: 'svg',2310 tagName: 'feDisplacementMap',2311 overrideStringValue: 'B',2312 },2313 {2314 name: 'z',2315 read: getSVGProperty('z'),2316 containerTagName: 'svg',2317 tagName: 'fePointLight',2318 },2319 {name: 'zoomAndPan', read: getSVGProperty('zoomAndPan'), tagName: 'svg'},2320];2321attributes.forEach(attr => {2322 attr.read = attr.read || getProperty(attr.name);2323});...

Full Screen

Full Screen

replset_read_preference.test.js

Source:replset_read_preference.test.js Github

copy

Full Screen

...262 new GridStore(db, doc._id, 'r', {263 readPreference: ReadPreference.SECONDARY264 }).open(function (err, gridStore) {265 test.equal(null, err);266 gridStore.read(function (err, data2) {267 test.equal(null, err);268 test.equal(data.toString('base64'), data2.toString('base64'));269 client.close();270 restartAndDone(done);271 });272 });273 });274 });275 });276 });277 });278 client.connect(function (err) {279 test.equal(null, err);280 });...

Full Screen

Full Screen

parse.js

Source:parse.js Github

copy

Full Screen

...99 case '\n':100 case '\r':101 case '\u2028':102 case '\u2029':103 read()104 return105 case '/':106 read()107 lexState = 'comment'108 return109 case undefined:110 read()111 return newToken('eof')112 }113 if (util.isSpaceSeparator(c)) {114 read()115 return116 }117 // This code is unreachable.118 // if (!lexStates[parseState]) {119 // throw invalidLexState(parseState)120 // }121 return lexStates[parseState]()122 },123 comment () {124 switch (c) {125 case '*':126 read()127 lexState = 'multiLineComment'128 return129 case '/':130 read()131 lexState = 'singleLineComment'132 return133 }134 throw invalidChar(read())135 },136 multiLineComment () {137 switch (c) {138 case '*':139 read()140 lexState = 'multiLineCommentAsterisk'141 return142 case undefined:143 throw invalidChar(read())144 }145 read()146 },147 multiLineCommentAsterisk () {148 switch (c) {149 case '*':150 read()151 return152 case '/':153 read()154 lexState = 'default'155 return156 case undefined:157 throw invalidChar(read())158 }159 read()160 lexState = 'multiLineComment'161 },162 singleLineComment () {163 switch (c) {164 case '\n':165 case '\r':166 case '\u2028':167 case '\u2029':168 read()169 lexState = 'default'170 return171 case undefined:172 read()173 return newToken('eof')174 }175 read()176 },177 value () {178 switch (c) {179 case '{':180 case '[':181 return newToken('punctuator', read())182 case 'n':183 read()184 literal('ull')185 return newToken('null', null)186 case 't':187 read()188 literal('rue')189 return newToken('boolean', true)190 case 'f':191 read()192 literal('alse')193 return newToken('boolean', false)194 case '-':195 case '+':196 if (read() === '-') {197 sign = -1198 }199 lexState = 'sign'200 return201 case '.':202 buffer = read()203 lexState = 'decimalPointLeading'204 return205 case '0':206 buffer = read()207 lexState = 'zero'208 return209 case '1':210 case '2':211 case '3':212 case '4':213 case '5':214 case '6':215 case '7':216 case '8':217 case '9':218 buffer = read()219 lexState = 'decimalInteger'220 return221 case 'I':222 read()223 literal('nfinity')224 return newToken('numeric', Infinity)225 case 'N':226 read()227 literal('aN')228 return newToken('numeric', NaN)229 case '"':230 case "'":231 doubleQuote = (read() === '"')232 buffer = ''233 lexState = 'string'234 return235 }236 throw invalidChar(read())237 },238 identifierNameStartEscape () {239 if (c !== 'u') {240 throw invalidChar(read())241 }242 read()243 const u = unicodeEscape()244 switch (u) {245 case '$':246 case '_':247 break248 default:249 if (!util.isIdStartChar(u)) {250 throw invalidIdentifier()251 }252 break253 }254 buffer += u255 lexState = 'identifierName'256 },257 identifierName () {258 switch (c) {259 case '$':260 case '_':261 case '\u200C':262 case '\u200D':263 buffer += read()264 return265 case '\\':266 read()267 lexState = 'identifierNameEscape'268 return269 }270 if (util.isIdContinueChar(c)) {271 buffer += read()272 return273 }274 return newToken('identifier', buffer)275 },276 identifierNameEscape () {277 if (c !== 'u') {278 throw invalidChar(read())279 }280 read()281 const u = unicodeEscape()282 switch (u) {283 case '$':284 case '_':285 case '\u200C':286 case '\u200D':287 break288 default:289 if (!util.isIdContinueChar(u)) {290 throw invalidIdentifier()291 }292 break293 }294 buffer += u295 lexState = 'identifierName'296 },297 sign () {298 switch (c) {299 case '.':300 buffer = read()301 lexState = 'decimalPointLeading'302 return303 case '0':304 buffer = read()305 lexState = 'zero'306 return307 case '1':308 case '2':309 case '3':310 case '4':311 case '5':312 case '6':313 case '7':314 case '8':315 case '9':316 buffer = read()317 lexState = 'decimalInteger'318 return319 case 'I':320 read()321 literal('nfinity')322 return newToken('numeric', sign * Infinity)323 case 'N':324 read()325 literal('aN')326 return newToken('numeric', NaN)327 }328 throw invalidChar(read())329 },330 zero () {331 switch (c) {332 case '.':333 buffer += read()334 lexState = 'decimalPoint'335 return336 case 'e':337 case 'E':338 buffer += read()339 lexState = 'decimalExponent'340 return341 case 'x':342 case 'X':343 buffer += read()344 lexState = 'hexadecimal'345 return346 }347 return newToken('numeric', sign * 0)348 },349 decimalInteger () {350 switch (c) {351 case '.':352 buffer += read()353 lexState = 'decimalPoint'354 return355 case 'e':356 case 'E':357 buffer += read()358 lexState = 'decimalExponent'359 return360 }361 if (util.isDigit(c)) {362 buffer += read()363 return364 }365 return newToken('numeric', sign * Number(buffer))366 },367 decimalPointLeading () {368 if (util.isDigit(c)) {369 buffer += read()370 lexState = 'decimalFraction'371 return372 }373 throw invalidChar(read())374 },375 decimalPoint () {376 switch (c) {377 case 'e':378 case 'E':379 buffer += read()380 lexState = 'decimalExponent'381 return382 }383 if (util.isDigit(c)) {384 buffer += read()385 lexState = 'decimalFraction'386 return387 }388 return newToken('numeric', sign * Number(buffer))389 },390 decimalFraction () {391 switch (c) {392 case 'e':393 case 'E':394 buffer += read()395 lexState = 'decimalExponent'396 return397 }398 if (util.isDigit(c)) {399 buffer += read()400 return401 }402 return newToken('numeric', sign * Number(buffer))403 },404 decimalExponent () {405 switch (c) {406 case '+':407 case '-':408 buffer += read()409 lexState = 'decimalExponentSign'410 return411 }412 if (util.isDigit(c)) {413 buffer += read()414 lexState = 'decimalExponentInteger'415 return416 }417 throw invalidChar(read())418 },419 decimalExponentSign () {420 if (util.isDigit(c)) {421 buffer += read()422 lexState = 'decimalExponentInteger'423 return424 }425 throw invalidChar(read())426 },427 decimalExponentInteger () {428 if (util.isDigit(c)) {429 buffer += read()430 return431 }432 return newToken('numeric', sign * Number(buffer))433 },434 hexadecimal () {435 if (util.isHexDigit(c)) {436 buffer += read()437 lexState = 'hexadecimalInteger'438 return439 }440 throw invalidChar(read())441 },442 hexadecimalInteger () {443 if (util.isHexDigit(c)) {444 buffer += read()445 return446 }447 return newToken('numeric', sign * Number(buffer))448 },449 string () {450 switch (c) {451 case '\\':452 read()453 buffer += escape()454 return455 case '"':456 if (doubleQuote) {457 read()458 return newToken('string', buffer)459 }460 buffer += read()461 return462 case "'":463 if (!doubleQuote) {464 read()465 return newToken('string', buffer)466 }467 buffer += read()468 return469 case '\n':470 case '\r':471 throw invalidChar(read())472 case '\u2028':473 case '\u2029':474 separatorChar(c)475 break476 case undefined:477 throw invalidChar(read())478 }479 buffer += read()480 },481 start () {482 switch (c) {483 case '{':484 case '[':485 return newToken('punctuator', read())486 // This code is unreachable since the default lexState handles eof.487 // case undefined:488 // return newToken('eof')489 }490 lexState = 'value'491 },492 beforePropertyName () {493 switch (c) {494 case '$':495 case '_':496 buffer = read()497 lexState = 'identifierName'498 return499 case '\\':500 read()501 lexState = 'identifierNameStartEscape'502 return503 case '}':504 return newToken('punctuator', read())505 case '"':506 case "'":507 doubleQuote = (read() === '"')508 lexState = 'string'509 return510 }511 if (util.isIdStartChar(c)) {512 buffer += read()513 lexState = 'identifierName'514 return515 }516 throw invalidChar(read())517 },518 afterPropertyName () {519 if (c === ':') {520 return newToken('punctuator', read())521 }522 throw invalidChar(read())523 },524 beforePropertyValue () {525 lexState = 'value'526 },527 afterPropertyValue () {528 switch (c) {529 case ',':530 case '}':531 return newToken('punctuator', read())532 }533 throw invalidChar(read())534 },535 beforeArrayValue () {536 if (c === ']') {537 return newToken('punctuator', read())538 }539 lexState = 'value'540 },541 afterArrayValue () {542 switch (c) {543 case ',':544 case ']':545 return newToken('punctuator', read())546 }547 throw invalidChar(read())548 },549 end () {550 // This code is unreachable since it's handled by the default lexState.551 // if (c === undefined) {552 // read()553 // return newToken('eof')554 // }555 throw invalidChar(read())556 },557}558function newToken (type, value) {559 return {560 type,561 value,562 line,563 column,564 }565}566function literal (s) {567 for (const c of s) {568 const p = peek()569 if (p !== c) {570 throw invalidChar(read())571 }572 read()573 }574}575function escape () {576 const c = peek()577 switch (c) {578 case 'b':579 read()580 return '\b'581 case 'f':582 read()583 return '\f'584 case 'n':585 read()586 return '\n'587 case 'r':588 read()589 return '\r'590 case 't':591 read()592 return '\t'593 case 'v':594 read()595 return '\v'596 case '0':597 read()598 if (util.isDigit(peek())) {599 throw invalidChar(read())600 }601 return '\0'602 case 'x':603 read()604 return hexEscape()605 case 'u':606 read()607 return unicodeEscape()608 case '\n':609 case '\u2028':610 case '\u2029':611 read()612 return ''613 case '\r':614 read()615 if (peek() === '\n') {616 read()617 }618 return ''619 case '1':620 case '2':621 case '3':622 case '4':623 case '5':624 case '6':625 case '7':626 case '8':627 case '9':628 throw invalidChar(read())629 case undefined:630 throw invalidChar(read())631 }632 return read()633}634function hexEscape () {635 let buffer = ''636 let c = peek()637 if (!util.isHexDigit(c)) {638 throw invalidChar(read())639 }640 buffer += read()641 c = peek()642 if (!util.isHexDigit(c)) {643 throw invalidChar(read())644 }645 buffer += read()646 return String.fromCodePoint(parseInt(buffer, 16))647}648function unicodeEscape () {649 let buffer = ''650 let count = 4651 while (count-- > 0) {652 const c = peek()653 if (!util.isHexDigit(c)) {654 throw invalidChar(read())655 }656 buffer += read()657 }658 return String.fromCodePoint(parseInt(buffer, 16))659}660const parseStates = {661 start () {662 if (token.type === 'eof') {663 throw invalidEOF()664 }665 push()666 },667 beforePropertyName () {668 switch (token.type) {669 case 'identifier':670 case 'string':...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pyatom automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful