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

velocity ios transform do not work #920

Open
cjh42694 opened this issue Jul 3, 2020 · 2 comments
Open

velocity ios transform do not work #920

cjh42694 opened this issue Jul 3, 2020 · 2 comments

Comments

@cjh42694
Copy link

cjh42694 commented Jul 3, 2020

my system information

  • VelocityJS version: 2.0.6
  • Browser: safari
  • Operating System: ios 11.4

Please describe your issue in as much detail as possible:

when i use velocity.js in ios, I found transform style setted in attribute,not style;in android everything is ok
To solve this bug, i Commented this code.
it seems like that elements been known as svg elements

var base = document.createElement('div'),
        rxSubtype = /^SVG(.*)Element$/,
        rxElement = /Element$/;
   
    Object.getOwnPropertyNames(window).forEach(function (property) {
        
        var subtype = rxSubtype.exec(property);
        if (subtype && subtype[1] !== 'SVG') {
            
            // Don't do SVGSVGElement.
            try {
                var element = subtype[1] ? document.createElementNS('http://www.w3.org/2000/svg', (subtype[1] || 'svg').toLowerCase()) : document.createElement('svg');
                // tslint:disable-next-line:forin
                for (var attribute in element) {
                    // Although this isn't a tween without prototypes, we do
                    // want to get hold of all attributes and not just own ones.
                    var value = element[attribute];
                    if (isString(attribute) && !(attribute[0] === 'o' && attribute[1] === 'n') && attribute !== attribute.toUpperCase() && !rxElement.test(attribute) && !(attribute in base) && !isFunction(value)) {
                        // TODO: Should this all be set on the generic SVGElement, it would save space and time, but not as powerful
                        
                        registerNormalization([property, attribute, getAttribute(attribute)]);
                    }
                }
            } catch (e) {
                console.error('VelocityJS: Error when trying to identify SVG attributes on ' + property + '.', e);
            }
        }
    });

Steps for reproducing this issue (code):

this is a demo
https://codepen.io/cjh42694/pen/MWKrVYE

@Rycochet
Copy link
Collaborator

I just want to say that I've got this up on my dashboard, and want to do something about it when I have the time / energy - thanks for a really nice bug report!

@Rycochet
Copy link
Collaborator

Rycochet commented Aug 3, 2020

Made a small change in the code - all SVG attributes now get camelCase prefixed with svg - going to be a little while before it can be tested easily, but making sure this works is important!

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

No branches or pull requests

2 participants