[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
eric at webkit.org
eric at webkit.org
Thu Apr 8 01:05:13 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit a3baf4f41e75b29da2819bbb6e7d5cb64db4fcba
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 14 07:35:01 2010 +0000
2010-01-13 Mads Ager <ager at chromium.org>
Reviewed by Dimitri Glazkov.
[V8] Slow named property lookup on DOMWindow because of missing fast case
https://bugs.webkit.org/show_bug.cgi?id=33584
Add fast case checks to V8 named property getter on DOMWindow
objects. If the property is not in the DOM there is no reason to
search the DOM for all occurrences.
Covered by layout tests.
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::namedPropertyGetter):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8d01b57..1e921f9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-13 Mads Ager <ager at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [V8] Slow named property lookup on DOMWindow because of missing fast case
+ https://bugs.webkit.org/show_bug.cgi?id=33584
+
+ Add fast case checks to V8 named property getter on DOMWindow
+ objects. If the property is not in the DOM there is no reason to
+ search the DOM for all occurrences.
+
+ Covered by layout tests.
+
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+
2010-01-13 Gavin Barraclough <barraclough at apple.com>
Reviewed by Oliver Hunt.
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index aa5b6a6..d606f24 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -40,6 +40,7 @@
#include "FrameLoadRequest.h"
#include "FrameView.h"
#include "HTMLCollection.h"
+#include "HTMLDocument.h"
#include "MediaPlayer.h"
#include "Page.h"
#include "PlatformScreen.h"
@@ -812,13 +813,14 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
// Search named items in the document.
Document* doc = frame->document();
- if (doc) {
- RefPtr<HTMLCollection> items = doc->windowNamedItems(propName);
- if (items->length() >= 1) {
- if (items->length() == 1)
- return V8DOMWrapper::convertNodeToV8Object(items->firstItem());
- else
+ if (doc && doc->isHTMLDocument()) {
+ if (static_cast<HTMLDocument*>(doc)->hasNamedItem(propName.impl()) || doc->hasElementWithId(propName.impl())) {
+ RefPtr<HTMLCollection> items = doc->windowNamedItems(propName);
+ if (items->length() >= 1) {
+ if (items->length() == 1)
+ return V8DOMWrapper::convertNodeToV8Object(items->firstItem());
return V8DOMWrapper::convertToV8Object(V8ClassIndex::HTMLCOLLECTION, items.release());
+ }
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list