Clean up CSS Counter code
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 19:47:48 +0000 (19:47 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 19:47:48 +0000 (19:47 +0000)
commit3d8ae636c778afd25053179203089b3456a0e154
tree7ec5c7895a9837585f208288199513f95ca02920
parent5b4700533fe8b5cf7261626b48e4f9305a19e251
Clean up CSS Counter code
https://bugs.webkit.org/show_bug.cgi?id=68492

Reviewed by Tony Chang.

Source/WebCore:

Several cleanups/fixes:
- Make Counter::listStyle() return the actual list style string,
  rather than empty string.
- Handle a specified list style of "none" correctly when generating
  cssText and in Counter::listStyle().
- Use StringBuilder when generating cssText.

Test: fast/css/counters/getCounterValue.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseCounterContent):
Simplify processing (moving conversion to CSSStyleSelector),
pass a CSS_IDENT as the listStyle to Counter::create.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::cssText):
Use StringBuilder.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
Convert from a CSS_IDENT to an EListStyleType.
* css/Counter.h:
(WebCore::Counter::listStyleIdent):
Renamed from listStyleNumber to match its new functionality.

LayoutTests:

Added tests for setting the list style to "none"
as well as tests for getCounterValue.

* fast/css/counters/counter-cssText-expected.txt:
* fast/css/counters/counter-cssText.html:
* fast/css/counters/getCounterValue-expected.txt: Added.
* fast/css/counters/getCounterValue.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/counters/counter-cssText-expected.txt
LayoutTests/fast/css/counters/counter-cssText.html
LayoutTests/fast/css/counters/getCounterValue-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/counters/getCounterValue.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/Counter.h