How to use tagName method in Playwright Internal

Best JavaScript code snippet using playwright-internal

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: 'disablePictureInPicture',449 tagName: 'video',450 read: getProperty('disablepictureinpicture'),451 },452 {453 name: 'display',454 tagName: 'svg',455 overrideStringValue: 'list-item',456 read: getAttribute('display'),457 },458 {459 name: 'divisor',460 containerTagName: 'svg',461 tagName: 'feConvolveMatrix',462 read: getSVGProperty('divisor'),463 },464 {465 name: 'dominant-baseline',466 containerTagName: 'svg',467 tagName: 'text',468 read: getSVGAttribute('dominant-baseline'),469 },470 {471 name: 'dominantBaseline',472 containerTagName: 'svg',473 tagName: 'text',474 read: getSVGAttribute('dominant-baseline'),475 },476 {name: 'download', tagName: 'a'},477 {name: 'dOwNlOaD', tagName: 'a', read: getAttribute('dOwNlOaD')},478 {name: 'draggable'},479 {480 name: 'dur',481 containerTagName: 'svg',482 tagName: 'animate',483 read: getSVGAttribute('dur'),484 },485 {486 name: 'dx',487 containerTagName: 'svg',488 tagName: 'text',489 overrideStringValue: '1pt 2px 3em',490 read: getSVGProperty('dx'),491 },492 {493 name: 'dX',494 containerTagName: 'svg',495 tagName: 'text',496 overrideStringValue: '1pt 2px 3em',497 read: getSVGProperty('dx'),498 },499 {500 name: 'dy',501 containerTagName: 'svg',502 tagName: 'text',503 overrideStringValue: '1 2 3',504 read: getSVGProperty('dy'),505 },506 {507 name: 'dY',508 containerTagName: 'svg',509 tagName: 'text',510 overrideStringValue: '1 2 3',511 read: getSVGProperty('dy'),512 },513 {514 name: 'edgeMode',515 containerTagName: 'svg',516 tagName: 'feConvolveMatrix',517 overrideStringValue: 'wrap',518 read: getSVGProperty('edgeMode'),519 },520 {521 name: 'elevation',522 containerTagName: 'svg',523 tagName: 'feDistantLight',524 read: getSVGProperty('elevation'),525 },526 {527 name: 'enable-background',528 containerTagName: 'svg',529 tagName: 'path',530 read: getSVGAttribute('enable-background'),531 },532 {533 name: 'enableBackground',534 containerTagName: 'svg',535 tagName: 'path',536 read: getSVGAttribute('enable-background'),537 },538 {539 name: 'encType',540 tagName: 'form',541 overrideStringValue: 'text/plain',542 read: getProperty('enctype'),543 },544 {545 name: 'end',546 containerTagName: 'svg',547 tagName: 'animate',548 read: getSVGAttribute('end'),549 },550 {551 name: 'exponent',552 read: getSVGProperty('exponent'),553 containerTagName: 'svg',554 tagName: 'feFuncA',555 },556 {557 name: 'externalResourcesRequired',558 containerTagName: 'svg',559 tagName: 'path',560 read: getSVGAttribute('externalResourcesRequired'),561 },562 {563 name: 'fill',564 containerTagName: 'svg',565 tagName: 'path',566 read: getSVGAttribute('fill'),567 },568 {569 name: 'fillOpacity',570 containerTagName: 'svg',571 tagName: 'circle',572 read: getSVGAttribute('fill-opacity'),573 },574 {575 name: 'fill-opacity',576 containerTagName: 'svg',577 tagName: 'circle',578 read: getSVGAttribute('fill-opacity'),579 },580 {581 name: 'fillRule',582 containerTagName: 'svg',583 tagName: 'circle',584 read: getSVGAttribute('fill-rule'),585 },586 {587 name: 'fill-rule',588 containerTagName: 'svg',589 tagName: 'circle',590 read: getSVGAttribute('fill-rule'),591 },592 {593 name: 'filter',594 containerTagName: 'svg',595 tagName: 'g',596 read: getSVGAttribute('filter'),597 },598 {599 name: 'filterRes',600 containerTagName: 'svg',601 tagName: 'filter',602 read: getSVGAttribute('filterRes'),603 },604 {605 name: 'filterUnits',606 containerTagName: 'svg',607 tagName: 'filter',608 overrideStringValue: 'userSpaceOnUse',609 read: getSVGProperty('filterUnits'),610 },611 {612 name: 'flood-color',613 containerTagName: 'svg',614 tagName: 'feflood',615 overrideStringValue: 'currentColor',616 read: getSVGAttribute('flood-color'),617 },618 {619 name: 'floodColor',620 containerTagName: 'svg',621 tagName: 'feflood',622 overrideStringValue: 'currentColor',623 read: getSVGAttribute('flood-color'),624 },625 {626 name: 'flood-opacity',627 containerTagName: 'svg',628 tagName: 'feflood',629 overrideStringValue: 'inherit',630 read: getSVGAttribute('flood-opacity'),631 },632 {633 name: 'floodOpacity',634 containerTagName: 'svg',635 tagName: 'feflood',636 overrideStringValue: 'inherit',637 read: getSVGAttribute('flood-opacity'),638 },639 {name: 'focusable', tagName: 'p', read: getAttribute('focusable')},640 {641 name: 'font-family',642 read: getSVGAttribute('font-family'),643 containerTagName: 'svg',644 tagName: 'font-face',645 },646 {647 name: 'font-size',648 read: getSVGAttribute('font-size'),649 containerTagName: 'svg',650 tagName: 'font-face',651 },652 {653 name: 'font-size-adjust',654 containerTagName: 'svg',655 tagName: 'text',656 read: getSVGAttribute('font-size-adjust'),657 },658 {659 name: 'font-stretch',660 read: getSVGAttribute('font-stretch'),661 containerTagName: 'svg',662 tagName: 'font-face',663 },664 {665 name: 'font-style',666 read: getSVGAttribute('font-style'),667 containerTagName: 'svg',668 tagName: 'font-face',669 },670 {671 name: 'font-variant',672 read: getSVGAttribute('font-variant'),673 containerTagName: 'svg',674 tagName: 'font-face',675 },676 {677 name: 'font-weight',678 read: getSVGAttribute('font-weight'),679 containerTagName: 'svg',680 tagName: 'font-face',681 },682 {683 name: 'fontFamily',684 read: getSVGAttribute('font-family'),685 containerTagName: 'svg',686 tagName: 'font-face',687 },688 {689 name: 'fontSize',690 read: getSVGAttribute('font-size'),691 containerTagName: 'svg',692 tagName: 'font-face',693 },694 {695 name: 'fontSizeAdjust',696 containerTagName: 'svg',697 tagName: 'text',698 read: getSVGAttribute('font-size-adjust'),699 },700 {701 name: 'fontStretch',702 read: getSVGAttribute('font-stretch'),703 containerTagName: 'svg',704 tagName: 'font-face',705 },706 {707 name: 'fontStyle',708 read: getSVGAttribute('font-style'),709 containerTagName: 'svg',710 tagName: 'font-face',711 },712 {713 name: 'fontVariant',714 read: getSVGAttribute('font-variant'),715 containerTagName: 'svg',716 tagName: 'font-face',717 },718 {719 name: 'fontWeight',720 read: getSVGAttribute('font-weight'),721 containerTagName: 'svg',722 tagName: 'font-face',723 },724 {name: 'for', tagName: 'label', read: getProperty('htmlFor')},725 {name: 'fOr', tagName: 'label', read: getProperty('htmlFor')},726 {name: 'form', read: getAttribute('form')}, // TODO: Read the property by rendering into a form with i727 {728 name: 'formAction',729 tagName: 'input',730 overrideStringValue: 'https://reactjs.com',731 },732 {733 name: 'format',734 read: getSVGAttribute('format'),735 containerTagName: 'svg',736 tagName: 'altGlyph',737 },738 {name: 'formEncType', tagName: 'input', read: getProperty('formEnctype')},739 {name: 'formMethod', tagName: 'input', overrideStringValue: 'POST'},740 {name: 'formNoValidate', tagName: 'input'},741 {name: 'formTarget', tagName: 'input'},742 {name: 'frameBorder', tagName: 'iframe'},743 {744 name: 'from',745 read: getSVGAttribute('from'),746 containerTagName: 'svg',747 tagName: 'animate',748 },749 {750 name: 'fx',751 read: getSVGProperty('fx'),752 containerTagName: 'svg',753 overrideStringValue: '10px',754 tagName: 'radialGradient',755 },756 {757 name: 'fX',758 containerTagName: 'svg',759 tagName: 'radialGradient',760 overrideStringValue: '10px',761 read: getSVGProperty('fx'),762 },763 {764 name: 'fY',765 containerTagName: 'svg',766 tagName: 'radialGradient',767 overrideStringValue: '20em',768 read: getSVGProperty('fy'),769 },770 {771 name: 'fy',772 read: getSVGProperty('fy'),773 containerTagName: 'svg',774 overrideStringValue: '20em',775 tagName: 'radialGradient',776 },777 {778 name: 'G1',779 containerTagName: 'svg',780 tagName: 'hkern',781 read: getSVGAttribute('g1'),782 },783 {784 name: 'g1',785 read: getSVGAttribute('g1'),786 containerTagName: 'svg',787 tagName: 'hkern',788 },789 {790 name: 'G2',791 containerTagName: 'svg',792 tagName: 'hkern',793 read: getSVGAttribute('g2'),794 },795 {796 name: 'g2',797 read: getSVGAttribute('g2'),798 containerTagName: 'svg',799 tagName: 'hkern',800 },801 {802 name: 'glyph-name',803 read: getSVGAttribute('glyph-name'),804 containerTagName: 'svg',805 tagName: 'glyph',806 },807 {808 name: 'glyph-orientation-horizontal',809 containerTagName: 'svg',810 tagName: 'text',811 read: getSVGAttribute('glyph-orientation-horizontal'),812 },813 {814 name: 'glyph-orientation-vertical',815 containerTagName: 'svg',816 tagName: 'text',817 read: getSVGAttribute('glyph-orientation-vertical'),818 },819 {820 name: 'glyphName',821 read: getSVGAttribute('glyph-name'),822 containerTagName: 'svg',823 tagName: 'glyph',824 },825 {826 name: 'glyphOrientationHorizontal',827 containerTagName: 'svg',828 tagName: 'text',829 read: getSVGAttribute('glyph-orientation-horizontal'),830 },831 {832 name: 'glyphOrientationVertical',833 containerTagName: 'svg',834 tagName: 'text',835 read: getSVGAttribute('glyph-orientation-vertical'),836 },837 {838 name: 'glyphRef',839 read: getSVGAttribute('glyph-ref'),840 containerTagName: 'svg',841 tagName: 'altGlyph',842 },843 {844 name: 'gradientTransform',845 read: getSVGProperty('gradientTransform'),846 containerTagName: 'svg',847 overrideStringValue:848 'translate(-10,-20) scale(2) rotate(45) translate(5,10)',849 tagName: 'linearGradient',850 },851 {852 name: 'gradientUnits',853 read: getSVGProperty('gradientUnits'),854 containerTagName: 'svg',855 overrideStringValue: 'userSpaceOnUse',856 tagName: 'linearGradient',857 },858 {859 name: 'hanging',860 read: getSVGAttribute('hanging'),861 containerTagName: 'svg',862 tagName: 'font-face',863 },864 // Disabled because it crashes other tests with React 15.865 // TODO: re-enable when we no longer compare to 15.866 // {name: 'hasOwnProperty', read: getAttribute('hasOwnProperty')},867 {name: 'headers', containerTagName: 'tr', tagName: 'td'},868 {name: 'height', tagName: 'img'},869 {870 name: 'height',871 containerTagName: 'svg',872 tagName: 'rect',873 read: getSVGProperty('height'),874 overrideStringValue: '100%',875 },876 {name: 'hidden'},877 {name: 'high', tagName: 'meter'},878 {879 name: 'horiz-adv-x',880 read: getSVGAttribute('horiz-adv-x'),881 containerTagName: 'svg',882 tagName: 'font',883 },884 {885 name: 'horiz-origin-x',886 read: getSVGAttribute('horiz-origin-x'),887 containerTagName: 'svg',888 tagName: 'font',889 },890 {891 name: 'horizAdvX',892 read: getSVGAttribute('horiz-adv-x'),893 containerTagName: 'svg',894 tagName: 'font',895 },896 {897 name: 'horizOriginX',898 read: getSVGAttribute('horiz-origin-x'),899 containerTagName: 'svg',900 tagName: 'font',901 },902 {name: 'href', tagName: 'a', overrideStringValue: 'https://reactjs.com'},903 {name: 'hrefLang', read: getAttribute('hreflang')},904 {name: 'htmlFor', tagName: 'label'},905 {name: 'http-equiv', tagName: 'meta', read: getProperty('httpEquiv')},906 {name: 'httpEquiv', tagName: 'meta'},907 {name: 'icon', tagName: 'command', read: getAttribute('icon')},908 {name: 'id'},909 {name: 'ID', read: getProperty('id')},910 {911 name: 'ideographic',912 read: getSVGAttribute('ideographic'),913 containerTagName: 'svg',914 tagName: 'font-face',915 },916 {917 name: 'image-rendering',918 tagName: 'svg',919 read: getSVGAttribute('image-rendering'),920 },921 {922 name: 'imageRendering',923 tagName: 'svg',924 read: getSVGAttribute('image-rendering'),925 },926 {927 name: 'in',928 read: getSVGAttribute('in'),929 containerTagName: 'svg',930 tagName: 'feBlend',931 },932 {933 name: 'in2',934 read: getSVGProperty('in2'),935 containerTagName: 'svg',936 tagName: 'feBlend',937 },938 {name: 'initialChecked', read: getAttribute('initialchecked')},939 {name: 'initialValue', read: getAttribute('initialvalue')},940 {name: 'inlist', read: getAttribute('inlist')},941 {name: 'inputMode', tagName: 'input', read: getAttribute('inputmode')}, // TODO: Should use property but it's not implemented in Chrome942 {name: 'integrity', tagName: 'script'},943 {944 name: 'intercept',945 read: getSVGProperty('intercept'),946 containerTagName: 'svg',947 tagName: 'feFuncA',948 },949 {950 name: 'is',951 tagName: 'button',952 overrideStringValue: 'x-test-element',953 read: getAttribute('is'), // TODO: This could check if this is an extended custom element but this is a controversial spec.954 },955 {name: 'itemID', read: getAttribute('itemid')},956 {name: 'itemProp', read: getAttribute('itemprop')},957 {name: 'itemRef', read: getAttribute('itemref')},958 {name: 'itemScope', read: getAttribute('itemscope')},959 {name: 'itemType', read: getAttribute('itemtype')},960 {961 name: 'k',962 read: getSVGAttribute('k'),963 containerTagName: 'svg',964 tagName: 'hkern',965 },966 {967 name: 'K',968 containerTagName: 'svg',969 tagName: 'hkern',970 read: getSVGAttribute('k'),971 },972 {973 name: 'K1',974 containerTagName: 'svg',975 tagName: 'feComposite',976 read: getSVGProperty('k1'),977 },978 {979 name: 'k1',980 read: getSVGProperty('k1'),981 containerTagName: 'svg',982 tagName: 'feComposite',983 },984 {985 name: 'k2',986 read: getSVGProperty('k2'),987 containerTagName: 'svg',988 tagName: 'feComposite',989 },990 {991 name: 'k3',992 read: getSVGProperty('k3'),993 containerTagName: 'svg',994 tagName: 'feComposite',995 },996 {997 name: 'k4',998 read: getSVGProperty('k4'),999 containerTagName: 'svg',1000 tagName: 'feComposite',1001 },1002 {1003 name: 'kernelMatrix',1004 read: getSVGProperty('kernelMatrix'),1005 containerTagName: 'svg',1006 tagName: 'feConvolveMatrix',1007 overrideStringValue: '1 2 3,4',1008 },1009 {1010 name: 'kernelUnitLength',1011 read: getSVGAttribute('kernelUnitLength'),1012 containerTagName: 'svg',1013 tagName: 'feConvolveMatrix',1014 },1015 {1016 name: 'kerning',1017 containerTagName: 'svg',1018 tagName: 'text',1019 read: getSVGAttribute('kerning'),1020 },1021 {name: 'keyParams', read: getAttribute('keyParams')},1022 {1023 name: 'keyPoints',1024 read: getSVGAttribute('keyPoints'),1025 containerTagName: 'svg',1026 tagName: 'animateMotion',1027 },1028 {1029 name: 'keySplines',1030 read: getSVGAttribute('keySplines'),1031 containerTagName: 'svg',1032 tagName: 'animate',1033 },1034 {1035 name: 'keyTimes',1036 read: getSVGAttribute('keyTimes'),1037 containerTagName: 'svg',1038 tagName: 'animate',1039 },1040 {name: 'keyType', read: getAttribute('keyType')},1041 {name: 'kind', tagName: 'track', overrideStringValue: 'captions'},1042 {name: 'label', tagName: 'track'},1043 {name: 'LANG', read: getProperty('lang')},1044 {name: 'lang'},1045 {name: 'length', read: getAttribute('length')},1046 {1047 name: 'lengthAdjust',1048 read: getSVGProperty('lengthAdjust'),1049 containerTagName: 'svg',1050 tagName: 'text',1051 overrideStringValue: 'spacingAndGlyphs',1052 },1053 {1054 name: 'letter-spacing',1055 containerTagName: 'svg',1056 tagName: 'text',1057 read: getSVGAttribute('letter-spacing'),1058 },1059 {1060 name: 'letterSpacing',1061 containerTagName: 'svg',1062 tagName: 'text',1063 read: getSVGAttribute('letter-spacing'),1064 },1065 {1066 name: 'lighting-color',1067 containerTagName: 'svg',1068 tagName: 'feDiffuseLighting',1069 read: getSVGAttribute('lighting-color'),1070 },1071 {1072 name: 'lightingColor',1073 containerTagName: 'svg',1074 tagName: 'feDiffuseLighting',1075 read: getSVGAttribute('lighting-color'),1076 },1077 {1078 name: 'limitingConeAngle',1079 read: getSVGProperty('limitingConeAngle'),1080 containerTagName: 'svg',1081 tagName: 'feSpotLight',1082 },1083 {name: 'list', read: getAttribute('list')}, // TODO: This should match the ID of a datalist element and then read property.1084 {1085 name: 'local',1086 read: getSVGAttribute('local'),1087 containerTagName: 'svg',1088 tagName: 'color-profile',1089 },1090 {name: 'loop', tagName: 'audio'},1091 {name: 'low', tagName: 'meter'},1092 {name: 'manifest', read: getAttribute('manifest')},1093 {name: 'marginHeight', containerTagName: 'frameset', tagName: 'frame'},1094 {name: 'marginWidth', containerTagName: 'frameset', tagName: 'frame'},1095 {1096 name: 'marker-end',1097 containerTagName: 'svg',1098 tagName: 'line',1099 read: getSVGAttribute('marker-end'),1100 },1101 {1102 name: 'marker-mid',1103 containerTagName: 'svg',1104 tagName: 'line',1105 read: getSVGAttribute('marker-mid'),1106 },1107 {1108 name: 'marker-start',1109 containerTagName: 'svg',1110 tagName: 'line',1111 read: getSVGAttribute('marker-start'),1112 },1113 {1114 name: 'markerEnd',1115 containerTagName: 'svg',1116 tagName: 'line',1117 read: getSVGAttribute('marker-end'),1118 },1119 {1120 name: 'markerHeight',1121 read: getSVGProperty('markerHeight'),1122 containerTagName: 'svg',1123 tagName: 'marker',1124 },1125 {1126 name: 'markerMid',1127 containerTagName: 'svg',1128 tagName: 'line',1129 read: getSVGAttribute('marker-mid'),1130 },1131 {1132 name: 'markerStart',1133 containerTagName: 'svg',1134 tagName: 'line',1135 read: getSVGAttribute('marker-start'),1136 },1137 {1138 name: 'markerUnits',1139 read: getSVGProperty('markerUnits'),1140 containerTagName: 'svg',1141 tagName: 'marker',1142 },1143 {1144 name: 'markerWidth',1145 read: getSVGProperty('markerWidth'),1146 containerTagName: 'svg',1147 tagName: 'marker',1148 },1149 {1150 name: 'mask',1151 containerTagName: 'svg',1152 tagName: 'path',1153 read: getSVGAttribute('mask'),1154 },1155 {1156 name: 'maskContentUnits',1157 read: getSVGProperty('maskContentUnits'),1158 containerTagName: 'svg',1159 tagName: 'mask',1160 overrideStringValue: 'objectBoundingBox',1161 },1162 {1163 name: 'maskUnits',1164 read: getSVGProperty('maskUnits'),1165 containerTagName: 'svg',1166 tagName: 'mask',1167 overrideStringValue: 'userSpaceOnUse',1168 },1169 {1170 name: 'mathematical',1171 read: getSVGAttribute('mathematical'),1172 containerTagName: 'svg',1173 tagName: 'font-face',1174 },1175 {name: 'max', tagName: 'input'},1176 {name: 'max', tagName: 'meter'},1177 {name: 'max', tagName: 'progress'},1178 {1179 name: 'max',1180 containerTagName: 'svg',1181 tagName: 'animate',1182 read: getSVGAttribute('max'),1183 },1184 {name: 'maxLength', tagName: 'textarea'},1185 {name: 'media', tagName: 'link'},1186 {1187 name: 'media',1188 containerTagName: 'svg',1189 tagName: 'style',1190 read: getSVGProperty('media'),1191 },1192 {name: 'mediaGroup', tagName: 'video', read: getAttribute('mediagroup')}, // TODO: Not yet implemented in Chrome.1193 {name: 'method', tagName: 'form', overrideStringValue: 'POST'},1194 {1195 name: 'method',1196 containerTagName: 'svg',1197 tagName: 'textPath',1198 read: getSVGProperty('method'),1199 overrideStringValue: 'stretch',1200 },1201 {name: 'min', tagName: 'input'},1202 {name: 'min', tagName: 'meter'},1203 {1204 name: 'min',1205 containerTagName: 'svg',1206 tagName: 'animate',1207 read: getSVGAttribute('min'),1208 },1209 {name: 'minLength', tagName: 'input'},1210 {1211 name: 'mode',1212 read: getSVGProperty('mode'),1213 containerTagName: 'svg',1214 tagName: 'feBlend',1215 overrideStringValue: 'multiply',1216 },1217 {name: 'multiple', tagName: 'select'},1218 {name: 'muted', tagName: 'video'},1219 {name: 'name', tagName: 'input'},1220 {1221 name: 'name',1222 containerTagName: 'svg',1223 tagName: 'color-profile',1224 read: getSVGAttribute('color-profile'),1225 },1226 {name: 'noModule', tagName: 'script'},1227 {name: 'nonce', read: getAttribute('nonce')},1228 {name: 'noValidate', tagName: 'form'},1229 {1230 name: 'numOctaves',1231 read: getSVGProperty('numOctaves'),1232 containerTagName: 'svg',1233 tagName: 'feTurbulence',1234 },1235 {1236 name: 'offset',1237 read: getSVGProperty('offset'),1238 containerTagName: 'svg',1239 tagName: 'stop',1240 },1241 {name: 'on-click'}, // TODO: Check for event subscriptions1242 {name: 'on-unknownevent'}, // TODO: Check for event subscriptions1243 {name: 'onclick'}, // TODO: Check for event subscriptions1244 {name: 'onClick'}, // TODO: Check for event subscriptions1245 {name: 'onunknownevent'}, // TODO: Check for event subscriptions1246 {name: 'onUnknownEvent'}, // TODO: Check for event subscriptions1247 {1248 name: 'opacity',1249 containerTagName: 'svg',1250 tagName: 'path',1251 read: getSVGAttribute('opacity'),1252 },1253 {name: 'open', tagName: 'details'},1254 {1255 name: 'operator',1256 read: getSVGProperty('operator'),1257 containerTagName: 'svg',1258 tagName: 'feComposite',1259 overrideStringValue: 'xor',1260 },1261 {name: 'optimum', tagName: 'meter'},1262 {1263 name: 'order',1264 read: getSVGAttribute('order'),1265 containerTagName: 'svg',1266 tagName: 'feConvolveMatrix',1267 },1268 {1269 name: 'orient',1270 read: getSVGAttribute('orient'),1271 containerTagName: 'svg',1272 tagName: 'marker',1273 },1274 {1275 name: 'orientation',1276 read: getSVGAttribute('orientation'),1277 containerTagName: 'svg',1278 tagName: 'glyph',1279 },1280 {1281 name: 'origin',1282 read: getSVGAttribute('origin'),1283 containerTagName: 'svg',1284 tagName: 'animateMotion',1285 },1286 {1287 name: 'overflow',1288 containerTagName: 'svg',1289 tagName: 'path',1290 read: getSVGAttribute('overflow'),1291 },1292 {1293 name: 'overline-position',1294 read: getSVGAttribute('overline-position'),1295 containerTagName: 'svg',1296 tagName: 'font-face',1297 },1298 {1299 name: 'overline-thickness',1300 read: getSVGAttribute('overline-thickness'),1301 containerTagName: 'svg',1302 tagName: 'font-face',1303 },1304 {1305 name: 'overlinePosition',1306 read: getSVGAttribute('overline-position'),1307 containerTagName: 'svg',1308 tagName: 'font-face',1309 },1310 {1311 name: 'overlineThickness',1312 read: getSVGAttribute('overline-thickness'),1313 containerTagName: 'svg',1314 tagName: 'font-face',1315 },1316 {1317 name: 'paint-order',1318 containerTagName: 'svg',1319 tagName: 'path',1320 read: getSVGAttribute('paint-order'),1321 },1322 {1323 name: 'paintOrder',1324 containerTagName: 'svg',1325 tagName: 'path',1326 read: getSVGAttribute('paint-order'),1327 },1328 {1329 name: 'panose-1',1330 read: getSVGAttribute('panose-1'),1331 containerTagName: 'svg',1332 tagName: 'font-face',1333 },1334 {1335 name: 'panose1',1336 containerTagName: 'svg',1337 tagName: 'font-face',1338 read: getSVGAttribute('panose-1'),1339 },1340 {1341 name: 'pathLength',1342 read: getSVGProperty('pathLength'),1343 containerTagName: 'svg',1344 tagName: 'path',1345 },1346 {name: 'pattern', tagName: 'input'},1347 {1348 name: 'patternContentUnits',1349 read: getSVGProperty('patternContentUnits'),1350 containerTagName: 'svg',1351 tagName: 'pattern',1352 overrideStringValue: 'objectBoundingBox',1353 },1354 {1355 name: 'patternTransform',1356 read: getSVGProperty('patternTransform'),1357 containerTagName: 'svg',1358 tagName: 'pattern',1359 overrideStringValue:1360 'translate(-10,-20) scale(2) rotate(45) translate(5,10)',1361 },1362 {1363 name: 'patternUnits',1364 read: getSVGProperty('patternUnits'),1365 containerTagName: 'svg',1366 tagName: 'pattern',1367 overrideStringValue: 'userSpaceOnUse',1368 },1369 {name: 'placeholder', tagName: 'input'},1370 {name: 'playsInline', read: getAttribute('playsinline')},1371 {1372 name: 'pointer-events',1373 containerTagName: 'svg',1374 tagName: 'path',1375 read: getSVGAttribute('pointer-events'),1376 },1377 {1378 name: 'pointerEvents',1379 containerTagName: 'svg',1380 tagName: 'path',1381 read: getSVGAttribute('pointer-events'),1382 },1383 {1384 name: 'points',1385 read: getSVGProperty('points'),1386 containerTagName: 'svg',1387 tagName: 'polygon',1388 overrideStringValue: '350,75 379,161 469,161',1389 },1390 {1391 name: 'pointsAtX',1392 read: getSVGProperty('pointsAtX'),1393 containerTagName: 'svg',1394 tagName: 'feSpotLight',1395 },1396 {1397 name: 'pointsAtY',1398 read: getSVGProperty('pointsAtY'),1399 containerTagName: 'svg',1400 tagName: 'feSpotLight',1401 },1402 {1403 name: 'pointsAtZ',1404 read: getSVGProperty('pointsAtZ'),1405 containerTagName: 'svg',1406 tagName: 'feSpotLight',1407 },1408 {1409 name: 'poster',1410 tagName: 'video',1411 overrideStringValue: 'https://reactjs.com',1412 },1413 {name: 'prefix', read: getAttribute('prefix')},1414 {name: 'preload', tagName: 'video', overrideStringValue: 'none'},1415 {1416 name: 'preserveAlpha',1417 read: getSVGProperty('preserveAlpha'),1418 containerTagName: 'svg',1419 tagName: 'feConvolveMatrix',1420 },1421 {1422 name: 'preserveAspectRatio',1423 read: getSVGProperty('preserveAspectRatio'),1424 containerTagName: 'svg',1425 tagName: 'feImage',1426 overrideStringValue: 'xMinYMin slice',1427 },1428 {1429 name: 'primitiveUnits',1430 read: getSVGProperty('primitiveUnits'),1431 containerTagName: 'svg',1432 tagName: 'filter',1433 overrideStringValue: 'objectBoundingBox',1434 },1435 {name: 'profile', read: getAttribute('profile')},1436 {name: 'property', read: getAttribute('property')},1437 {name: 'props', read: getAttribute('props')},1438 {1439 name: 'r',1440 read: getSVGProperty('r'),1441 containerTagName: 'svg',1442 tagName: 'circle',1443 overrideStringValue: '10pt',1444 },1445 {name: 'radioGroup', tagName: 'command', read: getAttribute('radiogroup')},1446 {1447 name: 'radius',1448 read: getSVGAttribute('radius'),1449 containerTagName: 'svg',1450 tagName: 'feMorphology',1451 },1452 {name: 'readOnly', tagName: 'input'},1453 {name: 'referrerPolicy', tagName: 'iframe'},1454 {1455 name: 'refX',1456 read: getSVGProperty('refX'),1457 containerTagName: 'svg',1458 tagName: 'marker',1459 overrideStringValue: '5em',1460 },1461 {1462 name: 'refY',1463 read: getSVGProperty('refY'),1464 containerTagName: 'svg',1465 tagName: 'marker',1466 overrideStringValue: '6em',1467 },1468 {name: 'rel', tagName: 'a'},1469 {1470 name: 'rendering-intent',1471 read: getSVGAttribute('rendering-intent'),1472 containerTagName: 'svg',1473 tagName: 'color-profile',1474 },1475 {1476 name: 'renderingIntent',1477 read: getSVGAttribute('rendering-intent'),1478 containerTagName: 'svg',1479 tagName: 'color-profile',1480 },1481 {1482 name: 'repeatCount',1483 read: getSVGAttribute('repeatcount'),1484 containerTagName: 'svg',1485 tagName: 'animate',1486 },1487 {1488 name: 'repeatDur',1489 read: getSVGAttribute('repeatdur'),1490 containerTagName: 'svg',1491 tagName: 'animate',1492 },1493 {name: 'required', tagName: 'input'},1494 {1495 name: 'requiredExtensions',1496 read: getSVGProperty('requiredExtensions'),1497 containerTagName: 'svg',1498 tagName: 'a',1499 },1500 {1501 name: 'requiredFeatures',1502 read: getSVGAttribute('requiredFeatures'),1503 containerTagName: 'svg',1504 tagName: 'a',1505 },1506 {name: 'resource', read: getAttribute('resource')},1507 {1508 name: 'restart',1509 read: getSVGAttribute('resource'),1510 containerTagName: 'svg',1511 tagName: 'animate',1512 },1513 {1514 name: 'result',1515 read: getSVGProperty('result'),1516 containerTagName: 'svg',1517 tagName: 'feBlend',1518 },1519 {name: 'results', tagName: 'input', read: getAttribute('results')}, // TODO: Should use property but it's not supported in Chrome.1520 {name: 'reversed', tagName: 'ol'},1521 {name: 'role', read: getAttribute('role')},1522 {1523 name: 'rotate',1524 read: getSVGAttribute('role'),1525 containerTagName: 'svg',1526 tagName: 'altGlyph',1527 },1528 {name: 'rows', tagName: 'textarea'},1529 {name: 'rowSpan', containerTagName: 'tr', tagName: 'td'},1530 {1531 name: 'rx',1532 read: getSVGProperty('rx'),1533 containerTagName: 'svg',1534 tagName: 'ellipse',1535 overrideStringValue: '1px',1536 },1537 {1538 name: 'ry',1539 read: getSVGProperty('ry'),1540 containerTagName: 'svg',1541 tagName: 'ellipse',1542 overrideStringValue: '2px',1543 },1544 {1545 name: 'sandbox',1546 tagName: 'iframe',1547 overrideStringValue: 'allow-forms allow-scripts',1548 },1549 {1550 name: 'scale',1551 read: getSVGProperty('scale'),1552 containerTagName: 'svg',1553 tagName: 'feDisplacementMap',1554 },1555 {1556 name: 'scope',1557 containerTagName: 'tr',1558 tagName: 'th',1559 overrideStringValue: 'row',1560 },1561 {name: 'scoped', tagName: 'style', read: getAttribute('scoped')},1562 {name: 'scrolling', tagName: 'iframe', overrideStringValue: 'no'},1563 {name: 'seamless', tagName: 'iframe', read: getAttribute('seamless')},1564 {name: 'security', tagName: 'iframe', read: getAttribute('security')},1565 {1566 name: 'seed',1567 read: getSVGProperty('seed'),1568 containerTagName: 'svg',1569 tagName: 'feTurbulence',1570 },1571 {name: 'selected', tagName: 'option', containerTagName: 'select'},1572 {name: 'selectedIndex', tagName: 'select'},1573 {name: 'shape', tagName: 'a'},1574 {1575 name: 'shape-rendering',1576 tagName: 'svg',1577 read: getSVGAttribute('shape-rendering'),1578 },1579 {1580 name: 'shapeRendering',1581 tagName: 'svg',1582 read: getSVGAttribute('shape-rendering'),1583 },1584 {name: 'size', tagName: 'input'},1585 {name: 'sizes', tagName: 'link'},1586 {1587 name: 'slope',1588 read: getSVGAttribute('slope'),1589 containerTagName: 'svg',1590 tagName: 'font-face',1591 },1592 {1593 name: 'spacing',1594 read: getSVGProperty('spacing'),1595 containerTagName: 'svg',1596 tagName: 'textPath',1597 overrideStringValue: 'auto',1598 },1599 {name: 'span', containerTagName: 'colgroup', tagName: 'col'},1600 {1601 name: 'specularConstant',1602 read: getSVGProperty('specularConstant'),1603 containerTagName: 'svg',1604 tagName: 'feSpecularLighting',1605 },1606 {1607 name: 'specularExponent',1608 read: getSVGProperty('specularConstant'),1609 containerTagName: 'svg',1610 tagName: 'feSpecularLighting',1611 },1612 {name: 'speed', read: getAttribute('speed')},1613 {1614 name: 'spellCheck',1615 overrideStringValue: 'false',1616 tagName: 'input',1617 read: getProperty('spellcheck'),1618 },1619 {1620 name: 'spellcheck',1621 overrideStringValue: 'false',1622 tagName: 'input',1623 read: getProperty('spellcheck'),1624 },1625 {1626 name: 'spreadMethod',1627 read: getSVGProperty('spreadMethod'),1628 containerTagName: 'svg',1629 tagName: 'linearGradient',1630 overrideStringValue: 'reflect',1631 },1632 {name: 'src', tagName: 'img', overrideStringValue: 'https://reactjs.com'},1633 {1634 name: 'srcDoc',1635 tagName: 'iframe',1636 overrideStringValue: '<p>Hi</p>',1637 read: getProperty('srcdoc'),1638 },1639 {1640 name: 'srcdoc',1641 tagName: 'iframe',1642 overrideStringValue: '<p>Hi</p>',1643 read: getProperty('srcdoc'),1644 },1645 {1646 name: 'srcLang',1647 containerTagName: 'audio',1648 tagName: 'track',1649 overrideStringValue: 'en',1650 read: getProperty('srclang'),1651 },1652 {1653 name: 'srclang',1654 containerTagName: 'audio',1655 tagName: 'track',1656 overrideStringValue: 'en',1657 read: getProperty('srclang'),1658 },1659 {name: 'srcSet', tagName: 'img'},1660 {name: 'srcset', tagName: 'img'},1661 {name: 'start', tagName: 'ol'},1662 {1663 name: 'startOffset',1664 read: getSVGProperty('startOffset'),1665 containerTagName: 'svg',1666 tagName: 'textPath',1667 },1668 {name: 'state', read: getAttribute('state')},1669 {1670 name: 'stdDeviation',1671 read: getSVGAttribute('stdDeviation'),1672 containerTagName: 'svg',1673 tagName: 'feGaussianBlur',1674 },1675 {1676 name: 'stemh',1677 read: getSVGAttribute('stemh'),1678 containerTagName: 'svg',1679 tagName: 'font-face',1680 },1681 {1682 name: 'stemv',1683 read: getSVGAttribute('stemv'),1684 containerTagName: 'svg',1685 tagName: 'font-face',1686 },1687 {name: 'step', read: getAttribute('step')},1688 {1689 name: 'stitchTiles',1690 read: getSVGProperty('stitchTiles'),1691 containerTagName: 'svg',1692 tagName: 'feTurbulence',1693 overrideStringValue: 'stitch',1694 },1695 {1696 name: 'stop-color',1697 containerTagName: 'svg',1698 tagName: 'stop',1699 read: getSVGAttribute('stop-color'),1700 },1701 {1702 name: 'stop-opacity',1703 containerTagName: 'svg',1704 tagName: 'stop',1705 read: getSVGAttribute('stop-opacity'),1706 },1707 {1708 name: 'stopColor',1709 containerTagName: 'svg',1710 tagName: 'stop',1711 read: getSVGAttribute('stop-color'),1712 },1713 {1714 name: 'stopOpacity',1715 containerTagName: 'svg',1716 tagName: 'stop',1717 read: getSVGAttribute('stop-opacity'),1718 },1719 {1720 name: 'strikethrough-position',1721 read: getSVGAttribute('strikethrough-position'),1722 containerTagName: 'svg',1723 tagName: 'font-face',1724 },1725 {1726 name: 'strikethrough-thickness',1727 read: getSVGAttribute('strikethrough-thickness'),1728 containerTagName: 'svg',1729 tagName: 'font-face',1730 },1731 {1732 name: 'strikethroughPosition',1733 read: getSVGAttribute('strikethrough-position'),1734 containerTagName: 'svg',1735 tagName: 'font-face',1736 },1737 {1738 name: 'strikethroughThickness',1739 read: getSVGAttribute('strikethrough-thickness'),1740 containerTagName: 'svg',1741 tagName: 'font-face',1742 },1743 {1744 name: 'string',1745 read: getSVGAttribute('string'),1746 containerTagName: 'svg',1747 tagName: 'font-face-format',1748 },1749 {1750 name: 'stroke',1751 containerTagName: 'svg',1752 tagName: 'path',1753 read: getSVGAttribute('stroke'),1754 },1755 {1756 name: 'stroke-dasharray',1757 containerTagName: 'svg',1758 tagName: 'path',1759 read: getSVGAttribute('stroke-dasharray'),1760 },1761 {1762 name: 'stroke-Dasharray',1763 containerTagName: 'svg',1764 tagName: 'path',1765 read: getSVGAttribute('stroke-dasharray'),1766 },1767 {1768 name: 'stroke-dashoffset',1769 containerTagName: 'svg',1770 tagName: 'path',1771 read: getSVGAttribute('stroke-dashoffset'),1772 },1773 {1774 name: 'stroke-linecap',1775 containerTagName: 'svg',1776 tagName: 'path',1777 read: getSVGAttribute('stroke-linecap'),1778 },1779 {1780 name: 'stroke-linejoin',1781 containerTagName: 'svg',1782 tagName: 'path',1783 read: getSVGAttribute('stroke-linejoin'),1784 },1785 {1786 name: 'stroke-miterlimit',1787 containerTagName: 'svg',1788 tagName: 'path',1789 read: getSVGAttribute('stroke-miterlimit'),1790 },1791 {1792 name: 'stroke-opacity',1793 containerTagName: 'svg',1794 tagName: 'path',1795 read: getSVGAttribute('stroke-opacity'),1796 },1797 {1798 name: 'stroke-width',1799 containerTagName: 'svg',1800 tagName: 'path',1801 read: getSVGAttribute('stroke-width'),1802 },1803 {1804 name: 'strokeDasharray',1805 containerTagName: 'svg',1806 tagName: 'path',1807 read: getSVGAttribute('stroke-dasharray'),1808 },1809 {1810 name: 'strokeDashoffset',1811 containerTagName: 'svg',1812 tagName: 'path',1813 read: getSVGAttribute('stroke-dashoffset'),1814 },1815 {1816 name: 'strokeLinecap',1817 containerTagName: 'svg',1818 tagName: 'path',1819 read: getSVGAttribute('stroke-linecap'),1820 },1821 {1822 name: 'strokeLinejoin',1823 containerTagName: 'svg',1824 tagName: 'path',1825 read: getSVGAttribute('stroke-linejoin'),1826 },1827 {1828 name: 'strokeMiterlimit',1829 containerTagName: 'svg',1830 tagName: 'path',1831 read: getSVGAttribute('stroke-miterlimit'),1832 },1833 {1834 name: 'strokeOpacity',1835 containerTagName: 'svg',1836 tagName: 'path',1837 read: getSVGAttribute('stroke-opacity'),1838 },1839 {1840 name: 'strokeWidth',1841 containerTagName: 'svg',1842 tagName: 'path',1843 read: getSVGAttribute('stroke-width'),1844 },1845 {name: 'style'},1846 {name: 'summary', tagName: 'table'},1847 {1848 name: 'suppressContentEditableWarning',1849 read: getAttribute('suppresscontenteditablewarning'),1850 },1851 {1852 name: 'surfaceScale',1853 read: getSVGProperty('surfaceScale'),1854 containerTagName: 'svg',1855 tagName: 'feDiffuseLighting',1856 },1857 {1858 name: 'systemLanguage',1859 overrideStringValue: 'en',1860 read: getSVGProperty('systemLanguage'),1861 containerTagName: 'svg',1862 tagName: 'a',1863 },1864 {name: 'tabIndex'},1865 {1866 name: 'tabIndex',1867 read: getSVGProperty('tabIndex'),1868 tagName: 'svg',1869 },1870 {1871 name: 'tableValues',1872 read: getSVGProperty('tableValues'),1873 containerTagName: 'svg',1874 tagName: 'feFuncA',1875 overrideStringValue: '0 1 2 3',1876 },1877 {1878 name: 'target',1879 read: getSVGProperty('target'),1880 containerTagName: 'svg',1881 tagName: 'a',1882 },1883 {1884 name: 'targetX',1885 read: getSVGProperty('targetX'),1886 containerTagName: 'svg',1887 tagName: 'feConvolveMatrix',1888 },1889 {1890 name: 'targetY',1891 read: getSVGProperty('targetY'),1892 containerTagName: 'svg',1893 tagName: 'feConvolveMatrix',1894 },1895 {1896 name: 'text-anchor',1897 containerTagName: 'svg',1898 tagName: 'text',1899 read: getSVGAttribute('text-anchor'),1900 },1901 {1902 name: 'text-decoration',1903 containerTagName: 'svg',1904 tagName: 'text',1905 read: getSVGAttribute('text-decoration'),1906 },1907 {1908 name: 'text-rendering',1909 tagName: 'svg',1910 read: getSVGAttribute('text-rendering'),1911 },1912 {1913 name: 'textAnchor',1914 containerTagName: 'svg',1915 tagName: 'text',1916 read: getSVGAttribute('text-anchor'),1917 },1918 {1919 name: 'textDecoration',1920 containerTagName: 'svg',1921 tagName: 'text',1922 read: getSVGAttribute('text-decoration'),1923 },1924 {1925 name: 'textLength',1926 read: getSVGProperty('textLength'),1927 containerTagName: 'svg',1928 tagName: 'text',1929 },1930 {1931 name: 'textRendering',1932 tagName: 'svg',1933 read: getSVGAttribute('text-rendering'),1934 },1935 {name: 'title'},1936 {1937 name: 'to',1938 read: getSVGAttribute('to'),1939 containerTagName: 'svg',1940 tagName: 'set',1941 },1942 {1943 name: 'transform',1944 read: getSVGProperty('transform'),1945 containerTagName: 'svg',1946 tagName: 'a',1947 overrideStringValue:1948 'translate(-10,-20) scale(2) rotate(45) translate(5,10)',1949 },1950 {name: 'type', tagName: 'button', overrideStringValue: 'reset'},1951 {1952 name: 'type',1953 containerTagName: 'svg',1954 tagName: 'feFuncA',1955 read: getSVGProperty('type'),1956 overrideStringValue: 'discrete',1957 },1958 {name: 'typeof', read: getAttribute('typeof')},1959 {1960 name: 'u1',1961 read: getSVGAttribute('u1'),1962 containerTagName: 'svg',1963 tagName: 'hkern',1964 },1965 {1966 name: 'u2',1967 read: getSVGAttribute('u2'),1968 containerTagName: 'svg',1969 tagName: 'hkern',1970 },1971 {1972 name: 'underline-position',1973 read: getSVGAttribute('underline-position'),1974 containerTagName: 'svg',1975 tagName: 'font-face',1976 },1977 {1978 name: 'underline-thickness',1979 read: getSVGAttribute('underline-thickness'),1980 containerTagName: 'svg',1981 tagName: 'font-face',1982 },1983 {1984 name: 'underlinePosition',1985 read: getSVGAttribute('underline-position'),1986 containerTagName: 'svg',1987 tagName: 'font-face',1988 },1989 {1990 name: 'underlineThickness',1991 read: getSVGAttribute('underline-thickness'),1992 containerTagName: 'svg',1993 tagName: 'font-face',1994 },1995 {1996 name: 'unicode',1997 read: getSVGAttribute('unicode'),1998 containerTagName: 'svg',1999 tagName: 'glyph',2000 },2001 {2002 name: 'unicode-bidi',2003 containerTagName: 'svg',2004 tagName: 'text',2005 read: getSVGAttribute('unicode-bidi'),2006 },2007 {2008 name: 'unicode-range',2009 read: getSVGAttribute('unicode-range'),2010 containerTagName: 'svg',2011 tagName: 'font-face',2012 },2013 {2014 name: 'unicodeBidi',2015 containerTagName: 'svg',2016 tagName: 'text',2017 read: getSVGAttribute('unicode-bidi'),2018 },2019 {2020 name: 'unicodeRange',2021 read: getSVGAttribute('unicode-range'),2022 containerTagName: 'svg',2023 tagName: 'font-face',2024 },2025 {2026 name: 'units-per-em',2027 read: getSVGAttribute('units-per-em'),2028 containerTagName: 'svg',2029 tagName: 'font-face',2030 },2031 {2032 name: 'unitsPerEm',2033 read: getSVGAttribute('unites-per-em'),2034 containerTagName: 'svg',2035 tagName: 'font-face',2036 },2037 {name: 'unknown', read: getAttribute('unknown')},2038 {2039 name: 'unselectable',2040 read: getAttribute('unselectable'),2041 tagName: 'span',2042 overrideStringValue: 'on',2043 },2044 {name: 'useMap', tagName: 'img'},2045 {2046 name: 'v-alphabetic',2047 read: getSVGAttribute('v-alphabetic'),2048 containerTagName: 'svg',2049 tagName: 'font-face',2050 },2051 {2052 name: 'v-hanging',2053 read: getSVGAttribute('v-hanging'),2054 containerTagName: 'svg',2055 tagName: 'font-face',2056 },2057 {2058 name: 'v-ideographic',2059 read: getSVGAttribute('v-ideographic'),2060 containerTagName: 'svg',2061 tagName: 'font-face',2062 },2063 {2064 name: 'v-mathematical',2065 read: getSVGAttribute('v-mathematical'),2066 containerTagName: 'svg',2067 tagName: 'font-face',2068 },2069 {2070 name: 'vAlphabetic',2071 read: getSVGAttribute('v-alphabetic'),2072 containerTagName: 'svg',2073 tagName: 'font-face',2074 },2075 {name: 'value', tagName: 'input', extraProps: {onChange() {}}},2076 {name: 'value', tagName: 'input', type: 'email', extraProps: {onChange() {}}},2077 {2078 name: 'value',2079 tagName: 'input',2080 type: 'number',2081 extraProps: {onChange() {}},2082 },2083 {name: 'value', tagName: 'textarea', extraProps: {onChange() {}}},2084 {2085 name: 'value',2086 containerTagName: 'select',2087 tagName: 'option',2088 extraProps: {onChange() {}},2089 },2090 {2091 name: 'Value',2092 containerTagName: 'select',2093 tagName: 'option',2094 read: getProperty('value'),2095 },2096 {2097 name: 'values',2098 read: getSVGProperty('values'),2099 containerTagName: 'svg',2100 tagName: 'feColorMatrix',2101 overrideStringValue: '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0',2102 },2103 {2104 name: 'vector-effect',2105 containerTagName: 'svg',2106 tagName: 'line',2107 read: getSVGAttribute('vector-effect'),2108 },2109 {2110 name: 'vectorEffect',2111 containerTagName: 'svg',2112 tagName: 'line',2113 read: getSVGAttribute('vector-effect'),2114 },2115 {name: 'version', containerTagName: 'document', tagName: 'html'},2116 {name: 'version', tagName: 'svg', read: getSVGAttribute('version')},2117 {2118 name: 'vert-adv-y',2119 read: getSVGAttribute('vert-origin-y'),2120 containerTagName: 'svg',2121 tagName: 'font',2122 },2123 {2124 name: 'vert-origin-x',2125 read: getSVGAttribute('vert-origin-y'),2126 containerTagName: 'svg',2127 tagName: 'font',2128 },2129 {2130 name: 'vert-origin-y',2131 read: getSVGAttribute('vert-origin-y'),2132 containerTagName: 'svg',2133 tagName: 'font',2134 },2135 {2136 name: 'vertAdvY',2137 read: getSVGAttribute('vert-adv-y'),2138 containerTagName: 'svg',2139 tagName: 'font',2140 },2141 {2142 name: 'vertOriginX',2143 read: getSVGAttribute('vert-origin-x'),2144 containerTagName: 'svg',2145 tagName: 'font',2146 },2147 {2148 name: 'vertOriginY',2149 read: getSVGAttribute('vert-origin-y'),2150 containerTagName: 'svg',2151 tagName: 'font',2152 },2153 {2154 name: 'vHanging',2155 read: getSVGAttribute('v-hanging'),2156 containerTagName: 'svg',2157 tagName: 'font-face',2158 },2159 {2160 name: 'vIdeographic',2161 read: getSVGAttribute('v-ideographic'),2162 containerTagName: 'svg',2163 tagName: 'font-face',2164 },2165 {2166 name: 'viewBox',2167 read: getSVGProperty('viewBox'),2168 containerTagName: 'svg',2169 tagName: 'marker',2170 overrideStringValue: '0 0 1500 1000',2171 },2172 {2173 name: 'viewTarget',2174 read: getSVGAttribute('viewTarget'),2175 containerTagName: 'svg',2176 tagName: 'view',2177 },2178 {name: 'visibility', read: getAttribute('visibility')},2179 {2180 name: 'visibility',2181 containerTagName: 'svg',2182 tagName: 'path',2183 read: getSVGAttribute('visibility'),2184 },2185 {2186 name: 'vMathematical',2187 read: getSVGAttribute('v-mathematical'),2188 containerTagName: 'svg',2189 tagName: 'font-face',2190 },2191 {name: 'vocab', read: getAttribute('vocab')},2192 {name: 'width', tagName: 'img'},2193 {2194 name: 'width',2195 containerTagName: 'svg',2196 tagName: 'rect',2197 read: getSVGProperty('width'),2198 },2199 {2200 name: 'widths',2201 read: getSVGAttribute('widths'),2202 containerTagName: 'svg',2203 tagName: 'font-face',2204 },2205 {name: 'wmode', read: getAttribute('wmode'), tagName: 'embed'},2206 {2207 name: 'word-spacing',2208 containerTagName: 'svg',2209 tagName: 'text',2210 read: getSVGAttribute('word-spacing'),2211 },2212 {2213 name: 'wordSpacing',2214 containerTagName: 'svg',2215 tagName: 'text',2216 read: getSVGAttribute('word-spacing'),2217 },2218 {name: 'wrap', tagName: 'textarea'},2219 {2220 name: 'writing-mode',2221 containerTagName: 'svg',2222 tagName: 'text',2223 read: getSVGAttribute('writing-mode'),2224 },2225 {2226 name: 'writingMode',2227 containerTagName: 'svg',2228 tagName: 'text',2229 read: getSVGAttribute('writing-mode'),2230 },2231 {2232 name: 'x',2233 read: getSVGAttribute('x'),2234 containerTagName: 'svg',2235 tagName: 'altGlyph',2236 },2237 {2238 name: 'x-height',2239 read: getSVGAttribute('x-height'),2240 containerTagName: 'svg',2241 tagName: 'font-face',2242 },2243 {2244 name: 'x1',2245 read: getSVGProperty('x1'),2246 containerTagName: 'svg',2247 tagName: 'line',2248 },2249 {2250 name: 'x2',2251 read: getSVGProperty('x2'),2252 containerTagName: 'svg',2253 tagName: 'line',2254 },2255 {2256 name: 'xChannelSelector',2257 read: getSVGProperty('xChannelSelector'),2258 containerTagName: 'svg',2259 tagName: 'feDisplacementMap',2260 overrideStringValue: 'R',2261 },2262 {2263 name: 'xHeight',2264 read: getSVGAttribute('x-height'),2265 containerTagName: 'svg',2266 tagName: 'font-face',2267 },2268 {name: 'XLink:Actuate', read: getAttribute('XLink:Actuate')},2269 {name: 'xlink:actuate', read: getAttribute('xlink:actuate')},2270 {name: 'xlink:arcrole', read: getAttribute('xlink:arcrole')},2271 {name: 'xlink:href', read: getAttribute('xlink:href')},2272 {name: 'xlink:role', read: getAttribute('xlink:role')},2273 {name: 'xlink:show', read: getAttribute('xlink:show')},2274 {name: 'xlink:title', read: getAttribute('xlink:title')},2275 {name: 'xlink:type', read: getAttribute('xlink:type')},2276 {name: 'xlinkActuate', read: getAttribute('xlink:actuate')},2277 {name: 'XlinkActuate', read: getAttribute('Xlink:actuate')},2278 {name: 'xlinkArcrole', read: getAttribute('xlink:arcrole')},2279 {name: 'xlinkHref', read: getAttribute('xlink:href')},2280 {name: 'xlinkRole', read: getAttribute('xlink:role')},2281 {name: 'xlinkShow', read: getAttribute('xlink:show')},2282 {name: 'xlinkTitle', read: getAttribute('xlink:title')},2283 {name: 'xlinkType', read: getAttribute('xlink:type')},2284 {name: 'xml:base', read: getAttribute('xml:base')},2285 {name: 'xml:lang', read: getAttribute('xml:lang')},2286 {name: 'xml:space', read: getAttribute('xml:space')},2287 {name: 'xmlBase', read: getAttribute('xml:base')},2288 {name: 'xmlLang', read: getAttribute('xml:lang')},2289 {name: 'xmlns', read: getProperty('namespaceURI'), tagName: 'svg'},2290 {name: 'xmlns:xlink', read: getAttribute('xmlns:xlink')},2291 {name: 'xmlnsXlink', read: getAttribute('xmlns:xlink')},2292 {name: 'xmlSpace', read: getAttribute('xml:space')},2293 {2294 name: 'y',2295 read: getSVGAttribute('y'),2296 containerTagName: 'svg',2297 tagName: 'altGlyph',2298 },2299 {2300 name: 'y1',2301 read: getSVGProperty('y1'),2302 containerTagName: 'svg',2303 tagName: 'line',2304 },2305 {2306 name: 'y2',2307 read: getSVGProperty('y2'),2308 containerTagName: 'svg',2309 tagName: 'line',2310 },2311 {2312 name: 'yChannelSelector',2313 read: getSVGProperty('yChannelSelector'),2314 containerTagName: 'svg',2315 tagName: 'feDisplacementMap',2316 overrideStringValue: 'B',2317 },2318 {2319 name: 'z',2320 read: getSVGProperty('z'),2321 containerTagName: 'svg',2322 tagName: 'fePointLight',2323 },2324 {name: 'zoomAndPan', read: getSVGProperty('zoomAndPan'), tagName: 'svg'},2325];2326attributes.forEach(attr => {2327 attr.read = attr.read || getProperty(attr.name);2328});...

