Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Additional tests for Element#makeClipping(), Element#undoClipping() #46

wants to merge 1 commit into from

2 participants


See ticket #1063:
1. Current implementation doesn't work properly for inline style="overflow:auto;"
2. Inline style isn't restored properly after undoClipping() - it is replaced with computed style
3. Computing style with Element.getStyle() isn't needed - performance optimization is possible


I'll use these tests to help me fix #1063. Until then, I'll keep this open because I don't want to commit tests without the fix that will make them pass. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 6, 2012
  1. @victor-homyakov
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 5 deletions.
  1. +15 −5 test/unit/dom_test.js
20 test/unit/dom_test.js
@@ -676,14 +676,24 @@ new Test.Unit.Runner({
this.assertEqual(chained, chained.undoClipping());
this.assertEqual(chained, chained.undoClipping().makeClipping());
- ['hidden','visible','scroll'].each( function(overflowValue) {
- var element = $('element_with_'+overflowValue+'_overflow');
- this.assertEqual(overflowValue, element.getStyle('overflow'));
+ var items = [
+ {id: 'hidden', inline: 'hidden', computed: 'hidden'},
+ {id: 'visible', inline: 'visible', computed: 'visible'},
+ {id: 'scroll', inline: 'scroll', computed: 'scroll'},
+ {id: 'auto', inline: 'auto', computed: null},
+ {id: 'empty', inline: '', computed: 'visible'}
+ ];
+ items.each(function(item) {
+ var element = $('element_with_' + + '_overflow');
+ this.assertEqual(item.inline,, 'inline style');
+ this.assertEqual(item.computed, element.getStyle('overflow'), 'computed style');
+ this.assertEqual('hidden',;
this.assertEqual('hidden', element.getStyle('overflow'));
- this.assertEqual(overflowValue, element.getStyle('overflow'));
+ this.assertEqual(item.inline,, 'restored inline style');
+ this.assertEqual(item.computed, element.getStyle('overflow'), 'restored computed style');
}, this);
Something went wrong with that request. Please try again.