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

Fix for makeClipping/undoClipping issue #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

victor-homyakov
Copy link
Contributor

I've made earlier pull request with failing unit test for issue #1063 with Element#makeClipping()/Element#undoClipping(). Here is a patch for this issue. It deals with exact value of element.style, not with computed Element#getStyle().

I've made earlier pull request with failing unit test for issue #1063 with `Element#makeClipping()`/`Element#undoClipping()`. Here is a patch for this issue. It deals with exact value of `element.style`, not with computed `Element#getStyle()`.
// called `makeClipping` already. An `undefined` value means we haven't.
if (Object.isUndefined(madeClipping)) {
var overflow = Element.getStyle(element, 'overflow');
if (Object.isString(madeClipping)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be if (!Object.isString(madeClipping))? If it's a string, it means we've already made this element clip, and so we're doing extra work for no reason.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, do you need to change these conditionals at all? I might be missing something, but won't it suffice to do var overflow = element.style.overflow || '' like you did in the line below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are absolutely correct, I've somehow missed negation in if (!Object.isString(madeClipping)).

And yes again, unchanged if (Object.isUndefined(madeClipping)) should work. I've made here isString() just for symmetry with check at line 1427: if (Object.isString(overflow)).

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.

None yet

2 participants