Changeset 89035 in webkit
- Timestamp:
- Jun 16, 2011 9:50:19 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89034 r89035 1 2011-06-16 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 HTMLTable should cache its 'rows' collection results 6 https://bugs.webkit.org/show_bug.cgi?id=62800 7 8 * perf/table-rows-length-caching-expected.txt: Added. 9 * perf/table-rows-length-caching.html: Added. 10 This test checks that the call to table.rows is CONSTANT once it has 11 been populated once (and the DOM is not mutated). 12 1 13 2011-06-16 Vitaly Repeshko <vitalyr@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r89027 r89035 1 2011-06-16 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 HTMLTable should cache its 'rows' collection results 6 https://bugs.webkit.org/show_bug.cgi?id=62800 7 8 Test: perf/table-rows-length-caching.html 9 10 Currently all our HTMLCollection's are recreated on call. This means that 11 we don't cache the information about the collection between calls to, for 12 example, table.rows. 13 14 This change adds a CollectionCache to HTMLTableElement. It is similar to what 15 is done for HTMLFormElement. 16 17 * html/HTMLTableElement.cpp: 18 (WebCore::HTMLTableElement::collectionCache): This method does 19 lazy initialization of the table's collectionCache. 20 * html/HTMLTableElement.h: Added a new member and the previous 21 method. 22 23 * html/HTMLTableRowsCollection.cpp: 24 (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): Pass 25 the HTMLTableElement's CollectionCache so that we reuse the cached 26 results. 27 1 28 2011-06-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 29 -
trunk/Source/WebCore/html/HTMLTableElement.cpp
r72259 r89035 625 625 } 626 626 627 CollectionCache* HTMLTableElement::collectionCache() const 628 { 629 if (!m_collectionCache) 630 m_collectionCache = adoptPtr(new CollectionCache()); 631 632 return m_collectionCache.get(); 633 } 634 627 635 void HTMLTableElement::attach() 628 636 { -
trunk/Source/WebCore/html/HTMLTableElement.h
r66057 r89035 69 69 void addSharedGroupDecls(bool rows, Vector<CSSMutableStyleDeclaration*>&); 70 70 71 CollectionCache* collectionCache() const; 72 71 73 private: 72 74 HTMLTableElement(const QualifiedName&, Document*); … … 101 103 unsigned short m_padding; 102 104 RefPtr<CSSMappedAttributeDeclaration> m_paddingDecl; 105 mutable OwnPtr<CollectionCache> m_collectionCache; 103 106 }; 104 107 -
trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp
r72259 r89035 150 150 151 151 HTMLTableRowsCollection::HTMLTableRowsCollection(PassRefPtr<HTMLTableElement> table) 152 : HTMLCollection(table, OtherCollection, 0)152 : HTMLCollection(table, OtherCollection, table->collectionCache()) 153 153 { 154 154 }
Note: See TracChangeset
for help on using the changeset viewer.