Height attribute (in percent) not applied in XSL stylesheets.

RESOLVED INVALID

Status

()

Core
XSLT
--
major
RESOLVED INVALID
13 years ago
12 years ago

People

(Reporter: Milan Zdimal, Unassigned)

Tracking

1.8 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

It appears that the height attribute is ignored in an XSL stylesheet when
applied as a percentage. 

If you set the height of a div to be 200px this will work. Setting the height of
a div to be 100% will not work and appears to have a height of 0 (in an empty
div). Interestingly enough, a width of 100% will work.

I have only seen this issue in XSL stylesheets. 

Reproducible: Always

Steps to Reproduce:
//------------------------XML FILE -----------------------------//
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="xsl.xsl" ?>
<Root/>

//------------------------XSL FILE (xsl.xsl)--------------------//
<?xml version='1.0' ?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<html>
 <head></head> 
 <body>
 <div style="width: 100%; height: 100%; border: 1px solid red;"></div>
 </body>
</html>
</xsl:template>
</xsl:stylesheet>
Actual Results:  
A div with a red border will display having a width of 100% but a hieght of 0.

Expected Results:  
The div should be rendered as 100% wide and 100% high.

Comment 1

13 years ago
Possibly related to bug 303539. Also, do you see this in the latest builds of
Firefox? http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/
(Reporter)

Comment 2

13 years ago
(In reply to comment #1)
> Possibly related to bug 303539. Also, do you see this in the latest builds of
> Firefox? http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/

Yes, this issue still occures in the nightly build of Dear Park 1+. I have 
added a link to the exact example on my site which reproduces the issue:
http://www.360cubed.com/mozilla/xml.xml

Comment 3

12 years ago
I see the same result on version 1.5.0.5, WindowsXP SP2.
Assignee: nobody → xslt
Component: General → XSLT
Product: Firefox → Core
QA Contact: general → keith
Version: unspecified → 1.8 Branch

Comment 4

12 years ago
Created attachment 247702 [details]
HTML-page, for comparise with

Comment 5

12 years ago
Created attachment 247704 [details]
XSL for generate a simple HTML-document (like above)

Comment 6

12 years ago
Created attachment 247705 [details]
Empty XML-document to invoke an above transformation

Updated

12 years ago
Attachment #247705 - Attachment description: Empty XML-document to invoke an above transormation → Empty XML-document to invoke an above transformation
I suspect this is due to the fact that quirks mode rendering is not enabled for XSLT results. If you put <!DOCTYPE HTML> at the top of the reference HTML file, does it behave the same?

Comment 8

12 years ago
Created attachment 247707 [details]
Same HTML-page with Strict XHTML DOCTYPE

Look like the result of XSLT.
This works as designed then. Quirks mode there to enable old content to be rendered correctly. However all XSLT content is new enough that there is no reason for authors to follow standards.

Please refer to newsgroups or CSS tutorials for how to get the rendering you want.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.