Notes |
|
|
It appears that a Javascript document.write() statement is not being obeyed. |
|
|
(0001182)
|
Michael Drake
|
2016-02-02 11:57
(Last edited: 2016-02-02 11:59) |
|
It's centred in the markup, and then JavaScript adds a STYLE element to the document which left aligns it. I have no idea why anyone would do that.
So it will never be left-aligned with JS off. With JS on, we need support for JS writing STYLE elements into the document.
Test case:
<!DOCTYPE html>
<html>
<body>
<script>
document.write('<style>p#foo { color: green; background: #dfd; }</style>');
</script>
<p id="foo">JS makes me green!
</body>
</html>
Edit: Note: Mantis swallows the P element close tag in the above.
|
|
|
|
It seems that the dom_default_action_DOMSubtreeModified_cb() is not called for STYLE elements added by JavaScript, which is what prevents us from ever adding the new stylesheet data. |
|
|
|
In fact, the STYLE node is never added to the DOM. |
|
|
|
Actually, there's more to it. We do add STYLE nodes to the DOM and that works.
The problem seems to be with some XCOOKIE library that the JS uses. Due to that failing, it never manages to write out the crucial "text-align: left;".
document.write('<style> .storytext { max-height: 999999px; width: '+XCOOKIE.read_width+'%; font-size:' + XCOOKIE.read_font_size + 'em; font-family: "'+XCOOKIE.read_font+'"; line-height: '+XCOOKIE.read_line_height+'; text-align: left;} </style>'); |
|