Bug 101243 - Add an SVG content model test
Summary: Add an SVG content model test
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Florin Malita
URL:
Keywords:
Depends on:
Blocks: 101216
  Show dependency treegraph
 
Reported: 2012-11-05 12:04 PST by Florin Malita
Modified: 2013-02-15 23:48 PST (History)
4 users (show)

See Also:


Attachments
Patch (11.49 KB, patch)
2012-11-05 12:15 PST, Florin Malita
no flags Details | Formatted Diff | Diff
Patch (11.53 KB, patch)
2012-11-12 07:45 PST, Florin Malita
krit: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florin Malita 2012-11-05 12:04:49 PST
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).
Comment 1 Florin Malita 2012-11-05 12:15:24 PST
Created attachment 172375 [details]
Patch
Comment 2 Florin Malita 2012-11-05 12:20:25 PST
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 3 Build Bot 2012-11-05 16:39:23 PST
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 4 Nikolas Zimmermann 2012-11-09 23:11:36 PST
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?
Comment 5 Florin Malita 2012-11-12 07:32:20 PST
(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.
Comment 6 Florin Malita 2012-11-12 07:45:49 PST
Created attachment 173646 [details]
Patch
Comment 7 Florin Malita 2012-11-26 09:51:43 PST
Bump.
Comment 8 Dirk Schulze 2012-11-26 10:12:50 PST
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 9 Dirk Schulze 2013-02-15 23:48:35 PST
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.