See attached with IE7 and YAML Theme. Firefox works as expected.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Status: Active » Postponed (maintainer needs more info)

Is it possible that $closure is not output directly in the BODY element, or some margin/padding-top is applied to BODY in your theme?

hass’s picture

padding-top: 10px; but no margin.

EDIT: $closure is inside body.

hass’s picture

As a dirty workaround I've added the below code to the admin_menu.css directly after the first line #admin-menu {}, but I think this is not the right way...

* html #admin-menu,
*:first-child+html #admin-menu { margin-top: -20px }
sun’s picture

Category: bug » support

Are you able to replicate this issue in other themes (not YAML based)? Also, does the issue resolve if you remove the padding from BODY?

I have seen admin menu on many different sites and themes in the meantime (not even built by me) and there is even the Administration menu showcase site (see link on project page), which demonstrates approx. 50 themes from drupal.org (none of them built or customized by me). I did not experience this issue with any of those themes.

hass’s picture

Category: support » bug

I Removed the padding-top: 10px, but the problem still persist.

This is for sure a bug. So keep it as a bug and figure out what this is caused by.

hass’s picture

This line causes the issue and the class is added via JS code. If I read this - this must be wrong. I wonder why Firefox doesn't show it wrong.

body.admin-menu { margin-top: 20px !important; }

sun’s picture

Not really. It applies a margin-top to BODY, i.e. it shifts down the page's contents by 20 pixels to make room for the administration menu. This behavior can be disabled via admin menu's settings page.

Please note that if you do not apply any styles to BODY, then most browsers will use a default margin of 10 pixels.

So did you test with another theme? This may be a bug if you can replicate this issue in more than one theme.

hass’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
1.46 KB

This should be the right way. Patch attached.

Works for me with Garland and YAML.

hass’s picture

What you are doing is - you shift the *body* down - not the content inside the body... this is wrong and this is what I can see in IE.

PS: A bug is an unexpected behaviour. There is no need to replicate in other themes. It need to break once only.

sun’s picture

Component: Code » CSS / Browser Support
Status: Needs review » Active

Yes, that's what I meant in #7: The administration menu is absolute positioned at top: 0;, so the body is shifted down to make room for it.

Because of this, your patch does not make much sense. Since an absolute positioned element is always positioned at the defined position, it is irrelevant whether there is an element before or after it in the markup. div#admin-menu is still positioned at top: 0.

That said, IE is known to render proper CSS wrong under certain circumstances. That's why I asked whether there might be some padding/margin applied to the body, or $closure may not be output as a direct child of body, which both have been the cause for other users in the past (see README.txt). Another possible cause could be a defined width, height or overflow: hidden property for the body element, which triggers IE's hasLayout property for the DOM element. IE's hasLayout property, in turn, most often leads to unexpected rendering of page elements.

So, to repeat: The current CSS/JS is working using IE5.5, IE6, and IE7 in all themes I have tested. And you can trust me, I have tested many themes. Countless hours have been spent to assure that this stuff works properly in IE, Firefox 2, Firefox 3, Firefox/Mac, Safari, as well as Opera. If you want to convince me that this is a bug, which not only occurs in your theme (or YAML-based themes), you obviously have to prove it. That said, there is always a chance a bug slipped in somewhere and it is perfectly possible you found one. However, due to the aforementioned, enhanced testing, a bug needs to occur in most themes, not only in 0.1% of all themes - otherwise the fix for those particular themes will break 99.9% of all other themes, which is the gained experience of insufficiently tested CSS changes in administration menu.

Hence, please ensure that you are able to replicate this bug in other themes. If you cannot, then your theme needs to be fixed instead (for the reasons I tried to outline above).

Reverting status to active to prevent people from mistakenly testing this patch.

hass’s picture

See the test site I have send you an email about. If you see a bug in the CSS tell me. I'm pretty sure this is an IE special issue that will occour in other themes, too and this issue plus the ones you described in the readme can circumvented with the patch above.

Have you taken a look what I'm doing there? It's such simple and much saver than the current approach.

hass’s picture

I've pleased the YAML maintainer to take a look as this seems to be an issue with a yaml beta version we are currently testing.

sun’s picture

Title: Menu does not stick on top » IE7: Offset between browser viewport and menu in YAML-beta-based themes
Category: bug » support
Status: Active » Postponed (maintainer needs more info)

It seems you are ignoring my replies. Yes, I looked at the patch, explained in detail why it just won't work, and reverted the issue status to prevent innocent victims from discovering and applying that patch. All of this was in #10.

Changing issue properties according to #12.

hass’s picture

Title: IE7: Offset between browser viewport and menu in YAML-beta-based themes » IE7: Offset between browser viewport and menu in themes with body{position:relative}
Status: Postponed (maintainer needs more info) » Active

