Commit 3791196d authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2010-07-09 Eric Seidel <eric@webkit.org>

        Reviewed by Adam Barth.

        Implement SVG attribute case mapping for HTMLTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=41949

        Update results now that we pass 3 more tests.

        * html5lib/runner-expected-html5.txt:
2010-07-09  Eric Seidel  <eric@webkit.org>

        Reviewed by Adam Barth.

        Implement SVG attribute case mapping for HTMLTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=41949

        Tested by html5lib/runner.html.

        * html/HTMLTreeBuilder.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@62994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f6b969fd
2010-07-09 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
Implement SVG attribute case mapping for HTMLTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=41949
Update results now that we pass 3 more tests.
* html5lib/runner-expected-html5.txt:
2010-07-09 Xiaomei Ji <xji@chromium.org>
 
Reviewed by David Levin.
CONSOLE MESSAGE: line 1: SyntaxError: Parse error
CONSOLE MESSAGE: line 1: SyntaxError: Parse error
CONSOLE MESSAGE: line 0: Warning: Problem parsing viewBox=""
CONSOLE MESSAGE: line 0: Warning: Problem parsing viewBox=""
CONSOLE MESSAGE: line 0: Warning: Problem parsing viewBox=""
CONSOLE MESSAGE: line 2: PASS
CONSOLE MESSAGE: line 2: FOO<span>BAR</span>BAZ
Content-Type: text/plain
......@@ -1165,432 +1168,12 @@ Expected:
| xml lang="en"
| "bar"
resources/tests11.dat:
1
2
3
4
5
6
7
8
Test 1 of 9 in resources/tests11.dat failed. Input:
<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterRes='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| attributename=""
| attributetype=""
| basefrequency=""
| baseprofile=""
| calcmode=""
| clippathunits=""
| contentscripttype=""
| contentstyletype=""
| diffuseconstant=""
| edgemode=""
| externalresourcesrequired=""
| filterres=""
| filterunits=""
| glyphref=""
| gradienttransform=""
| gradientunits=""
| kernelmatrix=""
| kernelunitlength=""
| keypoints=""
| keysplines=""
| keytimes=""
| lengthadjust=""
| limitingconeangle=""
| markerheight=""
| markerunits=""
| markerwidth=""
| maskcontentunits=""
| maskunits=""
| numoctaves=""
| pathlength=""
| patterncontentunits=""
| patterntransform=""
| patternunits=""
| pointsatx=""
| pointsaty=""
| pointsatz=""
| preservealpha=""
| preserveaspectratio=""
| primitiveunits=""
| refx=""
| refy=""
| repeatcount=""
| repeatdur=""
| requiredextensions=""
| requiredfeatures=""
| specularconstant=""
| specularexponent=""
| spreadmethod=""
| startoffset=""
| stddeviation=""
| stitchtiles=""
| surfacescale=""
| systemlanguage=""
| tablevalues=""
| targetx=""
| targety=""
| textlength=""
| viewbox=""
| viewtarget=""
| xchannelselector=""
| ychannelselector=""
| zoomandpan=""
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| attributeName=""
| attributeType=""
| baseFrequency=""
| baseProfile=""
| calcMode=""
| clipPathUnits=""
| contentScriptType=""
| contentStyleType=""
| diffuseConstant=""
| edgeMode=""
| externalResourcesRequired=""
| filterRes=""
| filterUnits=""
| glyphRef=""
| gradientTransform=""
| gradientUnits=""
| kernelMatrix=""
| kernelUnitLength=""
| keyPoints=""
| keySplines=""
| keyTimes=""
| lengthAdjust=""
| limitingConeAngle=""
| markerHeight=""
| markerUnits=""
| markerWidth=""
| maskContentUnits=""
| maskUnits=""
| numOctaves=""
| pathLength=""
| patternContentUnits=""
| patternTransform=""
| patternUnits=""
| pointsAtX=""
| pointsAtY=""
| pointsAtZ=""
| preserveAlpha=""
| preserveAspectRatio=""
| primitiveUnits=""
| refX=""
| refY=""
| repeatCount=""
| repeatDur=""
| requiredExtensions=""
| requiredFeatures=""
| specularConstant=""
| specularExponent=""
| spreadMethod=""
| startOffset=""
| stdDeviation=""
| stitchTiles=""
| surfaceScale=""
| systemLanguage=""
| tableValues=""
| targetX=""
| targetY=""
| textLength=""
| viewBox=""
| viewTarget=""
| xChannelSelector=""
| yChannelSelector=""
| zoomAndPan=""
Test 2 of 9 in resources/tests11.dat failed. Input:
<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' CONTENTSCRIPTTYPE='' CONTENTSTYLETYPE='' DIFFUSECONSTANT='' EDGEMODE='' EXTERNALRESOURCESREQUIRED='' FILTERRES='' FILTERUNITS='' GLYPHREF='' GRADIENTTRANSFORM='' GRADIENTUNITS='' KERNELMATRIX='' KERNELUNITLENGTH='' KEYPOINTS='' KEYSPLINES='' KEYTIMES='' LENGTHADJUST='' LIMITINGCONEANGLE='' MARKERHEIGHT='' MARKERUNITS='' MARKERWIDTH='' MASKCONTENTUNITS='' MASKUNITS='' NUMOCTAVES='' PATHLENGTH='' PATTERNCONTENTUNITS='' PATTERNTRANSFORM='' PATTERNUNITS='' POINTSATX='' POINTSATY='' POINTSATZ='' PRESERVEALPHA='' PRESERVEASPECTRATIO='' PRIMITIVEUNITS='' REFX='' REFY='' REPEATCOUNT='' REPEATDUR='' REQUIREDEXTENSIONS='' REQUIREDFEATURES='' SPECULARCONSTANT='' SPECULAREXPONENT='' SPREADMETHOD='' STARTOFFSET='' STDDEVIATION='' STITCHTILES='' SURFACESCALE='' SYSTEMLANGUAGE='' TABLEVALUES='' TARGETX='' TARGETY='' TEXTLENGTH='' VIEWBOX='' VIEWTARGET='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| attributename=""
| attributetype=""
| basefrequency=""
| baseprofile=""
| calcmode=""
| clippathunits=""
| contentscripttype=""
| contentstyletype=""
| diffuseconstant=""
| edgemode=""
| externalresourcesrequired=""
| filterres=""
| filterunits=""
| glyphref=""
| gradienttransform=""
| gradientunits=""
| kernelmatrix=""
| kernelunitlength=""
| keypoints=""
| keysplines=""
| keytimes=""
| lengthadjust=""
| limitingconeangle=""
| markerheight=""
| markerunits=""
| markerwidth=""
| maskcontentunits=""
| maskunits=""
| numoctaves=""
| pathlength=""
| patterncontentunits=""
| patterntransform=""
| patternunits=""
| pointsatx=""
| pointsaty=""
| pointsatz=""
| preservealpha=""
| preserveaspectratio=""
| primitiveunits=""
| refx=""
| refy=""
| repeatcount=""
| repeatdur=""
| requiredextensions=""
| requiredfeatures=""
| specularconstant=""
| specularexponent=""
| spreadmethod=""
| startoffset=""
| stddeviation=""
| stitchtiles=""
| surfacescale=""
| systemlanguage=""
| tablevalues=""
| targetx=""
| targety=""
| textlength=""
| viewbox=""
| viewtarget=""
| xchannelselector=""
| ychannelselector=""
| zoomandpan=""
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| attributeName=""
| attributeType=""
| baseFrequency=""
| baseProfile=""
| calcMode=""
| clipPathUnits=""
| contentScriptType=""
| contentStyleType=""
| diffuseConstant=""
| edgeMode=""
| externalResourcesRequired=""
| filterRes=""
| filterUnits=""
| glyphRef=""
| gradientTransform=""
| gradientUnits=""
| kernelMatrix=""
| kernelUnitLength=""
| keyPoints=""
| keySplines=""
| keyTimes=""
| lengthAdjust=""
| limitingConeAngle=""
| markerHeight=""
| markerUnits=""
| markerWidth=""
| maskContentUnits=""
| maskUnits=""
| numOctaves=""
| pathLength=""
| patternContentUnits=""
| patternTransform=""
| patternUnits=""
| pointsAtX=""
| pointsAtY=""
| pointsAtZ=""
| preserveAlpha=""
| preserveAspectRatio=""
| primitiveUnits=""
| refX=""
| refY=""
| repeatCount=""
| repeatDur=""
| requiredExtensions=""
| requiredFeatures=""
| specularConstant=""
| specularExponent=""
| spreadMethod=""
| startOffset=""
| stdDeviation=""
| stitchTiles=""
| surfaceScale=""
| systemLanguage=""
| tableValues=""
| targetX=""
| targetY=""
| textLength=""
| viewBox=""
| viewTarget=""
| xChannelSelector=""
| yChannelSelector=""
| zoomAndPan=""
Test 3 of 9 in resources/tests11.dat failed. Input:
<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' contentscripttype='' contentstyletype='' diffuseconstant='' edgemode='' externalresourcesrequired='' filterres='' filterunits='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| attributename=""
| attributetype=""
| basefrequency=""
| baseprofile=""
| calcmode=""
| clippathunits=""
| contentscripttype=""
| contentstyletype=""
| diffuseconstant=""
| edgemode=""
| externalresourcesrequired=""
| filterres=""
| filterunits=""
| glyphref=""
| gradienttransform=""
| gradientunits=""
| kernelmatrix=""
| kernelunitlength=""
| keypoints=""
| keysplines=""
| keytimes=""
| lengthadjust=""
| limitingconeangle=""
| markerheight=""
| markerunits=""
| markerwidth=""
| maskcontentunits=""
| maskunits=""
| numoctaves=""
| pathlength=""
| patterncontentunits=""
| patterntransform=""
| patternunits=""
| pointsatx=""
| pointsaty=""
| pointsatz=""
| preservealpha=""
| preserveaspectratio=""
| primitiveunits=""
| refx=""
| refy=""
| repeatcount=""
| repeatdur=""
| requiredextensions=""
| requiredfeatures=""
| specularconstant=""
| specularexponent=""
| spreadmethod=""
| startoffset=""
| stddeviation=""
| stitchtiles=""
| surfacescale=""
| systemlanguage=""
| tablevalues=""
| targetx=""
| targety=""
| textlength=""
| viewbox=""
| viewtarget=""
| xchannelselector=""
| ychannelselector=""
| zoomandpan=""
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| attributeName=""
| attributeType=""
| baseFrequency=""
| baseProfile=""
| calcMode=""
| clipPathUnits=""
| contentScriptType=""
| contentStyleType=""
| diffuseConstant=""
| edgeMode=""
| externalResourcesRequired=""
| filterRes=""
| filterUnits=""
| glyphRef=""
| gradientTransform=""
| gradientUnits=""
| kernelMatrix=""
| kernelUnitLength=""
| keyPoints=""
| keySplines=""
| keyTimes=""
| lengthAdjust=""
| limitingConeAngle=""
| markerHeight=""
| markerUnits=""
| markerWidth=""
| maskContentUnits=""
| maskUnits=""
| numOctaves=""
| pathLength=""
| patternContentUnits=""
| patternTransform=""
| patternUnits=""
| pointsAtX=""
| pointsAtY=""
| pointsAtZ=""
| preserveAlpha=""
| preserveAspectRatio=""
| primitiveUnits=""
| refX=""
| refY=""
| repeatCount=""
| repeatDur=""
| requiredExtensions=""
| requiredFeatures=""
| specularConstant=""
| specularExponent=""
| spreadMethod=""
| startOffset=""
| stdDeviation=""
| stitchTiles=""
| surfaceScale=""
| systemLanguage=""
| tableValues=""
| targetX=""
| targetY=""
| textLength=""
| viewBox=""
| viewTarget=""
| xChannelSelector=""
| yChannelSelector=""
| zoomAndPan=""
Test 4 of 9 in resources/tests11.dat failed. Input:
<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterRes='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>
Got:
......
2010-07-09 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
Implement SVG attribute case mapping for HTMLTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=41949
Tested by html5lib/runner.html.
* html/HTMLTreeBuilder.cpp:
2010-07-09 Andy Estes <aestes@apple.com>
 
