[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:15:28 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit da6e1505ee66844c106524e607d3cbf468351179
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 2 11:00:40 2003 +0000
Merged the following patch from David Faure to fix:
<rdar://problem/3497663>: Can't look up frames by number using windw[i] notation
2003-11-25 David Faure <faure at kde.org>
* ecma/kjs_window.cpp: Implement hasProperty and get for frames by number in Window,
to fix window[0] and parent[1] etc. (#56983)
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 571baa9..f8c5676 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,14 @@
+2003-12-02 Maciej Stachowiak <mjs at apple.com>
+
+ Merged the following patch from David Faure to fix:
+
+ <rdar://problem/3497663>: Can't look up frames by number using windw[i] notation
+
+ 2003-11-25 David Faure <faure at kde.org>
+
+ * ecma/kjs_window.cpp: Implement hasProperty and get for frames by number in Window,
+ to fix window[0] and parent[1] etc. (#56983)
+
2003-11-21 Maciej Stachowiak <mjs at apple.com>
Reviewed by Richard.
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index 2464ef2..574acfa 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -698,6 +698,21 @@ Value Window::get(ExecState *exec, const Identifier &p) const
if (kp)
return Value(retrieve(kp));
+ // allow window[1] or parent[1] etc. (#56983)
+ bool ok;
+ unsigned int i = p.toArrayIndex(&ok);
+ if (ok) {
+ QPtrList<KParts::ReadOnlyPart> frames = m_part->frames();
+ unsigned int len = frames.count();
+ if (i < len) {
+ KParts::ReadOnlyPart* frame = frames.at(i);
+ if (frame && frame->inherits("KHTMLPart")) {
+ KHTMLPart *khtml = static_cast<KHTMLPart*>(frame);
+ return Window::retrieve(khtml);
+ }
+ }
+ }
+
// allow shortcuts like 'Image1' instead of document.images.Image1
if (isSafeScript(exec) &&
m_part->document().isHTMLDocument()) { // might be XML
@@ -1757,7 +1772,7 @@ Value FrameArray::get(ExecState *exec, const Identifier &p) const
return Undefined();
QPtrList<KParts::ReadOnlyPart> frames = part->frames();
- int len = frames.count();
+ unsigned int len = frames.count();
if (p == lengthPropertyName)
return Number(len);
else if (p== "location") // non-standard property, but works in NS and IE
@@ -1771,10 +1786,10 @@ Value FrameArray::get(ExecState *exec, const Identifier &p) const
// check for the name or number
KParts::ReadOnlyPart *frame = part->findFrame(p.qstring());
if (!frame) {
- int i = (int)p.toDouble();
- if (i >= 0 && i < len){
+ bool ok;
+ unsigned int i = p.toArrayIndex(&ok);
+ if (ok && i < len)
frame = frames.at(i);
- }
}
// we are potentially fetching a reference to a another Window object here.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list