Bug 5432 - REGRESSION: Can't change movies on Aperture quick tours page
Summary: REGRESSION: Can't change movies on Aperture quick tours page
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Timothy Hatcher
URL: http://www.apple.com/aperture/quickto...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-19 22:03 PDT by David Smith
Modified: 2005-12-30 14:16 PST (History)
3 users (show)

See Also:


Attachments
testcase (1.80 KB, text/html)
2005-10-20 00:27 PDT, mitz
no flags Details
approximate IE's behavior (6.29 KB, patch)
2005-10-20 03:24 PDT, mitz
no flags Details | Formatted Diff | Diff
extended testcase (2.75 KB, text/html)
2005-10-20 03:25 PDT, mitz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2005-10-19 22:03:46 PDT
Clicking on the quick tour movies on the linked page should select a new movie, but it opens a new page 
with the first one instead. Happens in the nightly build from yesterday, but not in the 10.4.2 version of 
Safari.
Comment 1 mitz 2005-10-20 00:10:59 PDT
This is happening because the behavior of document named elements in WebKit was changed to match IE, 
but in this case it doesn't: IE considers an object element with and id as a named element (roughly) only if 
the object's only children are param elements, while WebKit does not make this check.

(I'm tempted to raise the bug priority since it affects a high-profile website).
Comment 2 mitz 2005-10-20 00:27:01 PDT
Created attachment 4418 [details]
testcase
Comment 3 mitz 2005-10-20 00:28:22 PDT
Comment on attachment 4418 [details]
testcase

IE6 prints "undefined" on the 3rd and 6th lines (param and text).
Comment 4 mitz 2005-10-20 00:29:31 PDT
P1 anyway since it's a regression.
Comment 5 mitz 2005-10-20 03:24:04 PDT
Created attachment 4419 [details]
approximate IE's behavior

One difference that I'm aware of is that IE doesn't allow HTML comments inside
the object and this patch allows them (since they're not in the DOM tree).
Comment 6 mitz 2005-10-20 03:25:20 PDT
Created attachment 4420 [details]
extended testcase
Comment 7 mitz 2005-10-20 03:38:52 PDT
Comment on attachment 4419 [details]
approximate IE's behavior

Unfortunately, this patch does not fix the problem with the Aperture page
(which is also broken in IE; I guess it was written to work with WebKit 412).
Comment 8 Darin Adler 2005-10-20 16:58:37 PDT
Comment on attachment 4419 [details]
approximate IE's behavior

Great to have a patch and a test case, but if this patch won't fix the Aperture
site then we probably need a separate bug report about the site being broken.
We can maybe get the site changed to be compatible with both versions of
WebKit.
Comment 9 mitz 2005-10-21 02:26:14 PDT
Created bug 5449.
Comment 10 Geoffrey Garen 2005-10-23 12:16:06 PDT
This bug may be related to <rdar://problem/4214080> document.embeds: embeds[0].Play() undefined at 
languageguide.org prevents audio playing on mouseover.
Comment 11 Darin Adler 2005-10-23 15:30:17 PDT
Given what we now know about this, it might be necessary to get the Aperture team to revise their site. We 
should propose something to them that will work on WinIE, the newer Safari, and also the older Safari.
Comment 12 Maciej Stachowiak 2005-10-26 01:16:42 PDT
getElementById will work in every other browser as a way to get a specific element and we should 
recommend that to the Aperture team.
Comment 13 mitz 2005-10-30 22:19:56 PST
Now that bug 5449 is fixed, this Apple page: http://www.apple.com/imac/tour/ is also broken in TOT.
Comment 14 mitz 2005-10-30 22:28:44 PST
This one too: http://www.apple.com/ipod/features.html
Comment 15 Justin Maxwell 2005-11-15 16:33:26 PST
Just created a Bugzilla account and started tracking this.  Thanks for the great
reports so far.  You are correct we had planned this for 412, where referencing
the QT by name was the only way compatible with Safari at the time.  Comment 12
is correct that now, getElementById will work with browser, but this is not the
case for older builds of Safari.  Please assign this to me.
Comment 16 Justin Maxwell 2005-11-17 12:46:22 PST
i've found that referencing the quicktime movie object by id is now working as
expected in safari, but only referencing the movie by document['name'] is
working in firefox.  firefox assigns the object HTMLObjectEmbed to the id when
using getElementById, but views it as the parent container of the embedded
"embed" object and therefore won't permit the .Play() method.  I'm still hacking
away at this, but if anyone has any ideas please share them.  
Comment 17 mitz 2005-11-17 13:13:34 PST
(In reply to comment #16)

How about giving IDs (obviously distinct) to both elements (object and embed) and then choosing the one 
that implements Play. Something along the lines of:

Aperture.QTMovie.obj = document.getElementById('pmObj').Play ? document.getElementById('pmObj') : 
document.getElementById('pmEmbed');
Comment 18 Justin Maxwell 2005-11-18 13:25:08 PST
Turns out you can't detect the availability of methods in the activex quicktime
component (i.e., if(obj.GetPluginStatus)) as you can in other implementations of
quicktime, but you can still call those methods (i.e., obj.GetPluginStatus()). 
So, now that we know that, we've fixed the object assignment, and only had to
incorporate a few things to get it working properly:

1. Keep looping until the pluginstatus changes to "playable" or "complete"
before attempting to play the movie

2. Wait 1000ms before actually playing the movie.  I don't really know why this
is necessary -- maybe Eric Carlson can chime in -- but it's the only way we can
get it to work as needed.

http://www.apple.com/aperture/quicktours/
Comment 19 mitz 2005-12-03 13:03:06 PST
s there a radar tracking the problem with the other two pages mentioned above (imac/tour/ and ipod/
features.html)? If so, I think this WebKit bug can be changed to RESOLVED.

I think a similar solution can apply to the above two pages (which are very similar to one another).
Comment 20 Geoffrey Garen 2005-12-30 12:11:35 PST
I contacted Justin, and there are Radars tracking the other two pages. Tim, you can close this bug if you 
like.