Add iterator to CSSValueList
authormacpherson@chromium.org <macpherson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2011 08:31:43 +0000 (08:31 +0000)
committermacpherson@chromium.org <macpherson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2011 08:31:43 +0000 (08:31 +0000)
commit4a28d007c977f05f585542904ecfb413b5f652e5
tree74678f156ab53cac61d5ea416c4add3b0d1d7ea0
parentc456a4b9188d28dda14f75c743e27dda75b6b7ea
Add iterator to CSSValueList
https://bugs.webkit.org/show_bug.cgi?id=65297

Reviewed by Darin Adler.

No new tests / refactoring only.

* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isLength):
Add shorthand to determine if this primitive value is a length.
* css/CSSStyleSelector.cpp:
Use CSSValueListIterator throughout.
(WebCore::CSSStyleSelector::applyProperty):
(WebCore::CSSStyleSelector::applyPageSizeProperty):
(WebCore::CSSStyleSelector::createTransformOperations):
* css/CSSValueList.cpp:
(WebCore::CSSValueList::copy):
Use itemWithoutBoundsCheck() instead of item().
* css/CSSValueList.h:
Add CSSValueListIterator and CSSValueListInspector class definitions.
(WebCore::CSSValueList::item)
Provide inline definition of item.
(WebCore::CSSValueListIterator::CSSValueListIterator):
(WebCore::CSSValueListIterator::hasMore):
Return true if there are more values to consume, including the current value.
(WebCore::CSSValueListIterator::value):
Return the value at the current position.
(WebCore::CSSValueListIterator::next):
Move the iterator forward to the next item.
(WebCore::CSSValueListIterator::index):
Return the current position in the list.
(WebCore::CSSValueListInspector::item):
Return the item at a given index.
(WebCore::CSSValueListInspector::first):
Return the first item in the list.
(WebCore::CSSValueListInspector::second):
Return the second item in the list.
(WebCore::CSSValueListInspector::length):
Return the size of the underlying list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSValueList.cpp
Source/WebCore/css/CSSValueList.h