We should move m_caches from DynamicSubtreeNodeList and ChildNodeList up into the common base class, DynamicNodeList.
And since there's no longer a need for the Caches object to be ref-counted, we could do away with the RefCounted inheritance.
Created attachment 123060 [details]
Attachment 123060 [details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/dom/DynamicNodeList.cpp:99: An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] 
Total errors found: 1 in 5 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 123060 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=123060&action=review
Excellent! Saves 4 bytes per node list!
>> + if (offset == m_caches.lastItemOffset)
> An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] 
Please address this style warning before landing the patch.
> + unsigned cachedLength;
> + unsigned lastItemOffset;
> + bool isLengthCacheValid : 1;
> + bool isItemCacheValid : 1;
You should steal 2 bits from lastItemOffset. Be sure to add a compile assert & change bools to unsigned to work-around MSVC behavior.
Committed r105408: <http://trac.webkit.org/changeset/105408>