View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0002409 | NetSurf | Layout | public | 2016-01-01 03:35 | 2016-02-02 15:50 | ||||||||
Reporter | Harriet Bazley | ||||||||||||
Assigned To | |||||||||||||
Severity | minor | Reproducibility | always | ||||||||||
Status | acknowledged | Resolution | open | ||||||||||
Platform | Iyonix Aria | OS | RISC OS | OS Version | 5.22 | ||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0002409: All text is displayed centred on fanfiction.net | ||||||||||||
Description | Every chapter on www.fanfiction.net gets displayed with the main body text centred; long paragraphs of centred text are hard to read. The same pages when viewed on the mobile site display as intended, i.e. left-aligned paragraphs. | ||||||||||||
Steps To Reproduce | View any story on the site, e.g. https://www.fanfiction.net/s/9480915/1/White-Light Compare with the mobile version: https://m.fanfiction.net/s/9480915/1/White-Light | ||||||||||||
Additional Information | I've noticed this bug over a long range of NetSurf versions going back a couple of years at least. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Fixed in CI build # | |||||||||||||
Reported in CI build # | 3244 | ||||||||||||
URL of problem page | https://www.fanfiction.net/s/9480915/1/White-Light | ||||||||||||
Attached Files |
|
Notes | |
Dave Higton (developer) 2016-01-04 21:26 |
It appears that a Javascript document.write() statement is not being obeyed. |
Michael Drake (administrator) 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. |
Michael Drake (administrator) 2016-02-02 12:09 |
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. |
Michael Drake (administrator) 2016-02-02 13:14 |
In fact, the STYLE node is never added to the DOM. |
Michael Drake (administrator) 2016-02-02 15:50 |
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>'); |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2016-01-01 03:35 | Harriet Bazley | New Issue | |
2016-01-04 21:26 | Dave Higton | Note Added: 0001136 | |
2016-01-04 21:27 | Dave Higton | Status | new => acknowledged |
2016-02-02 11:57 | Michael Drake | Note Added: 0001182 | |
2016-02-02 11:57 | Michael Drake | Note Edited: 0001182 | View Revisions |
2016-02-02 11:58 | Michael Drake | Note Edited: 0001182 | View Revisions |
2016-02-02 11:59 | Michael Drake | Note Edited: 0001182 | View Revisions |
2016-02-02 12:09 | Michael Drake | Note Added: 0001183 | |
2016-02-02 13:14 | Michael Drake | Note Added: 0001184 | |
2016-02-02 15:50 | Michael Drake | Note Added: 0001185 |