Bug 16270 - modifying embed.src or object.data does not work (affects WICD tests)
Summary: modifying embed.src or object.data does not work (affects WICD tests)
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://www.w3.org/2004/CDF/TestSuite/...
Keywords: HasReduction, InRadar
Depends on:
Blocks: 15836
  Show dependency treegraph
 
Reported: 2007-12-03 03:30 PST by Eric Seidel (no email)
Modified: 2022-06-20 22:59 PDT (History)
6 users (show)

See Also:


Attachments
HTML-only single-file test case (312 bytes, text/html)
2007-12-17 14:01 PST, Eric Seidel (no email)
no flags Details
html + svg test case, showing embed and object are broken (650 bytes, text/html)
2008-03-20 11:31 PDT, Eric Seidel (no email)
no flags Details
partial fix to the problem (6.22 KB, patch)
2008-03-20 12:45 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Add more advanced test case (which <embed> still fails) (10.54 KB, patch)
2008-03-20 13:52 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Fix embed.src and object.data updating (11.26 KB, patch)
2008-03-21 01:16 PDT, Eric Seidel (no email)
eric: review-
Details | Formatted Diff | Diff
flash crash after change (36.24 KB, text/plain)
2008-03-21 01:26 PDT, Eric Seidel (no email)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-12-03 03:30:54 PST
WebKit fails WICD <object> update data= attribute test

http://www.w3.org/2004/CDF/TestSuite/WICD_CDR_WP1/test-load-svg.xhtml

We never show the tiger like we should.  Not sure why.  I kinda doubt this is SVG-specific.
Comment 1 Eric Seidel (no email) 2007-12-17 13:38:22 PST
I expect this is the section of code causing trouble:

HTMLObjectElement::parseMappedAtrribute:

    } else if (attr->name() == dataAttr) {
        m_url = parseURL(val);
        if (renderer())
          m_needWidgetUpdate = true;
        if (renderer() && isImageType()) {
          if (!m_imageLoader)
              m_imageLoader.set(new HTMLImageLoader(this));
          m_imageLoader->updateFromElement();
        }
    } else if (attr->name() == classidAttr) {

Comment 2 Eric Seidel (no email) 2007-12-17 14:01:32 PST
Created attachment 17969 [details]
HTML-only single-file test case

Ok, so this is clearly not an SVG bug. :)
Comment 3 Eric Seidel (no email) 2007-12-17 14:02:03 PST
Now the next thing to test is if this is a regression.  It seems really strange that this doesn't work!
Comment 4 Eric Seidel (no email) 2007-12-17 14:08:18 PST
Fails ever since the very first nightly: r11976
Comment 5 timur mehrvarz 2007-12-17 14:18:32 PST
Looks like isImageType() is evaluated as false for referenced SVG childs.
Comment 6 Andrew Wellington 2007-12-17 14:38:35 PST
This is not a regression.

It also fails on Safari 2.0.4 (419.3), Mac OS X 10.4.9 PowerPC.
Comment 7 timur mehrvarz 2007-12-17 14:47:21 PST
> Looks like isImageType() is evaluated as false for referenced SVG childs.

This is because in HTMLObjectElement::isImageType(), document()->frame() is getting evaluated and then frame->loader()->client()->objectContentType(completedURL, m_serviceType) is not == ObjectContentImage.
Comment 8 Eric Seidel (no email) 2007-12-17 15:58:54 PST
Yeah, in the end I was wrong.  This has nothing to do with SVG.  It's still very strange that this has been broken all the way since Safari 2.04 and no one has noticed.  (Assuming that 2.04 still has the old 412 WebKit?)
Comment 9 timur mehrvarz 2007-12-17 17:23:49 PST
I was wrong too.

> Looks like isImageType() is evaluated as false for referenced SVG childs.

Which may be just fine, if new HTMLImageLoader(this) is not the right tool to load referenced SVG children here.

 
Comment 10 Eric Seidel (no email) 2008-03-20 11:31:18 PDT
Created attachment 19899 [details]
html + svg test case, showing embed and object are broken
Comment 11 Eric Seidel (no email) 2008-03-20 11:36:27 PDT
To be clear, this bug has nothing to do with SVG.  It just happens to affect a test suite with SVG content in it.  This bug is a very basic bug in <embed> and <object> which is caused by HTML code alone.
Comment 12 Eric Seidel (no email) 2008-03-20 12:24:46 PDT
Ok, so it turns out that although m_widgetNeedsUpdate is set to true, nothing ever causes updateWidget(). Resizing the window after the page load seems to make updateWidget() get called.
Comment 13 Eric Seidel (no email) 2008-03-20 12:45:41 PDT
Created attachment 19903 [details]
partial fix to the problem

 LayoutTests/ChangeLog                              |   11 +++++++
 .../dynamic-frame-load-after-layout-expected.txt   |   29 ++++++++++++++++++++
 .../frames/dynamic-frame-load-after-layout.html    |   28 +++++++++++++++++++
 WebCore/ChangeLog                                  |   15 ++++++++++
 WebCore/html/HTMLEmbedElement.cpp                  |    8 ++++-
 WebCore/html/HTMLObjectElement.cpp                 |    6 +++-
 6 files changed, 93 insertions(+), 4 deletions(-)
Comment 14 Eric Seidel (no email) 2008-03-20 12:46:33 PDT
(In reply to comment #13)
> Created an attachment (id=19903) [edit]
> partial fix to the problem

I'm not sure this is the right fix, since it does not fix the WICD test case.  There again, m_needWidgetUpdate is being set, but no one is ever calling updateWidget() on the <object> element.
Comment 15 Eric Seidel (no email) 2008-03-20 13:52:01 PDT
Created attachment 19908 [details]
Add more advanced test case (which <embed> still fails)

 LayoutTests/ChangeLog                              |   13 +++++
 .../dynamic-frame-load-after-layout-expected.txt   |   29 ++++++++++++
 .../frames/dynamic-frame-load-after-layout.html    |   27 +++++++++++
 .../dynamic-frame-replace-after-load-expected.txt  |   35 ++++++++++++++
 .../frames/dynamic-frame-replace-after-load.html   |   49 ++++++++++++++++++++
 WebCore/ChangeLog                                  |   17 +++++++
 WebCore/html/HTMLEmbedElement.cpp                  |    8 ++-
 WebCore/html/HTMLObjectElement.cpp                 |    6 ++-
 8 files changed, 180 insertions(+), 4 deletions(-)
Comment 16 Eric Seidel (no email) 2008-03-21 01:16:11 PDT
Created attachment 19921 [details]
Fix embed.src and object.data updating

 LayoutTests/ChangeLog                              |   13 +++++
 .../dynamic-frame-load-after-layout-expected.txt   |   29 ++++++++++++
 .../frames/dynamic-frame-load-after-layout.html    |   27 +++++++++++
 .../dynamic-frame-replace-after-load-expected.txt  |   34 ++++++++++++++
 .../frames/dynamic-frame-replace-after-load.html   |   48 ++++++++++++++++++++
 WebCore/ChangeLog                                  |   17 +++++++
 WebCore/html/HTMLEmbedElement.cpp                  |   17 ++++++-
 WebCore/html/HTMLEmbedElement.h                    |    1 +
 WebCore/html/HTMLObjectElement.cpp                 |    6 ++-
 9 files changed, 188 insertions(+), 4 deletions(-)
Comment 17 Eric Seidel (no email) 2008-03-21 01:25:18 PDT
I think my awesome change might be causing a crash.  Attaching.
Comment 18 Eric Seidel (no email) 2008-03-21 01:26:08 PDT
Created attachment 19922 [details]
flash crash after change
Comment 19 Eric Seidel (no email) 2008-03-21 01:31:41 PDT
Comment on attachment 19921 [details]
Fix embed.src and object.data updating

Sad.  See the attached crash log.  I think the loader is already deleted when addPlugInStreamLoader is called in that crash.
Comment 20 Ahmad Saleem 2022-06-14 16:06:45 PDT
Using Safari 15.5 on macOS 12.4, I am getting expected results from both test cases (single-file and html+svg test case..).

In first (single-file), I am getting "PASS" across all browsers (Safari 15.5, Chrome Canary 105 and Firefox Nightly 103). In second, I am getting two "Green" square in all browsers.

I checked "computed" size via Inspect Element in Safari and both green squares are 100*100 in size.

Since I believe the expected behaviors are aligned with these test case across browsers, this bug can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!
Comment 21 Radar WebKit Bug Importer 2022-06-20 11:08:35 PDT
<rdar://problem/95545943>
Comment 22 Ryosuke Niwa 2022-06-20 22:59:48 PDT
Nice, thanks for testing!