Full Screen

Full Screen

b3793702.goog.dom.tagname.js

Source:b3793702.goog.dom.tagname.js Github

copy

Full Screen

1// Copyright 2007 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14/**15 * @fileoverview Defines the goog.dom.TagName class. Its constants enumerate16 * all HTML tag names specified in either the W3C HTML 4.01 index of elements17 * or the HTML5.1 specification.18 *19 * References:20 * https://www.w3.org/TR/html401/index/elements.html21 * https://www.w3.org/TR/html51/dom.html#elements22 */23goog.provide('goog.dom.TagName');24goog.require('goog.dom.HtmlElement');25/**26 * A tag name with the type of the element stored in the generic.27 * @param {string} tagName28 * @constructor29 * @template T30 */31goog.dom.TagName = function(tagName) {32 /** @private {string} */33 this.tagName_ = tagName;34};35/**36 * Returns the tag name.37 * @return {string}38 * @override39 */40goog.dom.TagName.prototype.toString = function() {41 return this.tagName_;42};43// Closure Compiler unconditionally converts the following constants to their44// string value (goog.dom.TagName.A -> 'A'). These are the consequences:45// 1. Don't add any members or static members to goog.dom.TagName as they46// couldn't be accessed after this optimization.47// 2. Keep the constant name and its string value the same:48// goog.dom.TagName.X = new goog.dom.TagName('Y');49// is converted to 'X', not 'Y'.50/** @type {!goog.dom.TagName<!HTMLAnchorElement>} */51goog.dom.TagName.A = new goog.dom.TagName('A');52/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */53goog.dom.TagName.ABBR = new goog.dom.TagName('ABBR');54/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */55goog.dom.TagName.ACRONYM = new goog.dom.TagName('ACRONYM');56/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */57goog.dom.TagName.ADDRESS = new goog.dom.TagName('ADDRESS');58/** @type {!goog.dom.TagName<!HTMLAppletElement>} */59goog.dom.TagName.APPLET = new goog.dom.TagName('APPLET');60/** @type {!goog.dom.TagName<!HTMLAreaElement>} */61goog.dom.TagName.AREA = new goog.dom.TagName('AREA');62/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */63goog.dom.TagName.ARTICLE = new goog.dom.TagName('ARTICLE');64/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */65goog.dom.TagName.ASIDE = new goog.dom.TagName('ASIDE');66/** @type {!goog.dom.TagName<!HTMLAudioElement>} */67goog.dom.TagName.AUDIO = new goog.dom.TagName('AUDIO');68/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */69goog.dom.TagName.B = new goog.dom.TagName('B');70/** @type {!goog.dom.TagName<!HTMLBaseElement>} */71goog.dom.TagName.BASE = new goog.dom.TagName('BASE');72/** @type {!goog.dom.TagName<!HTMLBaseFontElement>} */73goog.dom.TagName.BASEFONT = new goog.dom.TagName('BASEFONT');74/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */75goog.dom.TagName.BDI = new goog.dom.TagName('BDI');76/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */77goog.dom.TagName.BDO = new goog.dom.TagName('BDO');78/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */79goog.dom.TagName.BIG = new goog.dom.TagName('BIG');80/** @type {!goog.dom.TagName<!HTMLQuoteElement>} */81goog.dom.TagName.BLOCKQUOTE = new goog.dom.TagName('BLOCKQUOTE');82/** @type {!goog.dom.TagName<!HTMLBodyElement>} */83goog.dom.TagName.BODY = new goog.dom.TagName('BODY');84/** @type {!goog.dom.TagName<!HTMLBRElement>} */85goog.dom.TagName.BR = new goog.dom.TagName('BR');86/** @type {!goog.dom.TagName<!HTMLButtonElement>} */87goog.dom.TagName.BUTTON = new goog.dom.TagName('BUTTON');88/** @type {!goog.dom.TagName<!HTMLCanvasElement>} */89goog.dom.TagName.CANVAS = new goog.dom.TagName('CANVAS');90/** @type {!goog.dom.TagName<!HTMLTableCaptionElement>} */91goog.dom.TagName.CAPTION = new goog.dom.TagName('CAPTION');92/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */93goog.dom.TagName.CENTER = new goog.dom.TagName('CENTER');94/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */95goog.dom.TagName.CITE = new goog.dom.TagName('CITE');96/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */97goog.dom.TagName.CODE = new goog.dom.TagName('CODE');98/** @type {!goog.dom.TagName<!HTMLTableColElement>} */99goog.dom.TagName.COL = new goog.dom.TagName('COL');100/** @type {!goog.dom.TagName<!HTMLTableColElement>} */101goog.dom.TagName.COLGROUP = new goog.dom.TagName('COLGROUP');102/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */103goog.dom.TagName.COMMAND = new goog.dom.TagName('COMMAND');104/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */105goog.dom.TagName.DATA = new goog.dom.TagName('DATA');106/** @type {!goog.dom.TagName<!HTMLDataListElement>} */107goog.dom.TagName.DATALIST = new goog.dom.TagName('DATALIST');108/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */109goog.dom.TagName.DD = new goog.dom.TagName('DD');110/** @type {!goog.dom.TagName<!HTMLModElement>} */111goog.dom.TagName.DEL = new goog.dom.TagName('DEL');112/** @type {!goog.dom.TagName<!HTMLDetailsElement>} */113goog.dom.TagName.DETAILS = new goog.dom.TagName('DETAILS');114/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */115goog.dom.TagName.DFN = new goog.dom.TagName('DFN');116/** @type {!goog.dom.TagName<!HTMLDialogElement>} */117goog.dom.TagName.DIALOG = new goog.dom.TagName('DIALOG');118/** @type {!goog.dom.TagName<!HTMLDirectoryElement>} */119goog.dom.TagName.DIR = new goog.dom.TagName('DIR');120/** @type {!goog.dom.TagName<!HTMLDivElement>} */121goog.dom.TagName.DIV = new goog.dom.TagName('DIV');122/** @type {!goog.dom.TagName<!HTMLDListElement>} */123goog.dom.TagName.DL = new goog.dom.TagName('DL');124/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */125goog.dom.TagName.DT = new goog.dom.TagName('DT');126/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */127goog.dom.TagName.EM = new goog.dom.TagName('EM');128/** @type {!goog.dom.TagName<!HTMLEmbedElement>} */129goog.dom.TagName.EMBED = new goog.dom.TagName('EMBED');130/** @type {!goog.dom.TagName<!HTMLFieldSetElement>} */131goog.dom.TagName.FIELDSET = new goog.dom.TagName('FIELDSET');132/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */133goog.dom.TagName.FIGCAPTION = new goog.dom.TagName('FIGCAPTION');134/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */135goog.dom.TagName.FIGURE = new goog.dom.TagName('FIGURE');136/** @type {!goog.dom.TagName<!HTMLFontElement>} */137goog.dom.TagName.FONT = new goog.dom.TagName('FONT');138/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */139goog.dom.TagName.FOOTER = new goog.dom.TagName('FOOTER');140/** @type {!goog.dom.TagName<!HTMLFormElement>} */141goog.dom.TagName.FORM = new goog.dom.TagName('FORM');142/** @type {!goog.dom.TagName<!HTMLFrameElement>} */143goog.dom.TagName.FRAME = new goog.dom.TagName('FRAME');144/** @type {!goog.dom.TagName<!HTMLFrameSetElement>} */145goog.dom.TagName.FRAMESET = new goog.dom.TagName('FRAMESET');146/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */147goog.dom.TagName.H1 = new goog.dom.TagName('H1');148/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */149goog.dom.TagName.H2 = new goog.dom.TagName('H2');150/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */151goog.dom.TagName.H3 = new goog.dom.TagName('H3');152/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */153goog.dom.TagName.H4 = new goog.dom.TagName('H4');154/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */155goog.dom.TagName.H5 = new goog.dom.TagName('H5');156/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */157goog.dom.TagName.H6 = new goog.dom.TagName('H6');158/** @type {!goog.dom.TagName<!HTMLHeadElement>} */159goog.dom.TagName.HEAD = new goog.dom.TagName('HEAD');160/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */161goog.dom.TagName.HEADER = new goog.dom.TagName('HEADER');162/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */163goog.dom.TagName.HGROUP = new goog.dom.TagName('HGROUP');164/** @type {!goog.dom.TagName<!HTMLHRElement>} */165goog.dom.TagName.HR = new goog.dom.TagName('HR');166/** @type {!goog.dom.TagName<!HTMLHtmlElement>} */167goog.dom.TagName.HTML = new goog.dom.TagName('HTML');168/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */169goog.dom.TagName.I = new goog.dom.TagName('I');170/** @type {!goog.dom.TagName<!HTMLIFrameElement>} */171goog.dom.TagName.IFRAME = new goog.dom.TagName('IFRAME');172/** @type {!goog.dom.TagName<!HTMLImageElement>} */173goog.dom.TagName.IMG = new goog.dom.TagName('IMG');174/** @type {!goog.dom.TagName<!HTMLInputElement>} */175goog.dom.TagName.INPUT = new goog.dom.TagName('INPUT');176/** @type {!goog.dom.TagName<!HTMLModElement>} */177goog.dom.TagName.INS = new goog.dom.TagName('INS');178/** @type {!goog.dom.TagName<!HTMLIsIndexElement>} */179goog.dom.TagName.ISINDEX = new goog.dom.TagName('ISINDEX');180/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */181goog.dom.TagName.KBD = new goog.dom.TagName('KBD');182// HTMLKeygenElement is deprecated.183/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */184goog.dom.TagName.KEYGEN = new goog.dom.TagName('KEYGEN');185/** @type {!goog.dom.TagName<!HTMLLabelElement>} */186goog.dom.TagName.LABEL = new goog.dom.TagName('LABEL');187/** @type {!goog.dom.TagName<!HTMLLegendElement>} */188goog.dom.TagName.LEGEND = new goog.dom.TagName('LEGEND');189/** @type {!goog.dom.TagName<!HTMLLIElement>} */190goog.dom.TagName.LI = new goog.dom.TagName('LI');191/** @type {!goog.dom.TagName<!HTMLLinkElement>} */192goog.dom.TagName.LINK = new goog.dom.TagName('LINK');193/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */194goog.dom.TagName.MAIN = new goog.dom.TagName('MAIN');195/** @type {!goog.dom.TagName<!HTMLMapElement>} */196goog.dom.TagName.MAP = new goog.dom.TagName('MAP');197/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */198goog.dom.TagName.MARK = new goog.dom.TagName('MARK');199/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */200goog.dom.TagName.MATH = new goog.dom.TagName('MATH');201/** @type {!goog.dom.TagName<!HTMLMenuElement>} */202goog.dom.TagName.MENU = new goog.dom.TagName('MENU');203/** @type {!goog.dom.TagName<!HTMLMenuItemElement>} */204goog.dom.TagName.MENUITEM = new goog.dom.TagName('MENUITEM');205/** @type {!goog.dom.TagName<!HTMLMetaElement>} */206goog.dom.TagName.META = new goog.dom.TagName('META');207/** @type {!goog.dom.TagName<!HTMLMeterElement>} */208goog.dom.TagName.METER = new goog.dom.TagName('METER');209/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */210goog.dom.TagName.NAV = new goog.dom.TagName('NAV');211/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */212goog.dom.TagName.NOFRAMES = new goog.dom.TagName('NOFRAMES');213/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */214goog.dom.TagName.NOSCRIPT = new goog.dom.TagName('NOSCRIPT');215/** @type {!goog.dom.TagName<!HTMLObjectElement>} */216goog.dom.TagName.OBJECT = new goog.dom.TagName('OBJECT');217/** @type {!goog.dom.TagName<!HTMLOListElement>} */218goog.dom.TagName.OL = new goog.dom.TagName('OL');219/** @type {!goog.dom.TagName<!HTMLOptGroupElement>} */220goog.dom.TagName.OPTGROUP = new goog.dom.TagName('OPTGROUP');221/** @type {!goog.dom.TagName<!HTMLOptionElement>} */222goog.dom.TagName.OPTION = new goog.dom.TagName('OPTION');223/** @type {!goog.dom.TagName<!HTMLOutputElement>} */224goog.dom.TagName.OUTPUT = new goog.dom.TagName('OUTPUT');225/** @type {!goog.dom.TagName<!HTMLParagraphElement>} */226goog.dom.TagName.P = new goog.dom.TagName('P');227/** @type {!goog.dom.TagName<!HTMLParamElement>} */228goog.dom.TagName.PARAM = new goog.dom.TagName('PARAM');229/** @type {!goog.dom.TagName<!HTMLPictureElement>} */230goog.dom.TagName.PICTURE = new goog.dom.TagName('PICTURE');231/** @type {!goog.dom.TagName<!HTMLPreElement>} */232goog.dom.TagName.PRE = new goog.dom.TagName('PRE');233/** @type {!goog.dom.TagName<!HTMLProgressElement>} */234goog.dom.TagName.PROGRESS = new goog.dom.TagName('PROGRESS');235/** @type {!goog.dom.TagName<!HTMLQuoteElement>} */236goog.dom.TagName.Q = new goog.dom.TagName('Q');237/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */238goog.dom.TagName.RP = new goog.dom.TagName('RP');239/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */240goog.dom.TagName.RT = new goog.dom.TagName('RT');241/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */242goog.dom.TagName.RTC = new goog.dom.TagName('RTC');243/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */244goog.dom.TagName.RUBY = new goog.dom.TagName('RUBY');245/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */246goog.dom.TagName.S = new goog.dom.TagName('S');247/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */248goog.dom.TagName.SAMP = new goog.dom.TagName('SAMP');249/** @type {!goog.dom.TagName<!HTMLScriptElement>} */250goog.dom.TagName.SCRIPT = new goog.dom.TagName('SCRIPT');251/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */252goog.dom.TagName.SECTION = new goog.dom.TagName('SECTION');253/** @type {!goog.dom.TagName<!HTMLSelectElement>} */254goog.dom.TagName.SELECT = new goog.dom.TagName('SELECT');255/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */256goog.dom.TagName.SMALL = new goog.dom.TagName('SMALL');257/** @type {!goog.dom.TagName<!HTMLSourceElement>} */258goog.dom.TagName.SOURCE = new goog.dom.TagName('SOURCE');259/** @type {!goog.dom.TagName<!HTMLSpanElement>} */260goog.dom.TagName.SPAN = new goog.dom.TagName('SPAN');261/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */262goog.dom.TagName.STRIKE = new goog.dom.TagName('STRIKE');263/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */264goog.dom.TagName.STRONG = new goog.dom.TagName('STRONG');265/** @type {!goog.dom.TagName<!HTMLStyleElement>} */266goog.dom.TagName.STYLE = new goog.dom.TagName('STYLE');267/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */268goog.dom.TagName.SUB = new goog.dom.TagName('SUB');269/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */270goog.dom.TagName.SUMMARY = new goog.dom.TagName('SUMMARY');271/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */272goog.dom.TagName.SUP = new goog.dom.TagName('SUP');273/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */274goog.dom.TagName.SVG = new goog.dom.TagName('SVG');275/** @type {!goog.dom.TagName<!HTMLTableElement>} */276goog.dom.TagName.TABLE = new goog.dom.TagName('TABLE');277/** @type {!goog.dom.TagName<!HTMLTableSectionElement>} */278goog.dom.TagName.TBODY = new goog.dom.TagName('TBODY');279/** @type {!goog.dom.TagName<!HTMLTableCellElement>} */280goog.dom.TagName.TD = new goog.dom.TagName('TD');281/** @type {!goog.dom.TagName<!HTMLTemplateElement>} */282goog.dom.TagName.TEMPLATE = new goog.dom.TagName('TEMPLATE');283/** @type {!goog.dom.TagName<!HTMLTextAreaElement>} */284goog.dom.TagName.TEXTAREA = new goog.dom.TagName('TEXTAREA');285/** @type {!goog.dom.TagName<!HTMLTableSectionElement>} */286goog.dom.TagName.TFOOT = new goog.dom.TagName('TFOOT');287/** @type {!goog.dom.TagName<!HTMLTableCellElement>} */288goog.dom.TagName.TH = new goog.dom.TagName('TH');289/** @type {!goog.dom.TagName<!HTMLTableSectionElement>} */290goog.dom.TagName.THEAD = new goog.dom.TagName('THEAD');291/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */292goog.dom.TagName.TIME = new goog.dom.TagName('TIME');293/** @type {!goog.dom.TagName<!HTMLTitleElement>} */294goog.dom.TagName.TITLE = new goog.dom.TagName('TITLE');295/** @type {!goog.dom.TagName<!HTMLTableRowElement>} */296goog.dom.TagName.TR = new goog.dom.TagName('TR');297/** @type {!goog.dom.TagName<!HTMLTrackElement>} */298goog.dom.TagName.TRACK = new goog.dom.TagName('TRACK');299/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */300goog.dom.TagName.TT = new goog.dom.TagName('TT');301/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */302goog.dom.TagName.U = new goog.dom.TagName('U');303/** @type {!goog.dom.TagName<!HTMLUListElement>} */304goog.dom.TagName.UL = new goog.dom.TagName('UL');305/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */306goog.dom.TagName.VAR = new goog.dom.TagName('VAR');307/** @type {!goog.dom.TagName<!HTMLVideoElement>} */308goog.dom.TagName.VIDEO = new goog.dom.TagName('VIDEO');309/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */...

