Changeset 53241 in webkit
- Timestamp:
- Jan 13, 2010 11:35:01 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53240 r53241 1 2010-01-13 Mads Ager <ager@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 [V8] Slow named property lookup on DOMWindow because of missing fast case 6 https://bugs.webkit.org/show_bug.cgi?id=33584 7 8 Add fast case checks to V8 named property getter on DOMWindow 9 objects. If the property is not in the DOM there is no reason to 10 search the DOM for all occurrences. 11 12 Covered by layout tests. 13 14 * bindings/v8/custom/V8DOMWindowCustom.cpp: 15 (WebCore::V8DOMWindow::namedPropertyGetter): 16 1 17 2010-01-13 Gavin Barraclough <barraclough@apple.com> 2 18 -
trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
r53164 r53241 41 41 #include "FrameView.h" 42 42 #include "HTMLCollection.h" 43 #include "HTMLDocument.h" 43 44 #include "MediaPlayer.h" 44 45 #include "Page.h" … … 813 814 Document* doc = frame->document(); 814 815 815 if (doc ) {816 RefPtr<HTMLCollection> items = doc->windowNamedItems(propName);817 if (items->length() >= 1) {818 if (items->length() == 1)819 return V8DOMWrapper::convertNodeToV8Object(items->firstItem());820 else816 if (doc && doc->isHTMLDocument()) { 817 if (static_cast<HTMLDocument*>(doc)->hasNamedItem(propName.impl()) || doc->hasElementWithId(propName.impl())) { 818 RefPtr<HTMLCollection> items = doc->windowNamedItems(propName); 819 if (items->length() >= 1) { 820 if (items->length() == 1) 821 return V8DOMWrapper::convertNodeToV8Object(items->firstItem()); 821 822 return V8DOMWrapper::convertToV8Object(V8ClassIndex::HTMLCOLLECTION, items.release()); 823 } 822 824 } 823 825 }
Note: See TracChangeset
for help on using the changeset viewer.