205 |
mtext => FOREIGN_FLOW_CONTENT_EL, |
mtext => FOREIGN_FLOW_CONTENT_EL, |
206 |
}, |
}, |
207 |
$SVG_NS => { |
$SVG_NS => { |
208 |
foreignobject => FOREIGN_FLOW_CONTENT_EL, ## TODO: case |
foreignObject => FOREIGN_FLOW_CONTENT_EL, |
209 |
desc => FOREIGN_FLOW_CONTENT_EL, |
desc => FOREIGN_FLOW_CONTENT_EL, |
210 |
title => FOREIGN_FLOW_CONTENT_EL, |
title => FOREIGN_FLOW_CONTENT_EL, |
211 |
}, |
}, |
212 |
## NOTE: In addition, FOREIGN_EL is set to non-HTML elements. |
## NOTE: In addition, FOREIGN_EL is set to non-HTML elements. |
213 |
}; |
}; |
214 |
|
|
215 |
|
my $svg_attr_name = { |
216 |
|
attributetype => 'attributeType', |
217 |
|
basefrequency => 'baseFrequency', |
218 |
|
baseprofile => 'baseProfile', |
219 |
|
calcmode => 'calcMode', |
220 |
|
clippathunits => 'clipPathUnits', |
221 |
|
contentscripttype => 'contentScriptType', |
222 |
|
contentstyletype => 'contentStyleType', |
223 |
|
diffuseconstant => 'diffuseConstant', |
224 |
|
edgemode => 'edgeMode', |
225 |
|
externalresourcesrequired => 'externalResourcesRequired', |
226 |
|
fecolormatrix => 'feColorMatrix', |
227 |
|
fecomposite => 'feComposite', |
228 |
|
fegaussianblur => 'feGaussianBlur', |
229 |
|
femorphology => 'feMorphology', |
230 |
|
fetile => 'feTile', |
231 |
|
filterres => 'filterRes', |
232 |
|
filterunits => 'filterUnits', |
233 |
|
glyphref => 'glyphRef', |
234 |
|
gradienttransform => 'gradientTransform', |
235 |
|
gradientunits => 'gradientUnits', |
236 |
|
kernelmatrix => 'kernelMatrix', |
237 |
|
kernelunitlength => 'kernelUnitLength', |
238 |
|
keypoints => 'keyPoints', |
239 |
|
keysplines => 'keySplines', |
240 |
|
keytimes => 'keyTimes', |
241 |
|
lengthadjust => 'lengthAdjust', |
242 |
|
limitingconeangle => 'limitingConeAngle', |
243 |
|
markerheight => 'markerHeight', |
244 |
|
markerunits => 'markerUnits', |
245 |
|
markerwidth => 'markerWidth', |
246 |
|
maskcontentunits => 'maskContentUnits', |
247 |
|
maskunits => 'maskUnits', |
248 |
|
numoctaves => 'numOctaves', |
249 |
|
pathlength => 'pathLength', |
250 |
|
patterncontentunits => 'patternContentUnits', |
251 |
|
patterntransform => 'patternTransform', |
252 |
|
patternunits => 'patternUnits', |
253 |
|
pointsatx => 'pointsAtX', |
254 |
|
pointsaty => 'pointsAtY', |
255 |
|
pointsatz => 'pointsAtZ', |
256 |
|
preservealpha => 'preserveAlpha', |
257 |
|
preserveaspectratio => 'preserveAspectRatio', |
258 |
|
primitiveunits => 'primitiveUnits', |
259 |
|
refx => 'refX', |
260 |
|
refy => 'refY', |
261 |
|
repeatcount => 'repeatCount', |
262 |
|
repeatdur => 'repeatDur', |
263 |
|
requiredextensions => 'requiredExtensions', |
264 |
|
specularconstant => 'specularConstant', |
265 |
|
specularexponent => 'specularExponent', |
266 |
|
spreadmethod => 'spreadMethod', |
267 |
|
startoffset => 'startOffset', |
268 |
|
stddeviation => 'stdDeviation', |
269 |
|
stitchtiles => 'stitchTiles', |
270 |
|
surfacescale => 'surfaceScale', |
271 |
|
systemlanguage => 'systemLanguage', |
272 |
|
tablevalues => 'tableValues', |
273 |
|
targetx => 'targetX', |
274 |
|
targety => 'targetY', |
275 |
|
textlength => 'textLength', |
276 |
|
viewbox => 'viewBox', |
277 |
|
viewtarget => 'viewTarget', |
278 |
|
xchannelselector => 'xChannelSelector', |
279 |
|
ychannelselector => 'yChannelSelector', |
280 |
|
zoomandpan => 'zoomAndPan', |
281 |
|
}; |
282 |
|
|
283 |
|
my $foreign_attr_xname = { |
284 |
|
'xlink:actuate' => [$XLINK_NS, ['xlink', 'actuate']], |
285 |
|
'xlink:arcrole' => [$XLINK_NS, ['xlink', 'arcrole']], |
286 |
|
'xlink:href' => [$XLINK_NS, ['xlink', 'href']], |
287 |
|
'xlink:role' => [$XLINK_NS, ['xlink', 'role']], |
288 |
|
'xlink:show' => [$XLINK_NS, ['xlink', 'show']], |
289 |
|
'xlink:title' => [$XLINK_NS, ['xlink', 'title']], |
290 |
|
'xlink:type' => [$XLINK_NS, ['xlink', 'type']], |
291 |
|
'xml:base' => [$XML_NS, ['xml', 'base']], |
292 |
|
'xml:lang' => [$XML_NS, ['xml', 'lang']], |
293 |
|
'xml:space' => [$XML_NS, ['xml', 'space']], |
294 |
|
'xmlns' => [$XMLNS_NS, [undef, 'xmlns']], |
295 |
|
'xmlns:xlink' => [$XMLNS_NS, ['xmlns', 'xlink']], |
296 |
|
}; |
297 |
|
|
298 |
|
## ISSUE: xmlns:xlink="non-xlink-ns" is not an error. |
299 |
|
|
300 |
my $c1_entity_char = { |
my $c1_entity_char = { |
301 |
0x80 => 0x20AC, |
0x80 => 0x20AC, |
302 |
0x81 => 0xFFFD, |
0x81 => 0xFFFD, |
3806 |
## Reprocess. |
## Reprocess. |
3807 |
next B; |
next B; |
3808 |
} else { |
} else { |
3809 |
## TODO: case fixup |
my $nsuri = $self->{open_elements}->[-1]->[0]->namespace_uri; |
3810 |
|
my $tag_name = $token->{tag_name}; |
3811 |
|
if ($nsuri eq $SVG_NS) { |
3812 |
|
$tag_name = { |
3813 |
|
altglyph => 'altGlyph', |
3814 |
|
altglyphdef => 'altGlyphDef', |
3815 |
|
altglyphitem => 'altGlyphItem', |
3816 |
|
animatecolor => 'animateColor', |
3817 |
|
animatemotion => 'animateMotion', |
3818 |
|
animatetransform => 'animateTransform', |
3819 |
|
clippath => 'clipPath', |
3820 |
|
feblend => 'feBlend', |
3821 |
|
fecolormatrix => 'feColorMatrix', |
3822 |
|
fecomponenttransfer => 'feComponentTransfer', |
3823 |
|
fecomposite => 'feComposite', |
3824 |
|
feconvolvematrix => 'feConvolveMatrix', |
3825 |
|
fediffuselighting => 'feDiffuseLighting', |
3826 |
|
fedisplacementmap => 'feDisplacementMap', |
3827 |
|
fedistantlight => 'feDistantLight', |
3828 |
|
feflood => 'feFlood', |
3829 |
|
fefunca => 'feFuncA', |
3830 |
|
fefuncb => 'feFuncB', |
3831 |
|
fefuncg => 'feFuncG', |
3832 |
|
fefuncr => 'feFuncR', |
3833 |
|
fegaussianblur => 'feGaussianBlur', |
3834 |
|
feimage => 'feImage', |
3835 |
|
femerge => 'feMerge', |
3836 |
|
femergenode => 'feMergeNode', |
3837 |
|
femorphology => 'feMorphology', |
3838 |
|
feoffset => 'feOffset', |
3839 |
|
fepointlight => 'fePointLight', |
3840 |
|
fespecularlighting => 'feSpecularLighting', |
3841 |
|
fespotlight => 'feSpotLight', |
3842 |
|
fetile => 'feTile', |
3843 |
|
feturbulence => 'feTurbulence', |
3844 |
|
foreignobject => 'foreignObject', |
3845 |
|
glyphref => 'glyphRef', |
3846 |
|
lineargradient => 'linearGradient', |
3847 |
|
radialgradient => 'radialGradient', |
3848 |
|
#solidcolor => 'solidColor', ## NOTE: Commented in spec (SVG1.2) |
3849 |
|
textpath => 'textPath', |
3850 |
|
}->{$tag_name} || $tag_name; |
3851 |
|
} |
3852 |
|
|
3853 |
|
## "adjust SVG attributes" (SVG only) - done in insert-element-f |
3854 |
|
|
3855 |
|
## "adjust foreign attributes" - done in insert-element-f |
3856 |
|
|
3857 |
!!!insert-element-f ($self->{open_elements}->[-1]->[0]->namespace_uri, $token); |
!!!insert-element-f ($nsuri, $tag_name, $token->{attributes}, $token); |
3858 |
|
|
3859 |
if ($self->{self_closing}) { |
if ($self->{self_closing}) { |
3860 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
6514 |
} elsif ($token->{tag_name} eq 'math' or |
} elsif ($token->{tag_name} eq 'math' or |
6515 |
$token->{tag_name} eq 'svg') { |
$token->{tag_name} eq 'svg') { |
6516 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
6517 |
|
|
6518 |
|
## "adjust SVG attributes" ('svg' only) - done in insert-element-f |
6519 |
|
|
6520 |
|
## "adjust foreign attributes" - done in insert-element-f |
6521 |
|
|
6522 |
!!!insert-element-f ($token->{tag_name} eq 'math' ? $MML_NS : $SVG_NS, $token); |
!!!insert-element-f ($token->{tag_name} eq 'math' ? $MML_NS : $SVG_NS, $token->{tag_name}, $token->{attributes}, $token); |
6523 |
|
|
6524 |
if ($self->{self_closing}) { |
if ($self->{self_closing}) { |
6525 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |