Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
This happens only with firefox 2.0 and with the banner in a block at the top. With IE6 looks fine.
This is a plain 5 beta 2 install.
May be some declaration doesn´t take place at this point.
Take a look http://www.themessage.com.ar
Gustavo
Comment | File | Size | Author |
---|---|---|---|
#38 | garland_script_display-102252-d6.patch | 630 bytes | cburschka |
#30 | garland_script_display_0.patch | 573 bytes | cburschka |
#26 | garland_script_display.patch | 578 bytes | cburschka |
#16 | garland_style_0.patch | 506 bytes | Darren Oh |
Comments
Comment #1
Darren OhFixed in CVS commit 47804.
Comment #2
adminfor@inforo.com.ar CreditAttribution: adminfor@inforo.com.ar commentedHi Darren, first of all, thanks for your attention.
Patch applied but still not working properly.
The "original" Google also has the // as before your patch, and, I put the Google code manually (with and without // ) as a PHP code, and also doesn´t work properly.
If I put either, module or manual code in bottom, works fine.
Now, the patch is installed, you can check it in the web. Did u test it and worked fine? May be I´ve another thing that makes conflict.
I´ve looking for something trivial thing for two hours, comparing it with another implementations that works well, but, I didn´t find anything so far.
Comment #3
adminfor@inforo.com.ar CreditAttribution: adminfor@inforo.com.ar commentedComment #4
Darren OhThis turns out to be caused by the Garland theme. Removing line 285 ("display: inline;") from style.css will fix it, but I don't know what the side effects would be.
Comment #5
Darren OhComment #6
adminfor@inforo.com.ar CreditAttribution: adminfor@inforo.com.ar commentedNow, the adsense block is a manual PHP one, same as google provide.
I commented line 285 (display: inline) in themes/garland/style.css but didn't fix the problem. Not side effects as per I could see up to now. If it worked for you, Darren, and not for me, may be I have another thing making trouble.
Also, I changed line 43 in modules/system/default.css, "display:inline-block" per "display: inline", because, this line was reported as a warning per Firefox console error.
(Is inline-block a valid css keyword?) Didn´t fix the problem.
Cache off, cache's files cleared manually. The problem is still there.
As per your information, enabled modules are:
Color5.0-beta2
Comment5.0-beta2
Contact5.0-beta2
Drupal5.0-beta2
Help5.0-beta2
Locale5.0-beta2
Profile5.0-beta2
Search5.0-beta2
Statistics5.0-beta2
Taxonomy5.0-beta2
Tracker5.0-beta2
Views5.x-1.2-beta1
Views RSS5.x-1.2-beta1
Views Theme Wizard5.x-1.2-beta1
Views UI5.x-1.2-beta1
AdSense5.x-1.x-dev
Panels1.1
Any ideas?
Should anyone need something, please, let me know
Gustavo
Comment #7
Darren OhMake sure you're commenting CSS correctly: replace "display: inline;" with "/*dispaly: inline;*/".
Comment #8
adminfor@inforo.com.ar CreditAttribution: adminfor@inforo.com.ar commentedthanks, right commented http://themessage.com.ar/themes/garland/style.css
Comment #9
adminfor@inforo.com.ar CreditAttribution: adminfor@inforo.com.ar commentedStill not working.
Im going to remove this banner from the top right now. If somebody wants to see it, or wanna ask me to make some test in the subject, please email me or post here.
Thanks
Gustavo
Comment #10
adminfor@inforo.com.ar CreditAttribution: adminfor@inforo.com.ar commentedComment #11
Wim LeersI can confirm this issue and have been unable to find a solution myself. I'm also using Garland, but on Drupal 5 RC1 instead of beta 2.
Comment #12
cburschkaI had the problem as well, using Drupal 5.x dev, downloaded on 2007-01-01.
I have successfully removed the visible Javascript code (site is http://arancaytar.ermarian.net, the code was directly above the ad) by commenting out the entire wildcard property below. I guess it's the display:inline that does it, but I have seen no other adverse effects on my site, so this works for now.
themes/garland/style.css, line 284:
283 /*
284 #header-region * {
285 display: inline;
286 line-height: 1.5em;
287 margin-top: 0;
288 margin-bottom: 0;
289 }
290 */
Be sure to clear the cache to update the stylesheet.
As for actually fixing it, I recommend that the designers review whether the wildcard (*) is really appropriate here. It affects script elements as well, which doesn't strike me as intended, so I suggest it be replaced with an explicit list of elements that *do* need this property.
Comment #13
Wim LeersIsn't there a more elegant solution possible? I find it very hard to believe that this won't break anything, maybe it just doesn't break anything for the setup you're using...
Comment #14
Darren OhComment #15
Darren OhMarked issue 126274 as a duplicate of this issue.
Comment #16
Darren OhMarked issue 130586 as duplicate of this issue.
For some reason I thought the core maintainers would investigate this before releasing Drupal 5. Since that hasn't happened, here is a patch to review.
Comment #17
kbahey CreditAttribution: kbahey commentedA screen shot can be seen here for those interested. http://drupal.org/files/issues/Snapshot.jpg
Comment #18
Steven CreditAttribution: Steven commentedThe rule needs to be replaced with one that does the same thing, but does not affect script tags. Just removing it is not right.
Comment #19
Darren OhWhat does the rule do, besides mysteriously causing script source to be displayed in the header region? According to the CSS specification, "inline" is the default value of the display property.
Comment #20
Darren OhSo far there have been no reports of side effects from this patch. None of the other core themes contain the "display: inline" property. I've been searching for documentation related to this problem. This article may be related: Properly Using CSS and JavaScript in XHTML Documents. I'm setting this back to "code needs review" because a serious review is needed to determine if the patch needs work.
Comment #21
Steven CreditAttribution: Steven commentedUm, it obviously makes all block-level elements display as inline. This is necessary for each block to be as thin vertically as possible.
Comment #22
Darren OhA serious review should address the following points:
Comment #23
Steven CreditAttribution: Steven commentedDo we really need to spell everything out? This is CSS 101.
Because tags like div, blockquote, paragraph, headers, list item, etc default to 'display: block' instead of 'inline' in all browsers. See "Vertical formatting" in CSS 1 and the suggested default stylesheet for HTML4.
Because Garland is the only theme that has any styles for the header region.
Because browsers suck.
Comment #24
TAlien21 CreditAttribution: TAlien21 commentedI found a solution that doesn't touch the drupal core code.
Create a .js file with the script information and call the script from within the block.
Block code should look like this:
content of my adsense.js looks like this:
Here's what it looks like:
http://www.yogavicki.com
Rock on, Drupal peeps.
Comment #25
Darren OhI can't think of how to apply the solution to a script that must be dynamically generated by a module. By the way, I finally saw what the inline value does: it makes blocks that were designed to have multiple lines display on one line. Apparently this is a higher priority than being able to run scripts in the header region.
Comment #26
cburschkaOkay, in the meantime I've learned some more about CSS and also about how to make patches.
Here are the possible values for display:
- block: is displayed inside a rectangular region, with a margin. (and usually starts on a new line, unless float and clear are changed)
- inline: is displayed as flowing text without linebreaks or margins.
- none: is not displayed at all.
Yes, each element has a default display value, and yes, blocks can be made to use less space by making them inline, but there are also elements that are by default invisible (like script tags).
By setting *, the declaration is affecting all elements, including those that would normally be invisible. In my personal and unimportant opinion, this wildcard is not so much elegance as carelessness, as the block elements (div and what else?) that should be changed could just be listed.
But since
is the only element that is broken by the declaration, specifically setting this one back to display:none immediately after this should be enough. It's also guaranteed not to break anything else. That's what this patch does.Comment #27
cburschkaNote: The above patch also works on HEAD as of now.
Comment #28
Darren OhBeautiful solution! Thanks for figuring this out. This has been a good CSS course for me.
Comment #29
Steven CreditAttribution: Steven commentedExcept it's not RTBC, since it doesn't conform to code style and is documented badly.
Comment #30
cburschkaFor code style, the objections appear to be a lacking line of whitespace separating the block from the preceding one, a lacking space between the colon and the value, and the fact that the comment was placed on the line of the declaration rather than above the block. Fixed.
Comment has been reworded to a full sentence. However, "badly documented" implies that there is something wrong with the content rather than the phrasing of the comment; if the comment in this patch still runs afoul of standards, please suggest a different one.
Comment #31
Darren OhThank you for trying to guess what "coding style" and "badly documented" meant. Since the objections to the patch were not specific, I'm setting this back to "ready to be committed". It's outrageous that Garland has been allowed to be broken for almost the whole time Drupal 5 has been released.
Comment #32
Darren OhI just noticed that Steven is the one who committed this buggy CSS in the first place. I would have thought he would want to do more than criticize other people's efforts to fix it.
Comment #33
drummCommitted to 5.x.
Looks like it needs to go in for 6.x too.
Comment #34
Dries CreditAttribution: Dries commentedI've read the comments but I'm not sure I understand the exact cause. Is this due to a browser bug or due to a bug in Drupal?
I've never seen anything like:
so I'm a bit puzzled. The PHPdoc does not really help me understand why this is necessary. I'd appreciate a small explanation as I've lost my overview on this one.
Comment #35
drummIt overrides
Comment #36
cburschkaI'm not sure whether to classify it as a "bug" in the browser. It might be, if a browser interpreting a directive in an unexpected way (different from other browsers) is a bug - but if you submit this to Bugzilla, it will probably end up marked "by design" or equivalent.
Unlike other browsers, Mozilla and Firefox allow CSS to dictate the layout far more than HTML (there is in fact one Bugzilla comment claiming that "Mozilla is not an HTML user agent, it is a CSS user agent that happens to have knowledge of some HTML semantics.") Which in this case means that it hides the content of
<script>
elements by default, but it does so through CSS (instead of hard-coding it), it can be changed by a CSS directive like "display: inline". The "*" wildcard then refers to all child elements, including script elements, and the result is this.In effect, this is just Firefox taking the CSS directive too literally and applying it too broadly, without doing a "sanity check" on whether a designer would ever actually want this. To get rid of the problem, the stylesheet must tell Firefox to specifically hide the script element again.
(Unfortunately, I can't phrase this in the few sentences that would need to go into the PHPDoc comment.)
Comment #37
Gábor HojtsyMaybe a somewhat extended comment could be distilled from the longer description :) Like 'Prevent Mozilla browsers to display the contents of the style element'.
Comment #38
cburschkaAttaching a patch for head that has this comment:
/* Prevent the previous directive from showing the content of script elements in Mozilla browsers. */
Since it was already committed in 5.x and is a non-essential change, I think it will be enough to change the comment in head without modifying 5.x again, but that's just my 2c. All patches in this part of the file work in both branches, so if necessary the last 5.x patch can be rolled back and replaced by this one (a lot of trouble for a one-line comment, but hey).
May I RTBC this again? It was before, and it's been approved by everyone save the core committers already...
Comment #39
Gábor HojtsyWell, these obscure CSS details need careful documentation or otherwise they could be removed maybe even in this release cycle by some cleanup effort or something, marked as being superfluous.
Committed to 6.x-dev.
Comment #40
(not verified) CreditAttribution: commented