Skip to content

Effects Rewrite #1017

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

Closed
wants to merge 40 commits into from
Closed

Effects Rewrite #1017

wants to merge 40 commits into from

Conversation

mikesherov
Copy link
Member

Tasks

  • add backCompat for deprecated methods.
  • ensure blind / fold also animate the placeholder.
  • deprecate .effect('transfer'), introduce .transfer()
  • each effect should return itself for AMD.
  • .restoreStyle should remove .data()
  • .removePlaceholder shouldn't reset styles, introduce utility method.
  • Effects demo: The second call (showing) to fade is showing instantly.
  • Effects demo: Fold is broken in IE8 (vertical blind is good, but then regresses before the horizontal blind).
  • Effects demo: Highlight is broken (no effect).
  • Effects demo: Puff is broken (expands to bottom right instead of growing from center; doesn't fade).
  • Effects demo: Pulsate is broken (no effect).
  • Effects demo: Scale is broken (implodes to top right instead of center).
  • Effects demo: Slide is broken (no effect).
  • Effects demo: back to back effects aren't queueing properly for: size, scale
  • We need to look at what happens if you load an old effect definition with the new core. Does it break default modes? Anything else?
  • demos/effect/show.html, Scale is broken, throws Uncaught TypeError: Cannot call method 'call' of undefined in effect-scale.js:70.

    Discuss

  • size and scale are broken in master
  • the following items don't call show everytime first:
    • scale (calls size which does)
    • pulsate
    • puff (calls size which does)
    • fade (because it toggles)

Testing

  • re-enable createWrapper test since IE7 is no more.
  • demos in IE8+
  • unit tests pass in IE8+
  • visual tests are looking good in IE8+
  • get tests passing in "modern" browsers
  • visual tests in "modern" browsers.
  • demos in "modern" browsers.

Follow up

  • http://bugs.jqueryui.com/ticket/10606 Not a regression introduced by this PR (aka already broken): In IE8 the toggleClass demo doesn't animate the height decrease (first click), while the height increase is animated (second click).
  • http://bugs.jqueryui.com/ticket/10605 Other than transfer and size, we could simplify all effects by having the common done() function remove the placeholder (if it exists), and do the final hide based on the mode. There are a few effects which use if ( !show ) instead of if ( hide ) to determine if .hide() should be called, but those can probably all be normalized since this would only affect people explicitly passing a mode of effect when they really mean hide, which probably isn't happening. We'd need to have .createPlaceholder() store a reference to the placeholder to make this work, but that's simple.
  • file bug with core: ( subpixel jump on FF shake visual test )
  • file bug with chrome: (chrome "auto" reports "0px" for clip ) https://code.google.com/p/chromium/issues/detail?id=412921
  • file bugs with ui: deprecate backCompat'ed method, remove backcompat'ed methods
    http://bugs.jqueryui.com/ticket/10599 http://bugs.jqueryui.com/ticket/10600

@jzaefferer
Copy link
Member

Travis/grunt sezs: "FFFFFFFFF". At least there's no "UUUUUUUUUU".

@mikesherov
Copy link
Member Author

Yup, tests are broken. They test the wrong thing. I'll fix, but wanted to get some human eyes on it.

@gnarf
Copy link
Member

gnarf commented Oct 16, 2013

👍 seems sane to me.

@mikesherov
Copy link
Member Author

@scottgonzalez @jzaefferer ping. The last bits here are just verifying that visual and units are working in IE ( they all work in Safari, Opera, Chrome, FF), and also animating the placeholder for blind and fold.

Can you both review the code please?

@jzaefferer
Copy link
Member

Even when ignoring white space changes, I have a hard time reviewing this, since I know so little about the existing code. @mikesherov how about a Skype session where we review the code together? You could walk me (and Scott, if available) through the changes.

@scottgonzalez
Copy link
Member

If @mikesherov's availability is still low, I can walk you through the code some time this week. I have a decent understanding of the existing code and I've done a walk through of this code at least once with @mikesherov (though it was a long time ago).

@@ -75,20 +75,6 @@ test( "removeClass", function() {
equal( "", element[ 0 ].className );
});


/* TODO: Disabled - Can't figure out why this is failing in IE 6/7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Determine if we can enable this now that we don't support IE 6/7.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's testing a deprecated function anyway, but I'll see if I can enable it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked into enabling it, and it seemed like it passes, but I'm still removing the test because I'd have to remove it anyway in the future.

@scottgonzalez
Copy link
Member

We need to look at what happens if you load an old effect definition with the new core. Does it break default modes? Anything else?

@scottgonzalez
Copy link
Member

Initial findings from /demos/effect/default.html:

  • Fold is broken in IE8 (vertical blind is good, but then regresses before the horizontal blind).
  • Highlight is broken (no effect).
  • Puff is broken (expands to bottom right instead of growing from center; doesn't fade).
  • Pulsate is broken (no effect).
  • Scale is broken (implodes to top right instead of center).
  • Slide is broken (no effect).

@mikesherov
Copy link
Member Author

Hmmm. Any other good test files to use, @scottgonzalez? I was using the visual test suite, but apparently that isn't nearly good enough.

@scottgonzalez
Copy link
Member

Other than the actual test files, I think the default effect demo is the only other file to use.

@jzaefferer
Copy link
Member

demos/effect/show.html, Scale is broken, throws Uncaught TypeError: Cannot call method 'call' of undefined in effect-scale.js:70.

@jzaefferer
Copy link
Member

Not a regression introduced by this PR (aka already broken): In IE8 the toggleClass demo doesn't animate the height decrease (first click), while the height increase is animated (second click).

@mikesherov
Copy link
Member Author

Not a regression introduced by this PR (aka already broken): In IE8 the toggleClass demo doesn't animate the height decrease (first click), while the height increase is animated (second click).

I'm not going to fix this in the effects rewrite as I don't touch any of the toggleClass stuff. Filed a bug instead: http://bugs.jqueryui.com/ticket/10606

@jzaefferer
Copy link
Member

@mikesherov what's the status here? There's two open issues on the task list above, are you working on those? Do you need help with testing?

@mikesherov
Copy link
Member Author

@scottgonzalez @jzaefferer ready for rereview!

// that turn to inline block based on content (like img)
display: /^(inline|ruby)/.test( element.css( "display" ) ) ? "inline-block" : "block",
visibility: "hidden",
// margins need to be set to account for margin collapse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line, capitalization

@scottgonzalez
Copy link
Member

I still need to do some actual testing in the browser, but I finished looking through the changes.

@mikesherov Can you file an api.jqueryui.com issue for all the API changes and new methods? We can fill in the actual details later, but it'd be good to have a list of what we need to document.

@scottgonzalez
Copy link
Member

The height of the main element in the effect demos is now too small because of the font-size changes in master.

@scottgonzalez
Copy link
Member

Scale show doesn't animate, but showing via toggle does.

@mikesherov
Copy link
Member Author

@scottgonzalez the punchline was that the supplied params in the demo weren't sane. The code was fine :-\

@mikesherov
Copy link
Member Author

@jzaefferer @scottgonzalez ping for rereview

@mikesherov
Copy link
Member Author

@jzaefferer note that the semantics of .show( "size", to: { width:x, height:y } ) has changed to match .toggle, such that there is no longer a magic "from zero to to behavior" for show. show behaves exactly as a .toggle that ultimately called a show would do: that is, use the to as the starting point, and end on the non-hidden size of the element.

@scottgonzalez
Copy link
Member

Looks good. Just need to address the element size (see previous comment).

@mikesherov
Copy link
Member Author

@scottgonzalez addressed the element size. Should be good for final review. /cc @jzaefferer

@mikesherov
Copy link
Member Author

@scottgonzalez not sure what I need to document. Basically all the methods I deprecated were already not documented to begin with. Is the intent that for the effects rewrite we will document all of the helper methods I created on $.effects like $.effects.createPlaceholder and $.fn.cssClip? I'm not sure what needs to be documented. Would appreciate some insight here.

@scottgonzalez
Copy link
Member

We should document anything that an effect author would need. I'm not too worried about documenting stuff for old versions. Right now I just want a list of the method signatures in an issue on api.jqueryui.com so we make sure it gets done before the release.

@mikesherov
Copy link
Member Author

@scottgonzalez
Copy link
Member

Perfect. Thanks.

@@ -950,113 +1131,109 @@ $.extend( $.effects, {
// this should be a little more flexible in the future to handle a string & hash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still correct? It looks like only the formatting changed, but I doubt that we're going to change this method in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it in because I didn't write the original :-)

@jzaefferer
Copy link
Member

Tested locally and in BrowserStack on various browsers, using the visual test pages. Reviewed a few individual effects and effect.js in detail. Didn't find anything interesting except for those comments. Not sure if any of those even need to change, so this is likely good to land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants