In support of https://bugs.webkit.org/show_bug.cgi?id=101216, we need a test to cover content model validation. The approach I'm currently exploring relies on window.internals.elementRenderTreeAsText() to check whether renderers are created for various parent/child SVG element combinations. Parsing DRT output is somewhat frail - if it turns out to not be viable maybe we could extend the window.internals API with something like hasRenderer(element).
Created attachment 172375 [details] Patch
The patch is intended to be a flexible skeleton for SVG content validation. Adding a new element test should be as easy as adding a new validateTag() call and maybe some minor property tweaks in svgtags.js: validateTag('dasTag', [ 'validChild1', 'validChild2', 'VALID_CLASS1',...]);
Comment on attachment 172375 [details] Patch Attachment 172375 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/14679337 New failing tests: svg/dom/content-model.html
Comment on attachment 172375 [details] Patch Looks good to me Florin, can you comment on the Mac ews error? svg/dom/content-model.html [ Failure ] Seems like the result doesn't match on Mac?
(In reply to comment #4) > (From update of attachment 172375 [details]) > Looks good to me Florin, can you comment on the Mac ews error? > > svg/dom/content-model.html [ Failure ] > > Seems like the result doesn't match on Mac? Thanks Niko, I finally got around to test on a Mac: silly return outside a function causing syntax errors :) I'll update momentarily.
Created attachment 173646 [details] Patch
Bump.
Comment on attachment 173646 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=173646&action=review > LayoutTests/svg/dom/resources/svgtags.js:28 > + feDiffuseLighting: { needParent: 'filter', needChld: [ 'fePointLight' ] }, This and other element descriptions are not complete. Can you add a FIXME that points that out, or make it complete please? Other then that, looks great.
Comment on attachment 173646 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=173646&action=review >> LayoutTests/svg/dom/resources/svgtags.js:28 >> + feDiffuseLighting: { needParent: 'filter', needChld: [ 'fePointLight' ] }, > > This and other element descriptions are not complete. Can you add a FIXME that points that out, or make it complete please? Other then that, looks great. A short note that this should be extended at the beginning might be enough. r=me.