-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new SVG CSS transform and preserve 3d recipe. #2
base: master
Are you sure you want to change the base?
Conversation
{ | ||
var nodeName = element.nodeName; | ||
|
||
if (nodeName == "svg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only allow <svg>
to be looked at. What if the transform is on a different element. I'm trying to track down every possible element that it can be on but the spec doesn't seem clear here so I'll sync up with Bogdan on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that you're adding children to the elementsToCheck array, not sure if we should do it this way since recipes will pass in every element. So you should be able to just check that the nodeName is contained within an array that contains various SVG elements (which I'll get to you after chatting with Bogdan) like this:
if (elementToCheck.includes(nodeName))
… comments and IM chat with Greg.
…each individual value. Changed test to have different transforms applied on the g and text elements respectively.
I have created a Crawler recipe to count the number of svg elements on each page and then also indicate how many of these have the transform CSS property applied and the transform-style CSS property applied with value "preserve-3d" in their namespace.
I ran this recipe against a small list of URLs and it seemed to work okay.