Bug 4888 - Missing support for many window.frameElement properties (Frame size calculation at SoftwarePlanner broken)
Summary: Missing support for many window.frameElement properties (Frame size calculati...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
URL: http://www.pragmaticsw.com/SoftwarePl...
Keywords: HasReduction
Depends on: 6402
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-08 11:38 PDT by Alexey Proskuryakov
Modified: 2007-12-29 11:09 PST (History)
1 user (show)

See Also:


Attachments
Test case (261 bytes, text/html)
2005-09-09 14:52 PDT, Patrick Geiller
no flags Details
Incomplete Test (258 bytes, text/html)
2005-09-10 11:23 PDT, Alexey Proskuryakov
no flags Details
frameElement tests (2.33 KB, application/octet-stream)
2005-09-24 12:51 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2005-09-08 11:38:05 PDT
A project management suite called Software Planner is not correctly rendered by current versions of 
Safari. It used to work correctly with WebKit up to 312, but doesn't work (in different ways) with 412.2 
or ToT. Steps to reproduce:

1. Go to <http://www.pragmaticsw.com/SoftwarePlanner.asp>
2. Click on "Try Sample Database"
3. Click "Logon"

Results: 
- (stock 1.3 and earlier): works correctly
- (stock 2.0, 2.0.1 or 1.3.1): the contents briefly renders correctly, then the left frame expands, 
completely covering the right one
- (ToT): the contents briefly renders correctly, then the left frame expands, taking half 
of the page.

Firefox works with this site OK.
Comment 1 Patrick Geiller 2005-09-09 14:52:12 PDT
Created attachment 3831 [details]
Test case

Wait 2 seconds to see the right pane disappear. 

Software Planner miscomputes frameset.cols, replacing a correct '230, *' with
'NaN,  *'. Firefox ignores it, so should Safari.
Comment 2 Alexey Proskuryakov 2005-09-10 00:58:27 PDT
(In reply to comment #1)

Thank you!

There's still a slight weirdness - Safari 1.2.4 fails on this test case, but not on the actual SoftwarePlanner 
page. Could there be a second problem, which makes frameset.cols get miscomputed on newer versions 
of WebKit? I'll leave the NeedsReduction keyword there for now...
Comment 3 Patrick Geiller 2005-09-10 01:34:01 PDT
I don't have Safari 1.2.4 so I can't test. But you can :) Save the page with firefox, then open psDALeft.htm 
and comment out line 486

window.frameElement.parentElement.cols = (window.frameElement.width + 10) + ', *';

This removes the bug. Both Safari & Firefox show window.frameElement.width as undefined. Maybe Safari 
1.2.4 has a correct value ?
Comment 4 Alexey Proskuryakov 2005-09-10 04:43:42 PDT
(In reply to comment #3)
Safari 1.2.4 simply did't get to execute this code at all (I have replaced it with a plain alert("test"), and got 
nothing). I don't understand why, but it seems totally unrelated.

Another mistery: on ToT, the test case works OK (I have checked, window.frameElement.width is still 
undefined) - but the actual page resizes the frame to 50%...
Comment 5 Patrick Geiller 2005-09-10 07:38:38 PDT
> Safari 1.2.4 simply did't get to execute this code at all

Maybe some Javascript fails before it. Does the JS console show anything ? 

> Another mistery: on ToT, the test case works OK (I have checked, window.frameElement.width is still 
> undefined) - but the actual page resizes the frame to 50%...

I just tried the test case in ToT and at first glance it does work. However, the JS in the test case is NOT 
executed. Add an alert() and nothing pops up ! So, copy

javascript:alert(document.getElementsByTagName('FRAMESET')[0].cols = 'NaN, *')

in the address bar and launch it to see the frames resized like in the actual page.
Comment 6 Alexey Proskuryakov 2005-09-10 11:23:03 PDT
Created attachment 3845 [details]
Incomplete Test
Comment 7 Alexey Proskuryakov 2005-09-10 11:23:47 PDT
(In reply to comment #5)

I see... To work in ToT, the test needs to be modified a bit.

However, it looks like Firefox also doesn't ignore NaN! After 2 seconds, the right frame expands to 100%. 
There must be something else in the actual page that makes it work in Firefox...
Comment 8 Alexey Proskuryakov 2005-09-12 02:48:54 PDT
There are probably at least two issues here: window.frameElement.width is not undefined in WinIE - it's 
230, so the +10 part does work as intended.
Comment 9 Alexey Proskuryakov 2005-09-24 12:51:53 PDT
Created attachment 4032 [details]
frameElement tests
Comment 10 Alexey Proskuryakov 2005-09-24 12:57:26 PDT
Ok, so Firefox renders the page fine because it doesn't handle 
window.frameElement.parentElement.cols at all: 

try {
    window.frameElement.parentElement.cols;
} catch (e) {
    alert('Exception: ' + e.description);
}

prints 'Exception: undefined'. This leaves us with a single WebKit issue - lack of support for 
window.frameElement.width (and some other frame properties supported by WinIE, see the attached 
test case for details).
Comment 11 Alexey Proskuryakov 2007-12-29 11:09:11 PST
frameElement.width was implemented in bug 6402, so the actual problem is fixed. It doesn't look like keeping this bug is doing us any good, closing.