The cause of this issue is body { position: relative } that is required for IE7 (example: http://knowhow.davidgrudl.com/css/ie7-zoom-bug/) and not used in the themes you have tested. We cannot fix this and cannot move to static as this makes the layout unstable in IE.

I will send you some more information soon in German via PM.

sun’s picture

Status: Active » Fixed

The fix is simple: Just wrap your contents into another container (i.e. BODY > DIV) and apply position: relative; to this container instead.

hass’s picture

Status: Fixed » Active

No, it's not that easy. This will not work in all yaml layouts in a general manner. Especially not with the full height layouts.

sun’s picture

I see no reason why styles applied on a DIV would suddenly behave differently than on the BODY element. "Full height layouts" need further CSS tricks either way, and it is completely irrelevant whether those tricks are applied to the BODY element or a child container instead.

Look, I have no idea what YAML does and why it needs this CSS styling on the body element. All I know is that admin menu renders fine in all other (i.e. not YAML-based) themes, regardless of the browser. I see no way of fixing this issue in admin menu properly for regular themes as well as YAML-based themes. Additionally, I can already foresee and do not even need to test that admin menu's output/styling is not the only one that breaks in YAML due to those irregular styles applied to the BODY element. Hence, if YAML's styles are guilty, then I would work on fixing YAML instead.

Your second option obviously is to override admin menu's styles in your theme, which is the usual way to customize default styles of modules for your own, custom theme.

hass’s picture

No, you may haven't read the topic. Every site that have this annoying IE7 zoom bug fixed have this issue with admin-menu! This is not specific to YAML - it's only the most popular CSS framework. You can hurt MS for releasing such buggy browsers to us, but not the YAML framework nor any other theme that have body { position: relative } defined. You can google around and you will find many people having this IE7 zooming issues. Some designers care about this for their users and (most) others do not, but YAML care about accessibility and extensive browser support. Zooming is very important for people with eye handicaps. Otherwise you can be ignorant about this IE7 bug and tell all people to keep their website layout buggy or simply implement a solution that is stable in all ways and would also handle sites with margins and paddings. My patch above looks much saver.

We could also start fixing buggy themes in CVS having this IE7 bug and afterwards we come back only to have some more themes for you, but I hope we don't need to go this hard way!? I tried to help you to make this module more stable - if you don't like to receive this help give me a note. Additional if it's more stable you could also remove readme comments about issues with some layouts. Wouldn't this be great?

sun’s picture

Title: IE7: Offset between browser viewport and menu in themes with body{position:relative} » IE7: Offset between browser viewport and menu in themes with body { position: relative }
Category: support » bug
Status: Active » Needs review
FileSize
1.49 KB

Sorry, holidays.

Every site that have this annoying IE7 zoom bug fixed have this issue with admin-menu!

That is plain wrong. I have personally seen, tested, and used admin menu on many sites, even on sites fulfilling the highest accessibility standards. Your "solution" of applying position: relative to the body is a CSS hack and is as error-prone as every other CSS hack. The amount of people who care about this "bug" effectively cuts down to the number of sites that are using this CSS hack.

If at all, the patch for this issue should probably look like the attached one. However, this patch will break the design/layout of sites that use a background image for the body (which is a far more common case than applying position: relative to the body).

Aside from that, a patch like this needs review and confirmations for all browsers and platforms, since it alters an important part of admin menu.

hass’s picture

I have not yet been able to test your patch, but only form my memory - if you add a height to a blank DIV this one collapse to 0 pixel. I have had some fun with this in past and the only workaround to make this working for all browser was using border-bottom or border-top and not height. Additional you have removed the   what may make the page invalid. As I remember the browser will complain about a blank DIV. If I have all this issues in mind I'm back to the patch in #8. Need to test again.

Aside - the sites you tested - have you used the zoom function that may be often used by half blind or 90% blind people?

sun’s picture

DIV elements are allowed to be empty, even in the XHTML Strict DTD. Also, the height should be rendered fine in all browsers and platforms. FWIW, your previous patch applied a border-bottom to the body element, and not to the injected DIV element, so the resulting height of the DIV was only equal to admin menu's height by coincidence, which is why it was wrong.

hass’s picture

Ups... yeah the selector was wrong... :-(

hass’s picture

Status: Needs review » Reviewed & tested by the community

Tested successfully with IE6, IE7, IE8B2, IE8, Safari 4 Beta, Firefox 1.0.8, 2.0.0.12, 3.0.8, Opera 9.26, Google Chrome 1.0.154.48

sun’s picture

Status: Reviewed & tested by the community » Needs review

You cannot mark your own patch as RTBC. That's why the status is called "reviewed & tested by the community".

hass’s picture

Status: Needs review » Reviewed & tested by the community

I marked YOUR patch in #19 as RTBC.

mgifford’s picture

Issue tags: +Accessibility

adding accessibility tag

sun’s picture

Version: 6.x-1.x-dev » 6.x-3.x-dev
Status: Reviewed & tested by the community » Needs work

@mgifford: Does that mean you can replicate this issue? You would be the first one aside from hass.

Needs work since #415196: CSS Coding Standards Patch went in. Patch needs to be against 3.x.

mgifford’s picture

I don't generally use windows at all, so didn't actually replicate the issue, sorry.

I use admin menu a bunch and haven't heard problems with the positioning.

I doing my best to get rid of display:none; though.

Wish I could confirm/deny this, but was speaking more to the followup comments than the reported bug.

hass’s picture

Re-roled #19 patch from sun. No changes.

hass’s picture

Status: Needs work » Reviewed & tested by the community
sun’s picture

Status: Reviewed & tested by the community » Needs review

It seems like none of the 51,860 (minus one) users can replicate this issue. All other issues of this category would have at least one follow-up of at least one other user who experienced the same issue.

That means, this patch was not even considered - nor tested - by anyone, including myself. In turn, this means I cannot blindly commit this patch unless there are some other users confirming.

mgifford’s picture

Issue summary: View changes
Status: Needs review » Closed (cannot reproduce)

Closing issue.

hass’s picture

Status: Closed (cannot reproduce) » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 19: admin_menu.ie-margin-top.patch, failed testing.

mgifford’s picture

Status: Needs work » Postponed (maintainer needs more info)

@hass we need more info.

truls1502’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

It seems it is outdated because Drupal 6 is EOL (End-of-life) and will no longer be supported.

In case if you or anyone is still facing on Drupal 7/8, please to reopen it, change the version and provide with more information and a screenshot which might help us to troubleshoot. :)