Reviewed by Adele Peterson.
......@@ -78,6 +78,14 @@ public:
void setValue(const AtomicString& value) { m_value = value; }
void setPrefix(const AtomicString& prefix) { m_name.setPrefix(prefix); }
// Note: This API is only for HTMLTreeBuilder. It is not safe to change the name
// of an attribute once parseMappedAttributes has been called as DOM elements
// may placed the Attribute in a hash.
void parserSetLocalName(const AtomicString& localName)
{
m_name = QualifiedName(m_name.prefix(), localName, m_name.namespaceURI());
}
bool isMappedAttribute() { return m_isMappedAttribute; }
private:
......
......@@ -661,9 +661,93 @@ void HTMLTreeBuilder::processCloseWhenNestedTag(AtomicHTMLToken& token)
namespace {
#if ENABLE(SVG)
void adjustSVGAttributes(AtomicHTMLToken&)
{
notImplemented();
typedef HashMap<AtomicString, AtomicString> SVGAttributeCaseMap;
void addAttribute(SVGAttributeCaseMap* map, const QualifiedName& attributeName)
{
map->add(attributeName.localName().lower(), attributeName.localName());
}
void adjustSVGAttributes(AtomicHTMLToken& token)
{
static SVGAttributeCaseMap* svgAttributes = 0;
if (!svgAttributes) {
svgAttributes = new SVGAttributeCaseMap;
addAttribute(svgAttributes, SVGNames::attributeNameAttr);
addAttribute(svgAttributes, SVGNames::attributeTypeAttr);
addAttribute(svgAttributes, SVGNames::baseFrequencyAttr);
addAttribute(svgAttributes, SVGNames::baseProfileAttr);
addAttribute(svgAttributes, SVGNames::calcModeAttr);
addAttribute(svgAttributes, SVGNames::clipPathUnitsAttr);
addAttribute(svgAttributes, SVGNames::contentScriptTypeAttr);
addAttribute(svgAttributes, SVGNames::contentStyleTypeAttr);
addAttribute(svgAttributes, SVGNames::diffuseConstantAttr);
addAttribute(svgAttributes, SVGNames::edgeModeAttr);
addAttribute(svgAttributes, SVGNames::externalResourcesRequiredAttr);
addAttribute(svgAttributes, SVGNames::filterResAttr);
addAttribute(svgAttributes, SVGNames::filterUnitsAttr);
addAttribute(svgAttributes, SVGNames::glyphRefAttr);
addAttribute(svgAttributes, SVGNames::gradientTransformAttr);
addAttribute(svgAttributes, SVGNames::gradientUnitsAttr);
addAttribute(svgAttributes, SVGNames::kernelMatrixAttr);
addAttribute(svgAttributes, SVGNames::kernelUnitLengthAttr);
addAttribute(svgAttributes, SVGNames::keyPointsAttr);
addAttribute(svgAttributes, SVGNames::keySplinesAttr);
addAttribute(svgAttributes, SVGNames::keyTimesAttr);
addAttribute(svgAttributes, SVGNames::lengthAdjustAttr);
addAttribute(svgAttributes, SVGNames::limitingConeAngleAttr);
addAttribute(svgAttributes, SVGNames::markerHeightAttr);
addAttribute(svgAttributes, SVGNames::markerUnitsAttr);
addAttribute(svgAttributes, SVGNames::markerWidthAttr);
addAttribute(svgAttributes, SVGNames::maskContentUnitsAttr);
addAttribute(svgAttributes, SVGNames::maskUnitsAttr);
addAttribute(svgAttributes, SVGNames::numOctavesAttr);
addAttribute(svgAttributes, SVGNames::pathLengthAttr);
addAttribute(svgAttributes, SVGNames::patternContentUnitsAttr);
addAttribute(svgAttributes, SVGNames::patternTransformAttr);
addAttribute(svgAttributes, SVGNames::patternUnitsAttr);
addAttribute(svgAttributes, SVGNames::pointsAtXAttr);
addAttribute(svgAttributes, SVGNames::pointsAtYAttr);
addAttribute(svgAttributes, SVGNames::pointsAtZAttr);
addAttribute(svgAttributes, SVGNames::preserveAlphaAttr);
addAttribute(svgAttributes, SVGNames::preserveAspectRatioAttr);
addAttribute(svgAttributes, SVGNames::primitiveUnitsAttr);
addAttribute(svgAttributes, SVGNames::refXAttr);
addAttribute(svgAttributes, SVGNames::refYAttr);
addAttribute(svgAttributes, SVGNames::repeatCountAttr);
addAttribute(svgAttributes, SVGNames::repeatDurAttr);
addAttribute(svgAttributes, SVGNames::requiredExtensionsAttr);
addAttribute(svgAttributes, SVGNames::requiredFeaturesAttr);
addAttribute(svgAttributes, SVGNames::specularConstantAttr);
addAttribute(svgAttributes, SVGNames::specularExponentAttr);
addAttribute(svgAttributes, SVGNames::spreadMethodAttr);
addAttribute(svgAttributes, SVGNames::startOffsetAttr);
addAttribute(svgAttributes, SVGNames::stdDeviationAttr);
addAttribute(svgAttributes, SVGNames::stitchTilesAttr);
addAttribute(svgAttributes, SVGNames::surfaceScaleAttr);
addAttribute(svgAttributes, SVGNames::systemLanguageAttr);
addAttribute(svgAttributes, SVGNames::tableValuesAttr);
addAttribute(svgAttributes, SVGNames::targetXAttr);
addAttribute(svgAttributes, SVGNames::targetYAttr);
addAttribute(svgAttributes, SVGNames::textLengthAttr);
addAttribute(svgAttributes, SVGNames::viewBoxAttr);
addAttribute(svgAttributes, SVGNames::viewTargetAttr);
addAttribute(svgAttributes, SVGNames::xChannelSelectorAttr);
addAttribute(svgAttributes, SVGNames::yChannelSelectorAttr);
addAttribute(svgAttributes, SVGNames::zoomAndPanAttr);
}
NamedNodeMap* attributes = token.attributes();
if (!attributes)
return;
for (unsigned x = 0; x < attributes->length(); ++x) {
Attribute* attribute = attributes->attributeItem(x);
const AtomicString& casedName = svgAttributes->get(attribute->localName());
if (!casedName.isNull())
attribute->parserSetLocalName(casedName);
}
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment