Cannot use JavaScript + style attribute to change positioning of elements generated by XSLT




16 years ago
16 years ago


(Reporter: dmmccaw, Unassigned)



Windows XP

Firefox Tracking Flags

(Not tracked)



(4 attachments)



16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624

When an XML document is transformed via XSLT, a javascript that runs onload of
transformed document is unable to manipulate the coordinates, dimensions, or
font-size of generated DIV elements, but it is able to change the background
color. Saving the transformed source as HTML and viewing in Mozilla gives
correct behavior.

Reproducible: Always

Steps to Reproduce:
1. Create an XML doc with an XSL stylesheet
2. In the stylesheet, include a script (linked or inline, no matter) to change
coordinates of an element (position:absolute)
3. Preview the page in Mozilla

Actual Results:  
Background color of the DIVs changed, but all of the elements stayed at 0,0 with
* for width and height, and kept the default color and font-size.

Expected Results:  
Should have allowed for dynamic placement and sizing of block level elements

I am using the default theme w/ 1.4RC3, clean install. First time, so bear with
me if I filed this in the wrong component. Working on testcase. What I was
trying to do was take an XML file full of quotes I had created and transform it
to an HTML file for viewing, placing the DIVs in randomly selected coordinates
with random widths and colors, etc. Works if I take the transformed source and
view it.

Comment 1

16 years ago
Created attachment 126509 [details]
[testcase] Simplification of HTML file mentioned in description

Comment 2

16 years ago
Created attachment 126510 [details]
[testcase] simplification of XML file from description

Comment 3

16 years ago
Created attachment 126511 [details]
[testcase] external js file from description

hope I got JS mime-type right...

Comment 4

16 years ago
Created attachment 126512 [details]
[testcase] simplification of transformation used in bug

last one, sorry about all the spam


16 years ago
Keywords: testcase
You need to add +"px" when you set left/top/width/fontSize
This is invalid.  XSLT-generated documents are always in standards mode, and in
standards mode CSS lengths require a unit.
Last Resolved: 16 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.