-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize case of SVG elements and attributes in HTML, and preserve a…
…ccessibility attributes (#6593)
- Loading branch information
1 parent
940f4fc
commit a8a5b70
Showing
9 changed files
with
227 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/core/integration-tests/test/integration/html-svg-case/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<body> | ||
<x-custom stdDeviation="0.5"></x-custom> | ||
<svg viewBox="1.8 2.4 2 2" preserveAspectRatio="xMinYMin meet" role="img"> | ||
<title>Test</title> | ||
<defs> | ||
<FILTER id="blur"> | ||
<feGaussianBlur in="SourceGraphic" stdDeviation="0.01" /> | ||
</FILTER> | ||
</defs> | ||
<g> | ||
<path d="M2 3C3 2 4 3 3 4" stroke-width="0.1" stroke="blue" fill="none" filter="url(#blur)"/> | ||
</g> | ||
</svg> | ||
<a href="other.html">Other</a> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
packages/core/integration-tests/test/integration/html-svg-case/other.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Hi</p> |
1 change: 0 additions & 1 deletion
1
packages/core/integration-tests/test/integration/url-colon/a:b:c.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// @flow | ||
// Based on parse5: https://github.com/inikulin/parse5/blob/252819607421a5741cf745bb60c404f023531b0d/packages/parse5/lib/common/foreign-content.js#L54 | ||
|
||
export const SVG_TAG_NAMES: {|[string]: string|} = { | ||
altglyph: 'altGlyph', | ||
altglyphdef: 'altGlyphDef', | ||
altglyphitem: 'altGlyphItem', | ||
animatecolor: 'animateColor', | ||
animatemotion: 'animateMotion', | ||
animatetransform: 'animateTransform', | ||
clippath: 'clipPath', | ||
feblend: 'feBlend', | ||
fecolormatrix: 'feColorMatrix', | ||
fecomponenttransfer: 'feComponentTransfer', | ||
fecomposite: 'feComposite', | ||
feconvolvematrix: 'feConvolveMatrix', | ||
fediffuselighting: 'feDiffuseLighting', | ||
fedisplacementmap: 'feDisplacementMap', | ||
fedistantlight: 'feDistantLight', | ||
feflood: 'feFlood', | ||
fefunca: 'feFuncA', | ||
fefuncb: 'feFuncB', | ||
fefuncg: 'feFuncG', | ||
fefuncr: 'feFuncR', | ||
fegaussianblur: 'feGaussianBlur', | ||
feimage: 'feImage', | ||
femerge: 'feMerge', | ||
femergenode: 'feMergeNode', | ||
femorphology: 'feMorphology', | ||
feoffset: 'feOffset', | ||
fepointlight: 'fePointLight', | ||
fespecularlighting: 'feSpecularLighting', | ||
fespotlight: 'feSpotLight', | ||
fetile: 'feTile', | ||
feturbulence: 'feTurbulence', | ||
foreignobject: 'foreignObject', | ||
glyphref: 'glyphRef', | ||
lineargradient: 'linearGradient', | ||
radialgradient: 'radialGradient', | ||
textpath: 'textPath', | ||
}; | ||
|
||
export const SVG_ATTRS: {|[string]: string|} = { | ||
attributename: 'attributeName', | ||
attributetype: 'attributeType', | ||
basefrequency: 'baseFrequency', | ||
baseprofile: 'baseProfile', | ||
calcmode: 'calcMode', | ||
clippathunits: 'clipPathUnits', | ||
diffuseconstant: 'diffuseConstant', | ||
edgemode: 'edgeMode', | ||
filterunits: 'filterUnits', | ||
glyphref: 'glyphRef', | ||
gradienttransform: 'gradientTransform', | ||
gradientunits: 'gradientUnits', | ||
kernelmatrix: 'kernelMatrix', | ||
kernelunitlength: 'kernelUnitLength', | ||
keypoints: 'keyPoints', | ||
keysplines: 'keySplines', | ||
keytimes: 'keyTimes', | ||
lengthadjust: 'lengthAdjust', | ||
limitingconeangle: 'limitingConeAngle', | ||
markerheight: 'markerHeight', | ||
markerunits: 'markerUnits', | ||
markerwidth: 'markerWidth', | ||
maskcontentunits: 'maskContentUnits', | ||
maskunits: 'maskUnits', | ||
numoctaves: 'numOctaves', | ||
pathlength: 'pathLength', | ||
patterncontentunits: 'patternContentUnits', | ||
patterntransform: 'patternTransform', | ||
patternunits: 'patternUnits', | ||
pointsatx: 'pointsAtX', | ||
pointsaty: 'pointsAtY', | ||
pointsatz: 'pointsAtZ', | ||
preservealpha: 'preserveAlpha', | ||
preserveaspectratio: 'preserveAspectRatio', | ||
primitiveunits: 'primitiveUnits', | ||
refx: 'refX', | ||
refy: 'refY', | ||
repeatcount: 'repeatCount', | ||
repeatdur: 'repeatDur', | ||
requiredextensions: 'requiredExtensions', | ||
requiredfeatures: 'requiredFeatures', | ||
specularconstant: 'specularConstant', | ||
specularexponent: 'specularExponent', | ||
spreadmethod: 'spreadMethod', | ||
startoffset: 'startOffset', | ||
stddeviation: 'stdDeviation', | ||
stitchtiles: 'stitchTiles', | ||
surfacescale: 'surfaceScale', | ||
systemlanguage: 'systemLanguage', | ||
tablevalues: 'tableValues', | ||
targetx: 'targetX', | ||
targety: 'targetY', | ||
textlength: 'textLength', | ||
viewbox: 'viewBox', | ||
viewtarget: 'viewTarget', | ||
xchannelselector: 'xChannelSelector', | ||
ychannelselector: 'yChannelSelector', | ||
zoomandpan: 'zoomAndPan', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters