RESOLVED CONFIGURATION CHANGED 16270
modifying embed.src or object.data does not work (affects WICD tests)
https://bugs.webkit.org/show_bug.cgi?id=16270
Summary modifying embed.src or object.data does not work (affects WICD tests)
Eric Seidel (no email)
Reported 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.
Attachments
HTML-only single-file test case (312 bytes, text/html)
2007-12-17 14:01 PST, Eric Seidel (no email)
no flags
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
partial fix to the problem (6.22 KB, patch)
2008-03-20 12:45 PDT, Eric Seidel (no email)
no flags
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
Fix embed.src and object.data updating (11.26 KB, patch)
2008-03-21 01:16 PDT, Eric Seidel (no email)
eric: review-
flash crash after change (36.24 KB, text/plain)
2008-03-21 01:26 PDT, Eric Seidel (no email)
no flags
Eric Seidel (no email)
Comment 1 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) {
Eric Seidel (no email)
Comment 2 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. :)
Eric Seidel (no email)
Comment 3 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!
Eric Seidel (no email)
Comment 4 2007-12-17 14:08:18 PST
Fails ever since the very first nightly: r11976
timur mehrvarz
Comment 5 2007-12-17 14:18:32 PST
Looks like isImageType() is evaluated as false for referenced SVG childs.
Andrew Wellington
Comment 6 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.
timur mehrvarz
Comment 7 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.
Eric Seidel (no email)
Comment 8 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?)
timur mehrvarz
Comment 9 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.
Eric Seidel (no email)
Comment 10 2008-03-20 11:31:18 PDT
Created attachment 19899 [details] html + svg test case, showing embed and object are broken
Eric Seidel (no email)
Comment 11 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.
Eric Seidel (no email)
Comment 12 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.
Eric Seidel (no email)
Comment 13 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(-)
Eric Seidel (no email)
Comment 14 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.
Eric Seidel (no email)
Comment 15 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(-)
Eric Seidel (no email)
Comment 16 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(-)
Eric Seidel (no email)
Comment 17 2008-03-21 01:25:18 PDT
I think my awesome change might be causing a crash. Attaching.
Eric Seidel (no email)
Comment 18 2008-03-21 01:26:08 PDT
Created attachment 19922 [details] flash crash after change
Eric Seidel (no email)
Comment 19 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.
Ahmad Saleem
Comment 20 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!
Radar WebKit Bug Importer
Comment 21 2022-06-20 11:08:35 PDT
Ryosuke Niwa
Comment 22 2022-06-20 22:59:48 PDT
Nice, thanks for testing!
Note You need to log in before you can comment on or make changes to this bug.