haikuwebkit/LayoutTests/svg/css/svg-attribute-length-parsin...

15 lines
485 B
Plaintext
Raw Permalink Normal View History

Source/WebCore: Missing support for innerHTML on SVGElement https://bugs.webkit.org/show_bug.cgi?id=136903 Patch by Sylvain Galineau <galineau@adobe.com> on 2014-12-02 Reviewed by Dean Jackson. Two parts to this patch: 1. Move innerHTML/outerHTML to Element so SVG elements can inherit them, per https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#innerhtml 2. Make sure fragment insertion is processed relative to the proper node, per http://www.whatwg.org/specs/web-apps/current-work/#adjusted-current-node The latter part was ported over from Blink. Test: svg/in-html/svg-inner-html.html * bindings/objc/PublicDOMInterfaces.h: Move innerHTML/outerHTML to Element. * dom/Element.cpp: (WebCore::Element::mergeWithNextTextNode): Helper used by Element::innerHTML/outerHTML as well as HTMLElement::innerText/outerText; moved to Element as protected static. (WebCore::Element::innerHTML): Moved from HTMLElement. (WebCore::Element::outerHTML): Moved from HTMLElement. (WebCore::Element::setOuterHTML): Moved from HTMLElement. (WebCore::Element::setInnerHTML): Moved from HTMLElement. * dom/Element.h: * dom/Element.idl: * html/HTMLElement.cpp: (WebCore::HTMLElement::innerHTML): Deleted. (WebCore::HTMLElement::outerHTML): Deleted. (WebCore::HTMLElement::setInnerHTML): Deleted. (WebCore::mergeWithNextTextNode): Deleted. (WebCore::HTMLElement::setOuterHTML): Deleted. * html/HTMLElement.h: * html/HTMLElement.idl: * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext): no more m_contextElement. (WebCore::HTMLTreeBuilder::constructTree): read namespace from adjusted current node. (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately): use contextElementStackItem for insertion. (WebCore::HTMLTreeBuilder::adjustedCurrentStackItem): compute adjusted current node. (WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent): use adjusted current node for context. (WebCore::HTMLTreeBuilder::processTokenInForeignContent): use adjusted current node to read namespace. * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::FragmentParsingContext::contextElement): Deleted. Read from contextElementStackItem. (WebCore::HTMLTreeBuilder::FragmentParsingContext::contextElementStackItem): Added. LayoutTests: Missing support for innerHTML on SVGElement https://bugs.webkit.org/show_bug.cgi?id=136903 Patch by Sylvain Galineau <galineau@adobe.com> on 2014-12-02 Reviewed by Dean Jackson. * js/dom/dom-static-property-for-in-iteration-expected.txt: The property enumeration order is different now that inner/outerHTML are inherited from Element * platform/mac/svg/in-html/svg-inner-html-expected.png: Added. * svg/css/svg-attribute-length-parsing-expected.txt: Now that innerHTML works, the output should start with 'Test' * svg/in-html/svg-inner-html-expected.txt: Added. * svg/in-html/svg-inner-html.html: Added. Canonical link: https://commits.webkit.org/157008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-02 10:50:11 +00:00
Test
Colors seem to be parsed using HTML quirks in SVG attributes https://bugs.webkit.org/show_bug.cgi?id=46112 Source/WebCore: Reviewed by Eric Seidel. Finally move to SVGAttributeMode on parsing SVG presentation attributes. SVG attributes are mainly parsed in the strict mode, which affects strict parsing of colors and no spaces between values and units. Unit less values are still allowed. Tests: svg/css/svg-attribute-length-parsing.html svg/css/svg-attribute-parser-mode.html * css/CSSGrammar.y: No quirks mode for SVG. * css/CSSParser.h: (WebCore::CSSParser::inStrictMode): SVGAttributeMode also implies strict parsing. (WebCore::CSSParser::inQuirksMode): Remove SVGAttributeMode from quirks mode. * css/CSSParserMode.h: (isStrictParserMode): Ditto. * dom/StyledElement.cpp: (WebCore::StyledElement::updateAttributeStyle): * svg/SVGElementRareData.h: (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties): * svg/SVGFontFaceElement.cpp: (WebCore::SVGFontFaceElement::SVGFontFaceElement): * svg/SVGStyledElement.cpp: Switch to SVGAttributeMode if we parse a SVG presentation attribute. (WebCore::SVGStyledElement::getPresentationAttribute): LayoutTests: Test that values of SVG presentation attributes are parsed in strict mode. At the moment this affects strict color parsing and no spaces between values and units. Reviewed by Eric Seidel. * svg/animations/script-tests/animate-color-fill-from-by.js: * svg/css/script-tests/svg-attribute-length-parsing.js: Added. * svg/css/script-tests/svg-attribute-parser-mode.js: Added. * svg/css/svg-attribute-length-parsing-expected.txt: Added. * svg/css/svg-attribute-length-parsing.html: Added. * svg/css/svg-attribute-parser-mode-expected.txt: Added. * svg/css/svg-attribute-parser-mode.html: Added. Canonical link: https://commits.webkit.org/100145@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-31 03:36:38 +00:00
Test CSS parsing on SVG presentation attributes.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS document.defaultView.getComputedStyle(text, null).fontSize is "16px"
PASS document.defaultView.getComputedStyle(text, null).fontSize is "100px"
PASS document.defaultView.getComputedStyle(text, null).fontSize is "16px"
PASS document.defaultView.getComputedStyle(text, null).fontSize is "16px"
PASS successfullyParsed is true
TEST COMPLETE