mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 19:09:29 +00:00
9303648406
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 |
||
---|---|---|
.. | ||
ve.ui.ClippableElement.js | ||
ve.ui.FlaggableElement.js | ||
ve.ui.GroupElement.js | ||
ve.ui.IconedElement.js | ||
ve.ui.LabeledElement.js |