Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367405

Summary: CSS Sprites rendering problem with sectional stylesheet on Firefox
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ClientAssignee: Anton McConville <antonm>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: susan, tomasz.zarna
Version: 0.3   
Target Milestone: 0.4 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Page not resized, everything is fine
none
Page resized, looks like we render two images from the sprite now none

Description Szymon Brandys CLA 2011-12-22 05:35:05 EST
I use code like this:
dojo.create( "span", { "class":"gitImageSprite git-sprite-repository" }, horizontalBox ); 
to show images on my flat repo page. It works almost great, but when I resize the page horizontally, the sprite becomes broken. See the attached pictures.
Comment 1 Szymon Brandys CLA 2011-12-22 05:35:50 EST
Created attachment 208727 [details]
Page not resized, everything is fine
Comment 2 Szymon Brandys CLA 2011-12-22 05:37:09 EST
Created attachment 208728 [details]
Page resized, looks like we render two images from the sprite now
Comment 3 Tomasz Zarna CLA 2011-12-22 05:40:49 EST
I'm seeing the same thing on "Commit details page" (bug 360472) after creating a span like this:

var modification = dojo.create("span", null, horizontalBox);
dojo.addClass(modification, "gitImageSprite");
dojo.addClass(modification, "git-sprite-modification");
Comment 4 Susan McCourt CLA 2011-12-22 12:17:40 EST
Weird.  I will take a look at this when I can use the page in a build. 
Maybe this is the first time we've had such a tall containing span and it's exposing a height problem.
Comment 5 Susan McCourt CLA 2012-01-06 12:45:30 EST
It looks like this is a FF problem, it is working on Chrome.  I couldn't tell whether IE has the problem because there is a more general problem with this page on IE9.  (opened bug 368047).  Will investigate...
Comment 6 Susan McCourt CLA 2012-01-06 13:38:09 EST
Hmmm....I'm pretty sure this is a problem because the sprite is an inline-block span and its parent is in the box model.   I'm seeing these warnings in the console (I'm not sure they are directly related but I think it's at least a hint to the problem).

Warning: XUL box for div element contained an inline span child, forcing all its children to be wrapped in a block.

If I look at the span in the debugger, I can see that its width/height are set (16px). Supposedly inline-block is supposed to fix the height of a span, which works elsewhere.  Note that Chrome is working properly.  I'm not sure if this is something we could call an FF bug, or if this combination of styling is simply causing some "unspecified" behavior that FF implements differently.  It's possible that we could produce a sprite class (instead of gitImageSprite) that is box-savvy so that it plays well, but now I'm out of my league.  I'll reassign this to Anton.
Comment 7 Susan McCourt CLA 2012-01-22 16:07:16 EST
fixed with Anton's updated CSS.