Closed
Bug 1247704
Opened 8 years ago
Closed 7 years ago
Top bar at Black Duck Software page moves oddly when scrolling
Categories
(Web Compatibility :: Desktop, enhancement, P5)
Web Compatibility
Desktop
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: RyanVM, Unassigned)
References
()
Details
(Keywords: correctness, Whiteboard: gfx-noted [needscontact])
Attachments
(3 files)
Laggy and randomly disappears when scrolling. Kats says it's a known class of issues w/ APZ.
Comment 1•8 years ago
|
||
They're using a scroll listener to change position:relative to position:fixed, when they should be able to get by using position:sticky instead.
Blocks: apz-desktop
Whiteboard: [apz-evangelism]
Comment 2•8 years ago
|
||
Contact page: https://www.blackducksoftware.com/about/contact Kats: I don't understand this bug completely yet. I'm pasting the whole JS emulation of position:sticky below just for reference, it doesn't really explain the effect I see. First the logo is top left, then when you start scrolling down and I expect the logo to start disappearing upwards it will instead show up in the center, next to the word "Rookies" in the header or so, for a split second before the sticky effect kicks in. I'll attach a screenshot. I guess they "should" use position:sticky instead of JS, but .. seriously, why does Firefox all of a sudden decide to paint a logo you're scrolling upwards *below* its original location? If that oddity wasn't happening, the page would work pretty smoothly with APZ, just as it did before. (function ($) { $(document).ready(function () { var $sticky = $('.superhero-sticky'); var css = $('<style>').attr({ type: 'text/css' }); css.append('.superhero-sticky.fixed{top:0; width:100%; z-index:1000; background-color:#fff}'); $('body').append(css); $(window).bind('scroll', sp_sticky); function sp_sticky() { var offsetTop = $(window).scrollTop(); if ($(window).width() <= 980) { $sticky.removeClass('fixed'); } if (offsetTop > $sticky.offset().top && $(window).width() > 980) { $sticky.attr('data-offset-top', $sticky.offset().top); $sticky.css({ position: 'fixed' }); setTimeout(function () { $sticky.addClass('fixed'); var h = $sticky.height() + parseInt($sticky.css('marginTop')) + parseInt($sticky.css('marginBottom')); var nm = parseInt($sticky.next().css('marginTop')); //$sticky.next().css({marginTop:(h+nm)+'px'}); }, 1); $sticky.next().css({ marginTop: $sticky.height() + 'px' }); $(window).unbind('scroll', sp_sticky); $(window).bind('scroll', sp_unsticky); } } function sp_unsticky() { var offsetTop = $(window).scrollTop(); if ($(window).width() <= 980) { $sticky.removeClass('fixed'); var h = $sticky.height() + parseInt($sticky.css('marginTop')) + parseInt($sticky.css('marginBottom')); var nm = parseInt($sticky.next().css('marginTop')); $sticky.next().css({ marginTop: (nm - h) + 'px' }); } if (offsetTop <= $sticky.data('offset-top') && $(window).width() > 980) { $sticky.css({ position: 'relative' }); setTimeout(function () { $sticky.removeClass('fixed'); var h = $sticky.height() + parseInt($sticky.css('marginTop')) + parseInt($sticky.css('marginBottom')); var nm = parseInt($sticky.next().css('marginTop')); //$sticky.next().css({marginTop:(nm-h)+'px'}); }, 1); $sticky.next().css({ marginTop: 0 }); //$sticky.removeClass('fixed'); $(window).unbind('scroll', sp_unsticky); $(window).bind('scroll', sp_sticky); } } }); }) (jQuery);
Flags: needinfo?(bugmail.mozilla)
Comment 3•8 years ago
|
||
Here's a screenshot of the effect I'm wondering if we can avoid..
Comment 4•8 years ago
|
||
Oh interesting, I didn't see that when I first tried the page, but I can definitely see it now. That does seem like a Gecko bug, I'll look into it.
Component: Desktop → Panning and Zooming
Flags: needinfo?(bugmail.mozilla)
Product: Tech Evangelism → Core
Whiteboard: [apz-evangelism]
Comment 5•8 years ago
|
||
Here's a video of the glitch. In QuickTime you can drag the slider frame by frame and you can see there's one frame where the header is out of place. Next steps would be to get the layer dumps and see why the header is wrong for that one frame.
Updated•8 years ago
|
Keywords: correctness
Whiteboard: gfx-noted
Comment 6•8 years ago
|
||
I'm not convinced this is an APZ issue, as I see the same glitch using the down keyboard arrow to scroll. And I think I see it intermittently on Release (44) as well, although it's not as reproducible there.
Comment 7•8 years ago
|
||
I can also reproduce the glich on Google Chrome50.0.2638.0 as well as ESR38 on Windows7. STR 1. Open https://www.blackducksoftware.com/open-source-rookies 2. After loading is finished, mouse hover the orange rectangle (this step is not necessary, but in order to easily reproduce) 3. Turn mouse wheel by one tick AR the orange rectangle jumps moment
Comment 8•8 years ago
|
||
I confirm it also reproduces in Chrome. This code is first setting element.style.position to "fixed", then they set a 1ms timeout (!?) to add the class name "fixed". The class name says where they actually want the element rendered (note the top:0): .superhero-sticky.fixed { top: 0; width: 100%; z-index: 1000; background-color: #fff; } They should probably just add position:fixed to that CSS and simply add the classname immediately.
Updated•8 years ago
|
Severity: normal → enhancement
Priority: -- → P5
Summary: Top bar at Black Duck Software page doesn't play nicely with APZ → Top bar at Black Duck Software page moves oddly when scrolling
Whiteboard: gfx-noted → gfx-noted [needscontact]
Updated•8 years ago
|
No longer blocks: apz-desktop
Component: Panning and Zooming → Desktop
Product: Core → Tech Evangelism
Comment 9•7 years ago
|
||
They've redesigned their header, so let's close this.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Assignee | ||
Updated•5 years ago
|
Product: Tech Evangelism → Web Compatibility
You need to log in
before you can comment on or make changes to this bug.
Description
•