contentWindow attribute is not available for SVG objects
Reported by
sworddragon2@gmail.com,
Apr 8 2016
|
||||||||
Issue description
UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Steps to reproduce the problem:
1. Embed a SVG with an object tag.
2. Try to access the contentWindow attribute of this element (like document.getElementById('svg_object').contentWindow).
What is the expected behavior?
The window object of the SVG should be available.
What went wrong?
The window object of the SVG is undefined.
Did this work before? N/A
Chrome version: 49.0.2623.110 Channel: stable
OS Version: 4.4.6
Flash Version: 21.0.0.197
For example Firefox does know this attribute on SVG's. The absence of this attribute makes it not possible to reliably establish safe cross-domain communication with postMessage.
,
Apr 8 2016
Not an SVG issue - that's might just be one of the cases where this property would be useful. To quote HTMLObjectElement.idl: // TODO(philipj): readonly attribute WindowProxy? contentWindow; Spec: https://html.spec.whatwg.org/multipage/embedded-content.html#dom-object-contentwindow I notice that the corresponding property for HTMLIFrameElement is hooked up.
,
Apr 10 2016
Is it enough just to uncomment that line? AFAIK the glue code should be generated automatically. If that's all we need to do, I'll be happy to take on this issue.
,
Apr 11 2016
,
Apr 12 2016
I've attempted the fix described in comment 3. While postMessage() seems to work, I couldn't access any JavaScript user-defined variables directly. See the attached test.html and test.svg files -- * On Chromium 49, it says "missing contentWindow" * On Firefox, it says "has contentWindow and attributes accessible" * On Chromium with this patch, it says "has contentWindow but attributes not accessible" I'm not sure what the correct behavior is here, so I'll leave the issue for now.
,
Apr 17 2016
If you were loading them through file://, then I think that's the expected behavior. (Try http(s).)
,
Apr 18 2016
Ah, it works now. I'd tried loading the file through HTTP before, but I must have messed up the testing back then. CL submitted: https://codereview.chromium.org/1889993004
,
May 11 2016
@sworddragon2 -- Could you please verify on Latest Stable# 50.0.2661.94 and respond to the Comments# 5,6 & 7 and please provide the update which would help us triage the issue further. Note: Removing Needs-Bisect label as of now. Thanks in Advance.
,
May 12 2016
I'm not sure what you expect me to verify (as the linked CL failed for now) and what I shall respond to for the comments 5-7 as they look already handled. Or do I miss something specific?
,
Jun 10 2016
,
Jun 15 2016
,
Jun 15 2016
,
Jun 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80 commit cc526ef25f0b6d2a819700ccbeac2b3acf6fab80 Author: shanmuga.m <shanmuga.m@samsung.com> Date: Wed Jun 22 16:30:31 2016 Add contentWindow attribute for <object> elements Firefox supporting contentWindow attribute for <object> element. BUG= 601771 Review-Url: https://codereview.chromium.org/2077523002 Cr-Commit-Position: refs/heads/master@{#401302} [add] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/HTMLObject-contentWindow-query.html [add] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/resources/HTMLObject-contentWindow.svg [modify] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt [modify] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/embedded-content/the-object-element/object-attributes-expected.txt [modify] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt [modify] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt [modify] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt [modify] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt [modify] https://crrev.com/cc526ef25f0b6d2a819700ccbeac2b3acf6fab80/third_party/WebKit/Source/core/html/HTMLObjectElement.idl
,
Jul 28 2016
,
Aug 19 2016
Issue 492804 has been merged into this issue. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by manoranj...@chromium.org
, Apr 8 2016Labels: Needs-Bisect