Skip to content

Commit ec6e87b

Browse files
author
Anders Carlsson
committed
LayoutTests:
Reviewed by Mitz. <rdar://problem/5280532> REGRESSION: Can't access nested embed by document.name if object is not immediate parent * plugins/embed-inside-object-expected.txt: Added. * plugins/embed-inside-object.html: Added. WebCore: Reviewed by Mitz. <rdar://problem/5280532> REGRESSION: Can't access nested embed by document.name if object is not immediate parent Traverse up the tree looking for an object element. * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::getInstance): Canonical link: https://commits.webkit.org/18806@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent c86135d commit ec6e87b

5 files changed

Lines changed: 73 additions & 2 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2007-07-06 Anders Carlsson <andersca@apple.com>
2+
3+
Reviewed by Mitz.
4+
5+
<rdar://problem/5280532>
6+
REGRESSION: Can't access nested embed by document.name if object is not immediate parent
7+
8+
* plugins/embed-inside-object-expected.txt: Added.
9+
* plugins/embed-inside-object.html: Added.
10+
111
2007-07-06 Adam Roben <aroben@apple.com>
212

313
Add another Leopard failure
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
This tests that it's possible to control an embed that is nested inside an object with a span tag in between.
3+
plugin object is: [object HTMLEmbedElement]
4+
SUCCESS
5+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<html>
2+
<script>
3+
function debug(str) {
4+
document.getElementById('console').innerHTML += str + "<br>";
5+
}
6+
7+
function pluginCallback() {
8+
debug('SUCCESS');
9+
if (window.layoutTestController)
10+
layoutTestController.notifyDone();
11+
}
12+
13+
function runTest() {
14+
if (window.layoutTestController) {
15+
layoutTestController.dumpAsText();
16+
layoutTestController.waitUntilDone();
17+
}
18+
19+
var plugin = document.plugin;
20+
21+
debug('plugin object is: ' + plugin);
22+
plugin.getURL('javascript:pluginCallback()', '_self')
23+
}
24+
</script>
25+
<body onload="runTest()">
26+
<object name="plugin" type="application/x-webkit-test-netscape">
27+
<span>
28+
<embed name="plugin" type="application/x-webkit-test-netscape"></embed>
29+
</span>
30+
</object>
31+
<div>
32+
This tests that it's possible to control an embed that is nested inside an object with a span tag in between.
33+
</div>
34+
<div id="console">
35+
</div>
36+
</body>
37+
</html>

WebCore/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2007-07-06 Anders Carlsson <andersca@apple.com>
2+
3+
Reviewed by Mitz.
4+
5+
<rdar://problem/5280532>
6+
REGRESSION: Can't access nested embed by document.name if object is not immediate parent
7+
8+
Traverse up the tree looking for an object element.
9+
10+
* html/HTMLEmbedElement.cpp:
11+
(WebCore::HTMLEmbedElement::getInstance):
12+
113
2007-07-06 George Staikos <staikos@kde.org>
214

315
Qt build fix: Don't clobber qmake variables that are already set.

WebCore/html/HTMLEmbedElement.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@ KJS::Bindings::Instance *HTMLEmbedElement::getInstance() const
6868
RenderObject *r = renderer();
6969
if (!r) {
7070
Node *p = parentNode();
71-
if (p && p->hasTagName(objectTag))
72-
r = p->renderer();
71+
72+
while (p) {
73+
if (p->hasTagName(objectTag)) {
74+
r = p->renderer();
75+
break;
76+
}
77+
78+
p = p->parentNode();
79+
}
7380
}
7481

7582
if (r && r->isWidget()) {

0 commit comments

Comments
 (0)