MantisBT - NetSurf
View Issue Details
0002383NetSurfJavascriptpublic2015-11-06 20:152019-06-05 21:06
ReporterChris Young 
Assigned Tokinnison 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformAmigaOSAmigaOSOS Version4.1
Product Version3.4 
Target Version4.0Fixed in Version 
Fixed in CI build #
Reported in CI build #3053
URL of problem pagehttp://www.digitalspy.com
Summary0002383: Website displaying without CSS
DescriptionDigital Spy is loading with no stylesheet.
Steps To ReproduceVisit http://www.digitalspy.com
Additional InformationI can't see any mention of css files beyond the default NetSurf ones in the log. I know when they changed their site it went to a heavily Javascripted design, so it wouldn't surprise me if it is trying to do something clever we don't support yet.

A quick glance at the code reveals it's using "Modernizr" to create the stylesheets using Javascript.
TagsNo tags attached.
Attached Fileslog ns.log (265,738) 2015-11-06 20:15
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=355&type=bug

Notes
(0001040)
Vincent Sanders   
2015-11-08 10:08   
the site uses the following script to insert its css with javascript.



var s, el;

s = document.createElement('link');
s.rel = "stylesheet";
s.href = '//digitalspyuk.cdnds.net/digitalspyuk/20151103130454/css/main' + ( Modernizr.mobile ? '-mobile.css' : '.css' );
el = document.getElementById('write-styles');

document.getElementsByTagName("head")[0].insertBefore( s, el );
(0001041)
kinnison   
2015-11-08 13:52   
This is using a numeric indexing into the html collection returned by document.getElementsByTagName("head") which is daft (document.head would be faster)

Sadly until we do ES6 proxy support for collections this won't work.
(0001042)
kinnison   
2015-11-08 17:14   
In addition, the Modernizr stuff looks like CSSOM
(0001935)
kinnison   
2019-06-05 21:06   
Current state of play, we have proxy support so that bit works, but the CSSOM still won't.

Issue History
2015-11-06 20:15Chris YoungNew Issue
2015-11-06 20:15Chris YoungFile Added: ns.log
2015-11-07 13:54Chris YoungCategoryLayout => Javascript
2015-11-07 13:54Chris YoungAdditional Information Updatedbug_revision_view_page.php?rev_id=1685#r1685
2015-11-08 10:08Vincent SandersNote Added: 0001040
2015-11-08 10:08Vincent SandersStatusnew => confirmed
2015-11-08 10:08Vincent SandersAdditional Information Updatedbug_revision_view_page.php?rev_id=1688#r1688
2015-11-08 13:52kinnisonNote Added: 0001041
2015-11-08 14:44kinnisonAssigned To => kinnison
2015-11-08 14:44kinnisonStatusconfirmed => assigned
2015-11-08 14:44kinnisonStatusassigned => confirmed
2015-11-08 17:14kinnisonNote Added: 0001042
2016-02-09 11:05Michael DrakeTarget Version3.4 => 4.0
2019-06-05 21:06kinnisonNote Added: 0001935