Full Screen

Full Screen

tagname.js

Source:tagname.js Github

copy

Full Screen

1// Copyright 2007 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14/**15 * @fileoverview Defines the goog.dom.TagName class. Its constants enumerate16 * all HTML tag names specified in either the the W3C HTML 4.01 index of17 * elements or the HTML5 draft specification.18 *19 * References:20 * http://www.w3.org/TR/html401/index/elements.html21 * http://dev.w3.org/html5/spec/section-index.html22 */23goog.provide('goog.dom.TagName');24goog.require('goog.dom.HtmlElement');25/**26 * A tag name with the type of the element stored in the generic.27 * @param {string} tagName28 * @constructor29 * @template T30 */31goog.dom.TagName = function(tagName) {32 /** @private {string} */33 this.tagName_ = tagName;34};35/**36 * Returns the tag name.37 * @return {string}38 * @override39 */40goog.dom.TagName.prototype.toString = function() {41 return this.tagName_;42};43// Closure Compiler unconditionally converts the following constants to their44// string value (goog.dom.TagName.A -> 'A'). These are the consequences:45// 1. Don't add any members or static members to goog.dom.TagName as they46// couldn't be accessed after this optimization.47// 2. Keep the constant name and its string value the same:48// goog.dom.TagName.X = new goog.dom.TagName('Y');49// is converted to 'X', not 'Y'.50/** @type {!goog.dom.TagName<!HTMLAnchorElement>} */51goog.dom.TagName.A = new goog.dom.TagName('A');52/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */53goog.dom.TagName.ABBR = new goog.dom.TagName('ABBR');54/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */55goog.dom.TagName.ACRONYM = new goog.dom.TagName('ACRONYM');56/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */57goog.dom.TagName.ADDRESS = new goog.dom.TagName('ADDRESS');58/** @type {!goog.dom.TagName<!HTMLAppletElement>} */59goog.dom.TagName.APPLET = new goog.dom.TagName('APPLET');60/** @type {!goog.dom.TagName<!HTMLAreaElement>} */61goog.dom.TagName.AREA = new goog.dom.TagName('AREA');62/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */63goog.dom.TagName.ARTICLE = new goog.dom.TagName('ARTICLE');64/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */65goog.dom.TagName.ASIDE = new goog.dom.TagName('ASIDE');66/** @type {!goog.dom.TagName<!HTMLAudioElement>} */67goog.dom.TagName.AUDIO = new goog.dom.TagName('AUDIO');68/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */69goog.dom.TagName.B = new goog.dom.TagName('B');70/** @type {!goog.dom.TagName<!HTMLBaseElement>} */71goog.dom.TagName.BASE = new goog.dom.TagName('BASE');72/** @type {!goog.dom.TagName<!HTMLBaseFontElement>} */73goog.dom.TagName.BASEFONT = new goog.dom.TagName('BASEFONT');74/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */75goog.dom.TagName.BDI = new goog.dom.TagName('BDI');76/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */77goog.dom.TagName.BDO = new goog.dom.TagName('BDO');78/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */79goog.dom.TagName.BIG = new goog.dom.TagName('BIG');80/** @type {!goog.dom.TagName<!HTMLQuoteElement>} */81goog.dom.TagName.BLOCKQUOTE = new goog.dom.TagName('BLOCKQUOTE');82/** @type {!goog.dom.TagName<!HTMLBodyElement>} */83goog.dom.TagName.BODY = new goog.dom.TagName('BODY');84/** @type {!goog.dom.TagName<!HTMLBRElement>} */85goog.dom.TagName.BR = new goog.dom.TagName('BR');86/** @type {!goog.dom.TagName<!HTMLButtonElement>} */87goog.dom.TagName.BUTTON = new goog.dom.TagName('BUTTON');88/** @type {!goog.dom.TagName<!HTMLCanvasElement>} */89goog.dom.TagName.CANVAS = new goog.dom.TagName('CANVAS');90/** @type {!goog.dom.TagName<!HTMLTableCaptionElement>} */91goog.dom.TagName.CAPTION = new goog.dom.TagName('CAPTION');92/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */93goog.dom.TagName.CENTER = new goog.dom.TagName('CENTER');94/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */95goog.dom.TagName.CITE = new goog.dom.TagName('CITE');96/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */97goog.dom.TagName.CODE = new goog.dom.TagName('CODE');98/** @type {!goog.dom.TagName<!HTMLTableColElement>} */99goog.dom.TagName.COL = new goog.dom.TagName('COL');100/** @type {!goog.dom.TagName<!HTMLTableColElement>} */101goog.dom.TagName.COLGROUP = new goog.dom.TagName('COLGROUP');102/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */103goog.dom.TagName.COMMAND = new goog.dom.TagName('COMMAND');104/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */105goog.dom.TagName.DATA = new goog.dom.TagName('DATA');106/** @type {!goog.dom.TagName<!HTMLDataListElement>} */107goog.dom.TagName.DATALIST = new goog.dom.TagName('DATALIST');108/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */109goog.dom.TagName.DD = new goog.dom.TagName('DD');110/** @type {!goog.dom.TagName<!HTMLModElement>} */111goog.dom.TagName.DEL = new goog.dom.TagName('DEL');112/** @type {!goog.dom.TagName<!HTMLDetailsElement>} */113goog.dom.TagName.DETAILS = new goog.dom.TagName('DETAILS');114/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */115goog.dom.TagName.DFN = new goog.dom.TagName('DFN');116/** @type {!goog.dom.TagName<!HTMLDialogElement>} */117goog.dom.TagName.DIALOG = new goog.dom.TagName('DIALOG');118/** @type {!goog.dom.TagName<!HTMLDirectoryElement>} */119goog.dom.TagName.DIR = new goog.dom.TagName('DIR');120/** @type {!goog.dom.TagName<!HTMLDivElement>} */121goog.dom.TagName.DIV = new goog.dom.TagName('DIV');122/** @type {!goog.dom.TagName<!HTMLDListElement>} */123goog.dom.TagName.DL = new goog.dom.TagName('DL');124/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */125goog.dom.TagName.DT = new goog.dom.TagName('DT');126/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */127goog.dom.TagName.EM = new goog.dom.TagName('EM');128/** @type {!goog.dom.TagName<!HTMLEmbedElement>} */129goog.dom.TagName.EMBED = new goog.dom.TagName('EMBED');130/** @type {!goog.dom.TagName<!HTMLFieldSetElement>} */131goog.dom.TagName.FIELDSET = new goog.dom.TagName('FIELDSET');132/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */133goog.dom.TagName.FIGCAPTION = new goog.dom.TagName('FIGCAPTION');134/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */135goog.dom.TagName.FIGURE = new goog.dom.TagName('FIGURE');136/** @type {!goog.dom.TagName<!HTMLFontElement>} */137goog.dom.TagName.FONT = new goog.dom.TagName('FONT');138/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */139goog.dom.TagName.FOOTER = new goog.dom.TagName('FOOTER');140/** @type {!goog.dom.TagName<!HTMLFormElement>} */141goog.dom.TagName.FORM = new goog.dom.TagName('FORM');142/** @type {!goog.dom.TagName<!HTMLFrameElement>} */143goog.dom.TagName.FRAME = new goog.dom.TagName('FRAME');144/** @type {!goog.dom.TagName<!HTMLFrameSetElement>} */145goog.dom.TagName.FRAMESET = new goog.dom.TagName('FRAMESET');146/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */147goog.dom.TagName.H1 = new goog.dom.TagName('H1');148/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */149goog.dom.TagName.H2 = new goog.dom.TagName('H2');150/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */151goog.dom.TagName.H3 = new goog.dom.TagName('H3');152/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */153goog.dom.TagName.H4 = new goog.dom.TagName('H4');154/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */155goog.dom.TagName.H5 = new goog.dom.TagName('H5');156/** @type {!goog.dom.TagName<!HTMLHeadingElement>} */157goog.dom.TagName.H6 = new goog.dom.TagName('H6');158/** @type {!goog.dom.TagName<!HTMLHeadElement>} */159goog.dom.TagName.HEAD = new goog.dom.TagName('HEAD');160/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */161goog.dom.TagName.HEADER = new goog.dom.TagName('HEADER');162/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */163goog.dom.TagName.HGROUP = new goog.dom.TagName('HGROUP');164/** @type {!goog.dom.TagName<!HTMLHRElement>} */165goog.dom.TagName.HR = new goog.dom.TagName('HR');166/** @type {!goog.dom.TagName<!HTMLHtmlElement>} */167goog.dom.TagName.HTML = new goog.dom.TagName('HTML');168/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */169goog.dom.TagName.I = new goog.dom.TagName('I');170/** @type {!goog.dom.TagName<!HTMLIFrameElement>} */171goog.dom.TagName.IFRAME = new goog.dom.TagName('IFRAME');172/** @type {!goog.dom.TagName<!HTMLImageElement>} */173goog.dom.TagName.IMG = new goog.dom.TagName('IMG');174/** @type {!goog.dom.TagName<!HTMLInputElement>} */175goog.dom.TagName.INPUT = new goog.dom.TagName('INPUT');176/** @type {!goog.dom.TagName<!HTMLModElement>} */177goog.dom.TagName.INS = new goog.dom.TagName('INS');178/** @type {!goog.dom.TagName<!HTMLIsIndexElement>} */179goog.dom.TagName.ISINDEX = new goog.dom.TagName('ISINDEX');180/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */181goog.dom.TagName.KBD = new goog.dom.TagName('KBD');182// HTMLKeygenElement is deprecated.183/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */184goog.dom.TagName.KEYGEN = new goog.dom.TagName('KEYGEN');185/** @type {!goog.dom.TagName<!HTMLLabelElement>} */186goog.dom.TagName.LABEL = new goog.dom.TagName('LABEL');187/** @type {!goog.dom.TagName<!HTMLLegendElement>} */188goog.dom.TagName.LEGEND = new goog.dom.TagName('LEGEND');189/** @type {!goog.dom.TagName<!HTMLLIElement>} */190goog.dom.TagName.LI = new goog.dom.TagName('LI');191/** @type {!goog.dom.TagName<!HTMLLinkElement>} */192goog.dom.TagName.LINK = new goog.dom.TagName('LINK');193/** @type {!goog.dom.TagName<!HTMLMapElement>} */194goog.dom.TagName.MAP = new goog.dom.TagName('MAP');195/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */196goog.dom.TagName.MARK = new goog.dom.TagName('MARK');197/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */198goog.dom.TagName.MATH = new goog.dom.TagName('MATH');199/** @type {!goog.dom.TagName<!HTMLMenuElement>} */200goog.dom.TagName.MENU = new goog.dom.TagName('MENU');201/** @type {!goog.dom.TagName<!HTMLMetaElement>} */202goog.dom.TagName.META = new goog.dom.TagName('META');203/** @type {!goog.dom.TagName<!HTMLMeterElement>} */204goog.dom.TagName.METER = new goog.dom.TagName('METER');205/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */206goog.dom.TagName.NAV = new goog.dom.TagName('NAV');207/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */208goog.dom.TagName.NOFRAMES = new goog.dom.TagName('NOFRAMES');209/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */210goog.dom.TagName.NOSCRIPT = new goog.dom.TagName('NOSCRIPT');211/** @type {!goog.dom.TagName<!HTMLObjectElement>} */212goog.dom.TagName.OBJECT = new goog.dom.TagName('OBJECT');213/** @type {!goog.dom.TagName<!HTMLOListElement>} */214goog.dom.TagName.OL = new goog.dom.TagName('OL');215/** @type {!goog.dom.TagName<!HTMLOptGroupElement>} */216goog.dom.TagName.OPTGROUP = new goog.dom.TagName('OPTGROUP');217/** @type {!goog.dom.TagName<!HTMLOptionElement>} */218goog.dom.TagName.OPTION = new goog.dom.TagName('OPTION');219/** @type {!goog.dom.TagName<!HTMLOutputElement>} */220goog.dom.TagName.OUTPUT = new goog.dom.TagName('OUTPUT');221/** @type {!goog.dom.TagName<!HTMLParagraphElement>} */222goog.dom.TagName.P = new goog.dom.TagName('P');223/** @type {!goog.dom.TagName<!HTMLParamElement>} */224goog.dom.TagName.PARAM = new goog.dom.TagName('PARAM');225/** @type {!goog.dom.TagName<!HTMLPreElement>} */226goog.dom.TagName.PRE = new goog.dom.TagName('PRE');227/** @type {!goog.dom.TagName<!HTMLProgressElement>} */228goog.dom.TagName.PROGRESS = new goog.dom.TagName('PROGRESS');229/** @type {!goog.dom.TagName<!HTMLQuoteElement>} */230goog.dom.TagName.Q = new goog.dom.TagName('Q');231/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */232goog.dom.TagName.RP = new goog.dom.TagName('RP');233/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */234goog.dom.TagName.RT = new goog.dom.TagName('RT');235/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */236goog.dom.TagName.RUBY = new goog.dom.TagName('RUBY');237/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */238goog.dom.TagName.S = new goog.dom.TagName('S');239/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */240goog.dom.TagName.SAMP = new goog.dom.TagName('SAMP');241/** @type {!goog.dom.TagName<!HTMLScriptElement>} */242goog.dom.TagName.SCRIPT = new goog.dom.TagName('SCRIPT');243/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */244goog.dom.TagName.SECTION = new goog.dom.TagName('SECTION');245/** @type {!goog.dom.TagName<!HTMLSelectElement>} */246goog.dom.TagName.SELECT = new goog.dom.TagName('SELECT');247/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */248goog.dom.TagName.SMALL = new goog.dom.TagName('SMALL');249/** @type {!goog.dom.TagName<!HTMLSourceElement>} */250goog.dom.TagName.SOURCE = new goog.dom.TagName('SOURCE');251/** @type {!goog.dom.TagName<!HTMLSpanElement>} */252goog.dom.TagName.SPAN = new goog.dom.TagName('SPAN');253/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */254goog.dom.TagName.STRIKE = new goog.dom.TagName('STRIKE');255/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */256goog.dom.TagName.STRONG = new goog.dom.TagName('STRONG');257/** @type {!goog.dom.TagName<!HTMLStyleElement>} */258goog.dom.TagName.STYLE = new goog.dom.TagName('STYLE');259/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */260goog.dom.TagName.SUB = new goog.dom.TagName('SUB');261/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */262goog.dom.TagName.SUMMARY = new goog.dom.TagName('SUMMARY');263/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */264goog.dom.TagName.SUP = new goog.dom.TagName('SUP');265/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */266goog.dom.TagName.SVG = new goog.dom.TagName('SVG');267/** @type {!goog.dom.TagName<!HTMLTableElement>} */268goog.dom.TagName.TABLE = new goog.dom.TagName('TABLE');269/** @type {!goog.dom.TagName<!HTMLTableSectionElement>} */270goog.dom.TagName.TBODY = new goog.dom.TagName('TBODY');271/** @type {!goog.dom.TagName<!HTMLTableCellElement>} */272goog.dom.TagName.TD = new goog.dom.TagName('TD');273/** @type {!goog.dom.TagName<!HTMLTemplateElement>} */274goog.dom.TagName.TEMPLATE = new goog.dom.TagName('TEMPLATE');275/** @type {!goog.dom.TagName<!HTMLTextAreaElement>} */276goog.dom.TagName.TEXTAREA = new goog.dom.TagName('TEXTAREA');277/** @type {!goog.dom.TagName<!HTMLTableSectionElement>} */278goog.dom.TagName.TFOOT = new goog.dom.TagName('TFOOT');279/** @type {!goog.dom.TagName<!HTMLTableCellElement>} */280goog.dom.TagName.TH = new goog.dom.TagName('TH');281/** @type {!goog.dom.TagName<!HTMLTableSectionElement>} */282goog.dom.TagName.THEAD = new goog.dom.TagName('THEAD');283/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */284goog.dom.TagName.TIME = new goog.dom.TagName('TIME');285/** @type {!goog.dom.TagName<!HTMLTitleElement>} */286goog.dom.TagName.TITLE = new goog.dom.TagName('TITLE');287/** @type {!goog.dom.TagName<!HTMLTableRowElement>} */288goog.dom.TagName.TR = new goog.dom.TagName('TR');289/** @type {!goog.dom.TagName<!HTMLTrackElement>} */290goog.dom.TagName.TRACK = new goog.dom.TagName('TRACK');291/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */292goog.dom.TagName.TT = new goog.dom.TagName('TT');293/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */294goog.dom.TagName.U = new goog.dom.TagName('U');295/** @type {!goog.dom.TagName<!HTMLUListElement>} */296goog.dom.TagName.UL = new goog.dom.TagName('UL');297/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */298goog.dom.TagName.VAR = new goog.dom.TagName('VAR');299/** @type {!goog.dom.TagName<!HTMLVideoElement>} */300goog.dom.TagName.VIDEO = new goog.dom.TagName('VIDEO');301/** @type {!goog.dom.TagName<!goog.dom.HtmlElement>} */...

