[webkit-changes] cvs commit: LayoutTests/fast/dom/resources articles.m4a

Geoffrey ggaren at opensource.apple.com
Wed Jan 4 12:01:52 PST 2006


ggaren      06/01/04 12:01:52

  Modified:    .        ChangeLog
               khtml/html html_objectimpl.cpp
               .        ChangeLog
  Added:       fast/dom object-embed-plugin-scripting-expected.txt
                        object-embed-plugin-scripting.html
               fast/dom/resources articles.m4a
  Log:
  LayoutTests:
  
           Layout test for <rdar://problem/4214080> document.embeds:
           embeds[0].Play() undefined at languageguide.org prevents audio playing
           on mouseover
  
           * fast/dom/object-embed-plugin-scripting-expected.txt: Added.
           * fast/dom/object-embed-plugin-scripting.html: Added.
           * fast/dom/resources/articles.m4a: Added.
  
  WebCore:
  
           Reviewed by darin.
  
           - Fixed <rdar://problem/4214080> document.embeds: embeds[0].Play()
           undefined at languageguide.org prevents audio playing on mouseover
  
           - Layout test: fast/dom/object-embed-plugin-scripting.html
  
           A common idiom the kids like to use these days for plugins is to nest
           an <embed> inside an <object>, and assume that IE will honor the first,
           Mozilla the second. We happen to honor both, but the rules dictate that
           only the outer <object> gets a plugin/renderer. (A plugin is a
          renderer.) This is a problem because sites ID us as Mozilla and
          therefore attempt to script their plugins through the <embed>, which
          has no plugin/renderer. The fix here is to have an <embed> return its
          parent node's plugin/renderer when queried, if and only if it has no
          renderer of its own and its parent node is an <object>. We may decide
          to restrict this further in the future.
  
          One happy consequence of this patch is that all the apple.com Quicktime
          websites we had previously broken with TOT are now fixed.
  
          * khtml/html/html_objectimpl.cpp:
          (DOM::HTMLEmbedElementImpl::getEmbedInstance): The "if (!r)" clause
          implements the logic I just described. The code below it I changed
          just for style, to match the style in getObjectInstance().
  
          (DOM::HTMLEmbedElementImpl::rendererIsNeeded): Assert that an <object>
          parent has a renderer because we're going to use it later.
  
          (DOM::HTMLObjectElementImpl::rendererIsNeeded): Changed to match style
          of HTMLEmbedElementImpl counterpart.
  
  Revision  Changes    Path
  1.86      +34 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- ChangeLog	4 Jan 2006 14:42:22 -0000	1.85
  +++ ChangeLog	4 Jan 2006 20:01:48 -0000	1.86
  @@ -1,3 +1,37 @@
  +2005-12-30  Geoffrey Garen  <ggaren at apple.com>
  + 
  +         Reviewed by darin.
  + 
  +         - Fixed <rdar://problem/4214080> document.embeds: embeds[0].Play() 
  +         undefined at languageguide.org prevents audio playing on mouseover
  + 
  +         - Layout test: fast/dom/object-embed-plugin-scripting.html
  + 
  +         A common idiom the kids like to use these days for plugins is to nest 
  +         an <embed> inside an <object>, and assume that IE will honor the first,
  +         Mozilla the second. We happen to honor both, but the rules dictate that
  +         only the outer <object> gets a plugin/renderer. (A plugin is a 
  +        renderer.) This is a problem because sites ID us as Mozilla and 
  +        therefore attempt to script their plugins through the <embed>, which 
  +        has no plugin/renderer. The fix here is to have an <embed> return its 
  +        parent node's plugin/renderer when queried, if and only if it has no 
  +        renderer of its own and its parent node is an <object>. We may decide
  +        to restrict this further in the future.
  +
  +        One happy consequence of this patch is that all the apple.com Quicktime
  +        websites we had previously broken with TOT are now fixed. 
  +
  +        * khtml/html/html_objectimpl.cpp:
  +        (DOM::HTMLEmbedElementImpl::getEmbedInstance): The "if (!r)" clause 
  +        implements the logic I just described. The code below it I changed 
  +        just for style, to match the style in getObjectInstance().
  +
  +        (DOM::HTMLEmbedElementImpl::rendererIsNeeded): Assert that an <object>
  +        parent has a renderer because we're going to use it later.
  +
  +        (DOM::HTMLObjectElementImpl::rendererIsNeeded): Changed to match style 
  +        of HTMLEmbedElementImpl counterpart.
  +
   2006-01-04  Mitz Pettel  <opendarwin.org at mitzpettel.com>
   
           Reviewed by Darin, landed by ap.
  
  
  
  1.94      +29 -17    WebCore/khtml/html/html_objectimpl.cpp
  
  Index: html_objectimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_objectimpl.cpp,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- html_objectimpl.cpp	23 Dec 2005 18:44:16 -0000	1.93
  +++ html_objectimpl.cpp	4 Jan 2006 20:01:49 -0000	1.94
  @@ -377,16 +377,23 @@
       if (embedInstance)
           return embedInstance;
       
  -    RenderPartObject *r = static_cast<RenderPartObject*>(m_render);
  -    if (r) {
  -        if (r->widget()){
  -            // Call into the part (and over the bridge) to pull the Bindings::Instance
  -            // from the guts of the Java VM.
  -            void *_view = r->widget()->getView();
  -            embedInstance = KWQ(part)->getEmbedInstanceForView((NSView *)_view);
  -            // Applet may specified with <embed> tag.
  -            if (!embedInstance)
  -                embedInstance = KWQ(part)->getAppletInstanceForView((NSView *)_view);
  +    RenderObject *r = m_render;
  +    if (!r) {
  +        NodeImpl *p = parentNode();
  +        if (p && p->hasTagName(objectTag))
  +            r = p->renderer();
  +    }
  +
  +    if (r && r->isWidget()){
  +        if (QWidget *widget = static_cast<RenderWidget *>(r)->widget()) {
  +            if (NSView *view = widget->getView())  {
  +                // Call into the part (and over the bridge) to pull the Bindings::Instance
  +                // from the guts of the Java VM.
  +                embedInstance = KWQ(part)->getEmbedInstanceForView(view);
  +                // Applet may specified with <embed> tag.
  +                if (!embedInstance)
  +                    embedInstance = KWQ(part)->getAppletInstanceForView(view);
  +            }
           }
       }
       return embedInstance;
  @@ -471,9 +478,16 @@
   bool HTMLEmbedElementImpl::rendererIsNeeded(RenderStyle *style)
   {
       KHTMLPart *part = getDocument()->part();
  -    if (!part)
  -	return false;
  -    return part->pluginsEnabled() && !parentNode()->hasTagName(objectTag);
  +    if (!part || !part->pluginsEnabled())
  +        return false;
  +
  +    NodeImpl *p = parentNode();
  +    if (p && p->hasTagName(objectTag)) {
  +        assert(p->renderer());
  +        return false;
  +    }
  +
  +    return true;
   }
   
   RenderObject *HTMLEmbedElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
  @@ -669,11 +683,9 @@
           return HTMLElementImpl::rendererIsNeeded(style);
   
       KHTMLPart* part = getDocument()->part();
  -    if (!part || !part->pluginsEnabled()) {
  +    if (!part || !part->pluginsEnabled())
           return false;
  -    }
  -    // Eventually we will merge with the better version of this check on the tip of tree.
  -    // Until then, just leave it out.
  +    
       return true;
   }
   
  
  
  
  1.220     +10 -0     LayoutTests/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/LayoutTests/ChangeLog,v
  retrieving revision 1.219
  retrieving revision 1.220
  diff -u -r1.219 -r1.220
  --- ChangeLog	4 Jan 2006 08:22:41 -0000	1.219
  +++ ChangeLog	4 Jan 2006 20:01:50 -0000	1.220
  @@ -1,3 +1,13 @@
  +2005-01-04  Geoffrey Garen  <ggaren at apple.com>
  + 
  +         Layout test for <rdar://problem/4214080> document.embeds: 
  +         embeds[0].Play() undefined at languageguide.org prevents audio playing 
  +         on mouseover
  + 
  +         * fast/dom/object-embed-plugin-scripting-expected.txt: Added.
  +         * fast/dom/object-embed-plugin-scripting.html: Added.
  +         * fast/dom/resources/articles.m4a: Added.
  + 
   2006-01-04  Kimmo Kinnunen  <kimmo.kinnunen at nokia.com>
   
           Reviewed by eseidel.
  
  
  
  1.1                  LayoutTests/fast/dom/object-embed-plugin-scripting-expected.txt
  
  Index: object-embed-plugin-scripting-expected.txt
  ===================================================================
  This test checks for a regression against rdar://problem/4214080 document.embeds: embeds[0].Play() undefined at languageguide.org.
  
  Each test below states its expected outcome.
  
  plugin <object> with nested plugin <embed>: should have a plugin and does
  
  plugin <embed> netsted in plugin <object>: should have a plugin and does
  
  plugin <embed> nested in empty <object>: should have a plugin and does
  
  plugin <embed> nested in image <object>: should not have a plugin and does not
  
  plugin <embed> nested in empty <object> nested in plugin <object>: should not have a plugin and does not
  
  standalone plugin <embed>: should have a plugin and does
  
          
  
  
  
  1.1                  LayoutTests/fast/dom/object-embed-plugin-scripting.html
  
  Index: object-embed-plugin-scripting.html
  ===================================================================
  <html>
  <head>
  <script>
  function print(message)
  {
      var paragraph = document.createElement("p");
      paragraph.appendChild(document.createTextNode(message));
      document.getElementById("console").appendChild(paragraph);
  }
  
  function test() 
  { 
      if (window.layoutTestController) {
          layoutTestController.dumpAsText();
      }
  
      print("plugin <object> with nested plugin <embed>: should have a plugin and does " + (document.getElementById('myO').Play ? "" : "not"));
      print("plugin <embed> netsted in plugin <object>: should have a plugin and does " + (document.getElementById('myE').Play ? "" : "not"));
      print("plugin <embed> nested in empty <object>: should have a plugin and does " + (document.getElementById('myE2').Play ? "" : "not"));
      print("plugin <embed> nested in image <object>: should not have a plugin and does " + (document.getElementById('myE3').Play ? "" : "not"));
      print("plugin <embed> nested in empty <object> nested in plugin <object>: should not have a plugin and does " + (document.getElementById('myE4').Play ? "" : "not"));
      print("standalone plugin <embed>: should have a plugin and does " + (document.getElementById('myE5').Play ? "" : "not"));
  }
  </script>
  </head>
  <body onload="test()">
  <p>This test checks for a regression against <i>rdar://problem/4214080 document.embeds: embeds[0].Play() undefined at languageguide.org</i>.</p>
  <p>Each test below states its expected outcome.</p>
  <hr>
  <div id="console"></div>
  
  <OBJECT 
      id="myO"
      classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
      width = 0 height = 0
      >
      <PARAM name="src" value="resources/articles.m4a">
      <PARAM name="autostart" value="false">
      
      <EMBED 
          id="myE"
          src="resources/articles.m4a"
          autostart="false"
          enablejavascript="true"
          width = 0 height = 0
      >
      </EMBED>
  </OBJECT>
  
  <object>
      <embed 
          id="myE2"
          src="resources/articles.m4a"
          autostart="false"
          enablejavascript="true"
          width = 0 height = 0
      >
  </object>
  
  <object 
      data="resources/apple.gif" 
      type="image/gif"
      width = 0 height = 0
  >
      <embed 
          id="myE3"
          src="resources/articles.m4a"
          autostart="false"
          enablejavascript="true"
          width = 0 height = 0
      >
  </object>
  
  <object 
      data="resources/apple.gif" 
      type="image/gif"
      width = 0 height = 0
  >
      <object>
          <embed 
              id="myE4"
              src="resources/articles.m4a"
              autostart="false"
              enablejavascript="true"
              width = 0 height = 0
          >
      </object>
  </object>
  
  <embed 
      id="myE5"
      src="resources/articles.m4a"
      autostart="false"
      enablejavascript="true"
      width = 0 height = 0
  >
  
  </body>
  </html>
  
  
  
  1.1                  LayoutTests/fast/dom/resources/articles.m4a
  
  	<<Binary file>>
  
  



More information about the webkit-changes mailing list