Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jevery23
Copy link
Owner

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.

@jevery23 jevery23 self-assigned this Sep 21, 2017
{
var nodeName = element.nodeName;

if (nodeName == "svg")
Copy link
Collaborator

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.

Copy link
Collaborator

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))

jevery23 pushed a commit that referenced this pull request Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants