mediawiki-extensions-Visual.../modules/ve/ui/elements
Trevor Parscal 9303648406 The amazing mystery of scrollTop and onscroll
What I learned today:
* Window doesn't have a scrollTop property, body does (that's why animate
  doesn't work on window)
* jQuery.scrollTop() doesn't work on body (in firefox) but works on
  window everywhere
* jQuery.scrollTop() uses scroll offset, not the scrollTop property
* Body doesn't have an onscroll event, window does

What I really learned today:
* Browsers are very poorly designed

Objective:
* Make clippable elements properly resize in Firefox when scrolled

Diagnosis:
* Scroll events were not being emitted from the scrollable container
  after the merge of Ifec0dae598f7fd99270588bd8ca77777a07e9669 because
  such events are not emitted from body tags, only scrollable divs and
  windows
* jQuery.scrollTop was giving incorrect values when called on the body
  instead of the window, so also due to the aforementioned change, the
  clipping was being calculated incorrectly

Treatment:
* Add $clippableScroller property, which is either a scrollable div or
  the window (could this have side-effects if someone did something
  ridiculous like made the body absolutely positioned and overflow:auto?
  Yes, but I have no other option and that's a strange edge case don't
  you think?)
* Use $clippableScroller for listening to scroll events and getting the
  scrollTop value from jQuery

Bug: 55343
Change-Id: I819aba60b200059886b347115fda437b3dc9cb7a
2013-10-07 13:25:02 -07:00
..
ve.ui.ClippableElement.js The amazing mystery of scrollTop and onscroll 2013-10-07 13:25:02 -07:00
ve.ui.FlaggableElement.js 'Config' -> 'Configuration' in all comments 2013-09-25 11:23:16 +01:00
ve.ui.GroupElement.js Element fixes 2013-06-18 11:35:07 -07:00
ve.ui.IconedElement.js 'Config' -> 'Configuration' in all comments 2013-09-25 11:23:16 +01:00
ve.ui.LabeledElement.js 'Config' -> 'Configuration' in all comments 2013-09-25 11:23:16 +01:00