Bug 8872 - WebFX ajax list manipulator broken
Summary: WebFX ajax list manipulator broken
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Evangelism (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://webfx.eae.net/dhtml/collist/de...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-12 08:07 PDT by tim bates
Modified: 2020-10-23 13:31 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tim bates 2006-05-12 08:07:25 PDT
1. go to the url above
2. try and select a line in the table
EXPECT: clicking on a line selects it
OBTAINED: nothing

3. open the page in Firefox: runs as expected.
Comment 1 mitz 2006-05-12 08:29:51 PDT
I don't know if this is the only problem, but when I open the demo page in WebKit I get an error that can be traced back to the fact that the href property of the CSSStyleSheet corresponding to the <style> element is null, whereas in Firefox it is the URL of the HTML file.
Comment 2 mitz 2006-05-12 09:12:11 PDT
(In reply to comment #1)
> the href property of the CSSStyleSheet corresponding to the <style> element is null,
> whereas in Firefox it is the URL of the HTML file.

Changing this (in HTMLStyleElement::childrenChanged) fixes the bug (and breaks none of the tests), however, according to
http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet
"For inline style sheets, the value of [the href] attribute is null", so current behavior is the correct one.
Comment 3 Maxime BRITTO 2007-06-04 06:40:09 PDT
(In reply to comment #0)
> 1. go to the url above
> 2. try and select a line in the table
> EXPECT: clicking on a line selects it
> OBTAINED: nothing
> 
> 3. open the page in Firefox: runs as expected.
> 

The problem seems to come from the second stylesheet (stylesheet[1]) declared at line 7 :
<style type="text/css">
	body { background: threedface; }
</style>

 Then, when it arrives to this line :
      if (document.styleSheets[1].href.indexOf('columnlist.css') == -1) { continue; } 
it can't find any .href.indexOf('columnlist.css') for this style and return an error which stop the script.
Comment 4 Maxime BRITTO 2007-06-04 06:54:37 PDT
(In reply to comment #3)
> (In reply to comment #0)
> > 1. go to the url above
> > 2. try and select a line in the table
> > EXPECT: clicking on a line selects it
> > OBTAINED: nothing
> > 
> > 3. open the page in Firefox: runs as expected.
> > 
> 
> The problem seems to come from the second stylesheet (stylesheet[1]) declared
> at line 7 :
> <style type="text/css">
>         body { background: threedface; }
> </style>
> 
>  Then, when it arrives to this line :
>       if (document.styleSheets[1].href.indexOf('columnlist.css') == -1) {
> continue; } 
> it can't find any .href.indexOf('columnlist.css') for this style and return an
> error which stop the script.
> 

I replaced, in the script the lines 269 and 1190 by :
if (document.styleSheets[n].href != null && document.styleSheets[n].href.indexOf('columnlist.css') == -1) { continue; }

Everything seems to work now.
Comment 5 David Kilzer (:ddkilzer) 2007-06-04 08:54:10 PDT
(In reply to comment #2)
> Changing this (in HTMLStyleElement::childrenChanged) fixes the bug (and breaks
> none of the tests), however, according to
> http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet
> "For inline style sheets, the value of [the href] attribute is null", so
> current behavior is the correct one.

This is an evangelism issue.
Comment 6 David Kilzer (:ddkilzer) 2007-06-04 09:57:40 PDT
It would be interesting to know what MSIE 6/7 returns for 'document.styleSheets[n].href' in this case as well.

Comment 7 David Kilzer (:ddkilzer) 2007-06-04 10:05:44 PDT
Sent a mail message to Emil & Erik regarding this issue:  http://webfx.eae.net/contact.html

Comment 8 Emil A Eklund 2007-06-04 10:56:05 PDT
Thanks for bringing this to my attention.

This clearly seems to be a bug in the WebFX ColumnList code rather in WebKit.

I'll make the necessary changes to the script.
Comment 9 David Kilzer (:ddkilzer) 2007-11-15 14:01:09 PST
(In reply to comment #8)
> Thanks for bringing this to my attention.
> 
> This clearly seems to be a bug in the WebFX ColumnList code rather in WebKit.
> 
> I'll make the necessary changes to the script.

This example still seems to be broken.  I get a JavaScript error when loading the web page with a recent ToT WebKit build with Safari 3 Public Beta on Tiger:

TypeError: Null value
http://webfx.eae.net/dhtml/collist/includes/columnlist.js
Line: 269