Full Screen

Full Screen

operators.js

Source:operators.js Github

copy

Full Screen

1define(['lodash'], function (_) {2 "use strict";3 var frac = function frac(mje) {4 var msup, mrow, mrow2, node, currentNode, nextSibling, tagName;5 var forwardNodes = mje.tryExpression();6 var trailingNodes = [];7 var maxChar = 1;8 currentNode = mje.getCurrentNode();9 nextSibling = currentNode ? currentNode.nextSibling : mje.raw().firstElementChild;10 node = currentNode;11 if (node && !forwardNodes.length) {12 tagName = node.tagName.toLowerCase();13 if (tagName === 'mn') {14 while (node && tagName === node.tagName.toLowerCase()) {15 forwardNodes.unshift(node);16 node = node.previousSibling;17 }18 }19 }20 if (!mje.allowText()) {21 node = nextSibling;22 if (node) {23 tagName = node.tagName.toLowerCase();24 if (tagName === 'mn' || tagName === 'mi') {25 if (tagName === 'mi') {26 forwardNodes = [];27 }28 while (node && tagName === node.tagName.toLowerCase()) {29 trailingNodes.push(node);30 node = node.nextSibling;31 }32 }33 }34 }35 node = mje.getCurrentNode();36 if (node && node.tagName.toLowerCase() === 'mtext') {37 mje.whitespace();38 }39 msup = MathJax.HTML.Element('mfrac');40 mrow = MathJax.HTML.Element('mrow');41 msup.appendChild(mrow);42 mrow2 = MathJax.HTML.Element('mrow');43 _.forEachRight(forwardNodes, function (n) {44 if (maxChar) {45 if (mje.getCurrent() === n) {46 mje.setCurrent(n.nextSibling);47 }48 n.remove();49 mrow.insertBefore(n, mrow.firstChild);50 if (n.tagName.toLowerCase() === 'mi') {51 maxChar--;52 }53 }54 });55 _.forEach(trailingNodes, function (n) {56 if (maxChar) {57 if (mje.getCurrent() === n) {58 mje.setCurrent(n.nextSibling);59 }60 n.remove();61 mrow2.appendChild(n);62 if (n.tagName.toLowerCase() === 'mi') {63 maxChar--;64 }65 }66 });67 msup.appendChild(mrow2);68 mje.addElement(msup, forwardNodes.length ? mrow2 : mrow);69 };70 var groupTag = function groupTag(mje, tag, second, maxChar) {71 var msup, mrow, node, tagName;72 var newNodes = mje.tryExpression();73 maxChar = maxChar ? maxChar : 999;74 node = mje.getCurrentNode();75 if (node && !newNodes.length) {76 tagName = node.tagName.toLowerCase();77 if (tagName === 'mn' || tagName === 'mi') {78 while (node && tagName === node.tagName.toLowerCase()) {79 newNodes.unshift(node);80 node = node.previousSibling;81 }82 }83 }84 if (newNodes.length) {85 msup = MathJax.HTML.Element(tag);86 mrow = MathJax.HTML.Element('mrow');87 msup.appendChild(mrow);88 _.forEachRight(newNodes, function (n) {89 if (maxChar) {90 n.remove();91 mrow.insertBefore(n, mrow.firstChild);92 if (n.tagName.toLowerCase() === 'mi') {93 maxChar--;94 }95 }96 });97 if (second) {98 msup.appendChild(second);99 mrow = null;100 } else {101 mrow = MathJax.HTML.Element('mrow');102 msup.appendChild(mrow);103 }104 mje.addElement(msup, mrow);105 } else {106 node = mje.getCurrentNode();107 if (node && node.tagName.toLowerCase() === 'mtext') {108 mje.whitespace();109 }110 msup = MathJax.HTML.Element(tag);111 mrow = MathJax.HTML.Element('mrow');112 msup.appendChild(mrow);113 msup.appendChild(second || MathJax.HTML.Element('mrow'));114 mje.addElement(msup, mrow);115 }116 };117 var operators = {118 binary: {119 '+': '+',120 '-': '-',121 //unicode chars122 '−': '-',123 '±': '±',124 'Σ': 'Σ',125 '∠': '∠',126 '△': '△',127 '▱': '▱',128 '⊙': '⊙',129 },130 groups: {131 '[': ']',132 //'|': '|',133 '{': '}',134 },135 onlyMathGroups: {136 '(': ')'137 },138 onlyText: {139 '}': '}',140 ']': ']',141 ')': ')'142 },143 relations: {144 '=': '=',145 '≠': '≠',146 '∼': '∼',147 '≁': '≁',148 '<': '<',149 '>': '>',150 '≈': '≈',151 '≉': '≉',152 '≤': '≤',153 '≥': '≥',154 '≅': '≅',155 '≇': '≇',156 '·': '·',157 '*': ['*', '×'],158 '∥': '∥',159 '⊥': '⊥',160 '×': '×',161 '÷': '÷',162 '⁄': '⁄',163 },164 onlyMathRelations: {165 '~': ['~', '∼'],166 ':': ':',167 },168 mathChars: {169 'π': 'π',170 '°': '°',171 },172 custom: {173 '|': function (mje) {174 var mrow, emptyRow;175 mrow = MathJax.HTML.Element('mrow');176 mrow.appendChild(MathJax.HTML.Element('mo', null, ['|']));177 emptyRow = MathJax.HTML.Element('mrow');178 mrow.appendChild(emptyRow);179 mrow.appendChild(MathJax.HTML.Element('mo', { className: 'soft' }, ['|']));180 mje.addElement(mrow, emptyRow);181 },182 '`': function (mje) {183 var msqrt = MathJax.HTML.Element('msqrt');184 var mrow = MathJax.HTML.Element('mrow');185 msqrt.appendChild(mrow);186 mje.tryExpression();187 mje.addElement(msqrt, mrow);188 },189 '^': function (mje) {190 groupTag(mje, 'msup');191 },192 '_': function (mje) {193 groupTag(mje, 'msub');194 },195 "'": function (mje) {196 var node, element;197 node = mje.getCurrentNode();198 if (mje.allowText() && (!node || node.tagName.toLowerCase() === 'mtext')) {199 element = MathJax.HTML.Element('mtext', null, ["'"]);200 } else {201 element = MathJax.HTML.Element('mn', null, ["'"]);202 }203 mje.addElement(element);204 },205 '/': function (mje) {206 var node, mtext;207 mje.tryExpression();208 node = mje.getCurrentNode();209 if (node && node.tagName.toLowerCase() === 'mtext') {210 mtext = MathJax.HTML.Element('mtext', null, ['/']);211 mje.addElement(mtext);212 } else {213 frac(mje);214 }215 },216 '\\': function (mje) {217 var node, mtext;218 mje.tryExpression();219 node = mje.getCurrentNode();220 if (node && node.tagName.toLowerCase() === 'mtext') {221 mtext = MathJax.HTML.Element('mtext', null, ['\\']);222 mje.addElement(mtext);223 } else {224 frac(mje);225 }226 },227 '$': function (mje) {228 var node = mje.getCurrentNode();229 var count = 0, mo, idBefore;230 var tagName = node ? node.tagName.toLowerCase() : '';231 if (tagName === 'mn') {232 mje.left(); count++;233 while (node.previousSibling && (node.previousSibling.tagName.toLowerCase() === 'mn' || node.previousSibling.textContent === '.')) {234 node = node.previousSibling;235 mje.left(); count++;236 }237 idBefore = node.previousSibling && node.previousSibling.tagName.toLowerCase() === 'mi';238 if (idBefore) {239 mo = MathJax.HTML.Element('mo', null, ['('])240 mje.addElement(mo);241 }242 mje.addElement(MathJax.HTML.Element('mi', null, ['$']));243 while (count--) {244 mje.right();245 }246 if (idBefore) {247 mo = MathJax.HTML.Element('mo', null, [')'])248 mje.addElement(mo, mo);249 }250 } else if (tagName === 'mi') {251 tagName = node.previousSibling ? node.previousSibling.tagName.toLowerCase() : '';252 if (tagName === 'mi' || tagName === 'mn') {253 mje.addElement(MathJax.HTML.Element('mrow'));254 } else {255 mje.left();256 mje.addElement(MathJax.HTML.Element('mi', null, ['$']));257 mje.right();258 }259 } else {260 tagName = mje.getTagName('mi');261 mje.addElement(MathJax.HTML.Element(tagName, null, ['$']));262 }263 },264 '!': function (mje) {265 var tagName, node = mje.getCurrentNode();266 var selectable = node && node.getAttribute('selectable') === 'true';267 var mrow, mrow1, bkt;268 if ((!node && !mje.allowText()) || (node && node.tagName.toLowerCase() === 'mrow')) {269 mrow = MathJax.HTML.Element('mrow');270 mrow1 = MathJax.HTML.Element('mrow');271 mrow.appendChild(mrow1);272 mrow.appendChild(MathJax.HTML.Element('mo', null, ['!']));273 mje.addElement(mrow, mrow1);274 } else {275 if (node && node.tagName.toLowerCase() === 'mover' && !selectable) {276 $(MathJax.HTML.Element('mo', {}, ['('])).insertBefore(node);277 bkt = MathJax.HTML.Element('mo', {}, [')']);278 $(bkt).insertAfter(node);279 }280 tagName = mje.getTagName('mo');281 mje.addElement(MathJax.HTML.Element(tagName, null, ['!']));282 }283 },284 ',': function (mje) {285 var node = mje.getCurrentNode();286 var mtext, tagName;287 if (mje.allowText() && (!node || (node.tagName.toLowerCase() === 'mtext' || node.tagName.toLowerCase() === 'mi'))) {288 tagName = 'mtext';289 } else if (node && node.tagName.toLowerCase() === 'mn') {290 tagName = 'mn';291 }292 if (tagName) {293 mtext = MathJax.HTML.Element(tagName, null, [',']);294 mje.addElement(mtext);295 }296 },297 '.': function (mje) {298 var node = mje.getCurrentNode();299 var mtext, tagName = 'mn';300 if (mje.allowText() && (!node || (node.tagName.toLowerCase() === 'mtext' || node.tagName.toLowerCase() === 'mi'))) {301 tagName = 'mtext';302 }303 mtext = MathJax.HTML.Element(tagName, null, ['.']);304 mje.addElement(mtext);305 },306 '∴': function (mje) {307 mje.tryExpression();308 mje.addElement(MathJax.HTML.Element('mo', null, ['∴']));309 }310 }311 };312 return operators;...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const element = await page.$('h1');7 const tagName = await element.tagName();8 await browser.close();9})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch({ headless: false });4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.click('input[name="q"]');7 await page.fill('input[name="q"]', 'Hello World');8 await page.keyboard.press('Enter');9 await page.screenshot({ path: `example.png` });10 await browser.close();11})();12const { chromium } = require('playwright');13(async () => {14 const browser = await chromium.launch({ headless: false });15 const context = await browser.newContext();16 const page = await context.newPage();17 await page.click('input[name="q"]');18 await page.fill('input[name="q"]', 'Hello World');19 await page.keyboard.press('Enter');20 await page.screenshot({ path: `example.png` });21 await browser.close();22})();23const { chromium } = require('playwright');24(async () => {25 const browser = await chromium.launch({ headless: false });26 const context = await browser.newContext();27 const page = await context.newPage();28 await page.click('input[name="q"]');29 await page.fill('input[name="q"]', 'Hello World');30 await page.keyboard.press('Enter');31 await page.screenshot({ path: `example.png` });32 await browser.close();33})();34const { chromium } = require('playwright');35(async () => {36 const browser = await chromium.launch({ headless: false });37 const context = await browser.newContext();38 const page = await context.newPage();39 await page.click('input[name="q"]');40 await page.fill('input[name="q"]', 'Hello World');41 await page.keyboard.press('Enter');42 await page.screenshot({ path: `example.png` });43 await browser.close();44})();45const { chromium } = require('playwright');46(async () => {

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch({headless: false});4 const page = await browser.newPage();5 const searchBox = await page.$('input[name="q"]');6 await searchBox.type('Playwright');7 await searchBox.press('Enter');8 await page.waitForNavigation();9 await page.screenshot({ path: `example.png` });10 await browser.close();11})();12const { chromium } = require('playwright');13(async () => {14 const browser = await chromium.launch({headless: false});15 const page = await browser.newPage();16 const searchBox = await page.$('input[name="q"]');17 await searchBox.type('Playwright');18 await searchBox.press('Enter');19 await page.waitForNavigation();20 await page.screenshot({ path: `example.png` });21 await browser.close();22})();23const { chromium } = require('playwright');24(async () => {25 const browser = await chromium.launch({headless: false});26 const page = await browser.newPage();27 const searchBox = await page.$('input[name="q"]');28 await searchBox.type('Playwright');29 await searchBox.press('Enter');30 await page.waitForNavigation();31 await page.screenshot({ path: `example.png` });32 await browser.close();33})();34const { chromium } = require('playwright');35(async () => {36 const browser = await chromium.launch({headless: false});37 const page = await browser.newPage();38 const searchBox = await page.$('input[name="q"]');39 await searchBox.type('Playwright');40 await searchBox.press('Enter');41 await page.waitForNavigation();42 await page.screenshot({ path: `example.png` });43 await browser.close();44})();45const { chromium } = require('playwright');

Full Screen

Using AI Code Generation

copy

Full Screen

1const { tagName } = require('@playwright/test');2const { test, expect } = require('@playwright/test');3test('first test', async ({ page }) => {4 const title = await page.title();5 expect(title).toBe('Playwright');6 const tag = await tagName(page.locator('text=Get started'));7 expect(tag).toBe('a');8});9const { test, expect } = require('@playwright/test');10test('first test', async ({ page }) => {11 const title = await page.title();12 expect(title).toBe('Playwright');13 await page.click('text=Get started');14});15const { test, expect } = require('@playwright/test');16test('first test', async ({ page }) => {17 const title = await page.title();18 expect(title).toBe('Playwright');19 await page.click('text=Get started');20});21const { chromium } = require('playwright');22(async () => {23 const browser = await chromium.launch();24 const context = await browser.newContext();25 const page = await context.newPage();26 await browser.close();27})();28const { chromium } = require('playwright');29(async () => {30 const browser = await chromium.launch();31 const context = await browser.newContext();32 const page = await context.newPage();33 await browser.close();34})();35const { chromium } = require('playwright');

Full Screen

Using AI Code Generation

copy

Full Screen

1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch({headless: false});4 const context = await browser.newContext();5 const page = await context.newPage();6 const element = await page.$('header');7 const tagName = await element.tagName();8 console.log(tagName);9 await browser.close();10})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { tagName } = require('@playwright/test');2const { selector } = require('@playwright/test');3const { testInfo } = require('@playwright/test');4const { expect } = require('@playwright/test');5expect(1 + 1).toBe(2);6expect('hello').toContain('ell');7expect({ a: 'b' }).toEqual({ a: 'b' });8expect(null).toBeNull();9expect(0).not.toBeUndefined();10const { test } = require('@playwright/test');11test('My Test', async ({ page }) => {12 expect(page.locator('.navbar__inner').first()).toBeVisible();13});14const { expect } = require('@playwright/test');15expect(1 + 1).toBe(2);16expect('hello').toContain('ell');17expect({ a: 'b' }).toEqual({ a: 'b' });18expect(null).toBeNull();19expect(0).not.toBeUndefined();20const { test } = require('@playwright/test');21test('My Test', async ({ page }) => {

Full Screen

Using AI Code Generation

copy

Full Screen

1const { tagName } = require('@playwright/test');2console.log(tagName('input'));3const { textContent } = require('@playwright/test');4console.log(textContent('Hello World!'));5const { title } = require('@playwright/test');6console.log(title('Hello World!'));7const { urlMatches } = require('@playwright/test');8const { viewportSize } = require('@playwright/test');9console.log(viewportSize({ width: 100, height: 100 }));10const { waitForFunction } = require('@playwright/test');11console.log(waitForFunction('() => window.innerWidth < 100'));12const { waitForNavigation } = require('@playwright/test');13const { waitForSelector } = require('@playwright/test');14console.log(waitForSelector('text=Hello World!'));15const { xpath } = require('@playwright/test');16const { click } = require('@

Full Screen

Using AI Code Generation

copy

Full Screen

1const { tagName } = require('@playwright/test');2 const name = tagName('div');3 console.log(name);4## isEnabled() Method5`element.isEnabled()`6const { isEnabled } = require('@playwright/test');7 const name = isEnabled('div');8 console.log(name);9## isDisabled() Method10`element.isDisabled()`11const { isDisabled } = require('@playwright/test');12 const name = isDisabled('div');13 console.log(name);14## isEditable() Method15`element.isEditable()`16const { isEditable } = require('@playwright/test');17 const name = isEditable('div');18 console.log(name);19## isChecked() Method20`element.isChecked()`

Full Screen

Playwright tutorial

LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.

Chapters:

  1. What is Playwright : Playwright is comparatively new but has gained good popularity. Get to know some history of the Playwright with some interesting facts connected with it.
  2. How To Install Playwright : Learn in detail about what basic configuration and dependencies are required for installing Playwright and run a test. Get a step-by-step direction for installing the Playwright automation framework.
  3. Playwright Futuristic Features: Launched in 2020, Playwright gained huge popularity quickly because of some obliging features such as Playwright Test Generator and Inspector, Playwright Reporter, Playwright auto-waiting mechanism and etc. Read up on those features to master Playwright testing.
  4. What is Component Testing: Component testing in Playwright is a unique feature that allows a tester to test a single component of a web application without integrating them with other elements. Learn how to perform Component testing on the Playwright automation framework.
  5. Inputs And Buttons In Playwright: Every website has Input boxes and buttons; learn about testing inputs and buttons with different scenarios and examples.
  6. Functions and Selectors in Playwright: Learn how to launch the Chromium browser with Playwright. Also, gain a better understanding of some important functions like “BrowserContext,” which allows you to run multiple browser sessions, and “newPage” which interacts with a page.
  7. Handling Alerts and Dropdowns in Playwright : Playwright interact with different types of alerts and pop-ups, such as simple, confirmation, and prompt, and different types of dropdowns, such as single selector and multi-selector get your hands-on with handling alerts and dropdown in Playright testing.
  8. Playwright vs Puppeteer: Get to know about the difference between two testing frameworks and how they are different than one another, which browsers they support, and what features they provide.
  9. Run Playwright Tests on LambdaTest: Playwright testing with LambdaTest leverages test performance to the utmost. You can run multiple Playwright tests in Parallel with the LammbdaTest test cloud. Get a step-by-step guide to run your Playwright test on the LambdaTest platform.
  10. Playwright Python Tutorial: Playwright automation framework support all major languages such as Python, JavaScript, TypeScript, .NET and etc. However, there are various advantages to Python end-to-end testing with Playwright because of its versatile utility. Get the hang of Playwright python testing with this chapter.
  11. Playwright End To End Testing Tutorial: Get your hands on with Playwright end-to-end testing and learn to use some exciting features such as TraceViewer, Debugging, Networking, Component testing, Visual testing, and many more.
  12. Playwright Video Tutorial: Watch the video tutorials on Playwright testing from experts and get a consecutive in-depth explanation of Playwright automation testing.

Run Playwright Internal 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