Commit dd6ec3e5 authored by dbates@webkit.org's avatar dbates@webkit.org
Browse files

2010-08-23 Daniel Bates <dbates@rim.com>

        Reviewed by Darin Adler.

        Suffix for CSS alphabetic list style types should fallback to
        decimal for ordinals outside of their representable range
        https://bugs.webkit.org/show_bug.cgi?id=44486

        Test: fast/lists/w3-css3-list-styles-fallback-style.html

        Fixes an issue where the decimal suffix is not used for
        ordinals that cannot be represented by the alphabetic list
        style type.

        Currently, for ordinals that cannot be represented in the
        alphabetic list style we use the suffix associated with the
        list style. Instead, we should use the suffix for the decimal
        list style ('.'). For instance, when the list style type is
        Afar and the starting ordinal is 0, then we fallback to the
        decimal list style suffix '.' because 0 cannot be represented
        in Afar.

        * rendering/RenderListMarker.cpp:
        (WebCore::toRoman): Moved bounds check into WebCore::effectiveListMarkerType().
        (WebCore::toAlphabetic): Ditto.
        (WebCore::toHebrew): Ditto.
        (WebCore::toArmenian): Ditto.
        (WebCore::toGeorgian): Ditto.
        (WebCore::toCJKIdeographic): Ditto.
        (WebCore::effectiveListMarkerType): Added.
        (WebCore::listMarkerSuffix): Added value parameter to prototype.
        Modified to call WebCore::effectiveListMarkerType.
        (WebCore::listMarkerText): Modified to call WebCore::effectiveListMarkerType().
        (WebCore::RenderListMarker::paint): Modified to pass list item ordinal (i.e. m_listItem->value()) to WebCore::listMarkerSuffix().
        (WebCore::RenderListMarker::calcPrefWidths): Ditto.
        (WebCore::RenderListMarker::getRelativeMarkerRect): Ditto.
2010-08-23  Daniel Bates  <dbates@rim.com>

        Reviewed by Darin Adler.

        Suffix for CSS alphabetic list style types should fallback to
        decimal for ordinals outside of their representable range
        https://bugs.webkit.org/show_bug.cgi?id=44486

        Tests that CSS list styles fallback to the decimal list style
        for ordinals that cannot be represented. We need to implement
        DRT support to test the actual suffix (see bug #44489).

        Also, adds test for ordinal 0 for each numeric list style type.

        * fast/lists/resources/w3-css3-list-styles-alphabetic.css: Added.
        * fast/lists/w3-css3-list-styles-alphabetic.html: Moved CSS list styles to file w3-css3-list-styles-alphabetic.css,
        * fast/lists/w3-css3-list-styles-fallback-style-expected.txt: Added.
        * fast/lists/w3-css3-list-styles-fallback-style.html: Added.
        * fast/lists/w3-css3-list-styles-numeric-expected.txt: Added test for ordinal 0 for each list style type.
        * fast/lists/w3-css3-list-styles-numeric.html: Rebased result.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c70650e6
2010-08-23 Daniel Bates <dbates@rim.com>
Reviewed by Darin Adler.
Suffix for CSS alphabetic list style types should fallback to
decimal for ordinals outside of their representable range
https://bugs.webkit.org/show_bug.cgi?id=44486
Tests that CSS list styles fallback to the decimal list style
for ordinals that cannot be represented. We need to implement
DRT support to test the actual suffix (see bug #44489).
Also, adds test for ordinal 0 for each numeric list style type.
* fast/lists/resources/w3-css3-list-styles-alphabetic.css: Added.
* fast/lists/w3-css3-list-styles-alphabetic.html: Moved CSS list styles to file w3-css3-list-styles-alphabetic.css,
* fast/lists/w3-css3-list-styles-fallback-style-expected.txt: Added.
* fast/lists/w3-css3-list-styles-fallback-style.html: Added.
* fast/lists/w3-css3-list-styles-numeric-expected.txt: Added test for ordinal 0 for each list style type.
* fast/lists/w3-css3-list-styles-numeric.html: Rebased result.
2010-08-24 Kent Tamura <tkent@chromium.org>
 
Reviewed by Dimitri Glazkov.
/*
The following styles are ordered as they appear in section 4.4. of the
Draft 7 November 2002 draft of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#alphabetic>.
*/
ol.afar { list-style-type: afar; }
ol.ethiopic-halehame-aa-et { list-style-type: ethiopic-halehame-aa-et; }
ol.ethiopic-halehame-aa-er { list-style-type: ethiopic-halehame-aa-er; }
ol.amharic { list-style-type: amharic; }
ol.ethiopic-halehame-am-et { list-style-type: ethiopic-halehame-am-et; }
ol.amharic-abegede { list-style-type: amharic-abegede; }
ol.ethiopic-abegede-am-et { list-style-type: ethiopic-abegede-am-et; }
ol.cjk-earthly-branch { list-style-type: cjk-earthly-branch; }
ol.cjk-heavenly-stem { list-style-type: cjk-heavenly-stem; }
ol.ethiopic { list-style-type: ethiopic; }
ol.ethiopic-halehame-gez { list-style-type: ethiopic-halehame-gez; }
ol.ethiopic-abegede { list-style-type: ethiopic-abegede; }
ol.ethiopic-abegede-gez { list-style-type: ethiopic-abegede-gez; }
ol.hangul-consonant { list-style-type: hangul-consonant; }
ol.hangul { list-style-type: hangul; }
ol.hiragana-iroha { list-style-type: hiragana-iroha; }
ol.hiragana { list-style-type: hiragana; }
ol.katakana-iroha { list-style-type: katakana-iroha; }
ol.katakana { list-style-type: katakana; }
ol.lower-alpha { list-style-type: lower-alpha; }
ol.lower-latin { list-style-type: lower-latin; }
ol.lower-greek { list-style-type: lower-greek; }
ol.lower-norwegian { list-style-type: lower-norwegian; }
ol.oromo { list-style-type: oromo; }
ol.ethiopic-halehame-om-et { list-style-type: ethiopic-halehame-om-et; }
ol.sidama { list-style-type: sidama; }
ol.ethiopic-halehame-sid-et { list-style-type: ethiopic-halehame-sid-et; }
ol.somali { list-style-type: somali; }
ol.ethiopic-halehame-so-et { list-style-type: ethiopic-halehame-so-et; }
ol.tigre { list-style-type: tigre; }
ol.ethiopic-halehame-tig { list-style-type: ethiopic-halehame-tig; }
ol.tigrinya-er { list-style-type: tigrinya-er; }
ol.ethiopic-halehame-ti-er { list-style-type: ethiopic-halehame-ti-er; }
ol.tigrinya-er-abegede { list-style-type: tigrinya-er-abegede; }
ol.ethiopic-abegede-ti-er { list-style-type: ethiopic-abegede-ti-er; }
ol.tigrinya-et { list-style-type: tigrinya-et; }
ol.ethiopic-halehame-ti-et { list-style-type: ethiopic-halehame-ti-et; }
ol.tigrinya-et-abegede { list-style-type: tigrinya-et-abegede; }
ol.ethiopic-abegede-ti-et { list-style-type: ethiopic-abegede-ti-et; }
ol.upper-alpha { list-style-type: upper-alpha; }
ol.upper-latin { list-style-type: upper-latin; }
ol.upper-greek { list-style-type: upper-greek; }
ol.upper-norwegian { list-style-type: upper-norwegian; }
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="resources/w3-css3-list-styles-alphabetic.css" type="text/css" charset="utf-8" />
<style>
.test ol { float: left; padding-right: 20px; }
.test h2 { clear: left; }
/*
The following styles are ordered as they appear in section 4.4. of the
Draft 7 November 2002 draft of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#alphabetic>.
*/
ol.afar { list-style-type: afar; }
ol.ethiopic-halehame-aa-et { list-style-type: ethiopic-halehame-aa-et; }
ol.ethiopic-halehame-aa-er { list-style-type: ethiopic-halehame-aa-er; }
ol.amharic { list-style-type: amharic; }
ol.ethiopic-halehame-am-et { list-style-type: ethiopic-halehame-am-et; }
ol.amharic-abegede { list-style-type: amharic-abegede; }
ol.ethiopic-abegede-am-et { list-style-type: ethiopic-abegede-am-et; }
ol.cjk-earthly-branch { list-style-type: cjk-earthly-branch; }
ol.cjk-heavenly-stem { list-style-type: cjk-heavenly-stem; }
ol.ethiopic { list-style-type: ethiopic; }
ol.ethiopic-halehame-gez { list-style-type: ethiopic-halehame-gez; }
ol.ethiopic-abegede { list-style-type: ethiopic-abegede; }
ol.ethiopic-abegede-gez { list-style-type: ethiopic-abegede-gez; }
ol.hangul-consonant { list-style-type: hangul-consonant; }
ol.hangul { list-style-type: hangul; }
ol.hiragana-iroha { list-style-type: hiragana-iroha; }
ol.hiragana { list-style-type: hiragana; }
ol.katakana-iroha { list-style-type: katakana-iroha; }
ol.katakana { list-style-type: katakana; }
ol.lower-alpha { list-style-type: lower-alpha; }
ol.lower-latin { list-style-type: lower-latin; }
ol.lower-greek { list-style-type: lower-greek; }
ol.lower-norwegian { list-style-type: lower-norwegian; }
ol.oromo { list-style-type: oromo; }
ol.ethiopic-halehame-om-et { list-style-type: ethiopic-halehame-om-et; }
ol.sidama { list-style-type: sidama; }
ol.ethiopic-halehame-sid-et { list-style-type: ethiopic-halehame-sid-et; }
ol.somali { list-style-type: somali; }
ol.ethiopic-halehame-so-et { list-style-type: ethiopic-halehame-so-et; }
ol.tigre { list-style-type: tigre; }
ol.ethiopic-halehame-tig { list-style-type: ethiopic-halehame-tig; }
ol.tigrinya-er { list-style-type: tigrinya-er; }
ol.ethiopic-halehame-ti-er { list-style-type: ethiopic-halehame-ti-er; }
ol.tigrinya-er-abegede { list-style-type: tigrinya-er-abegede; }
ol.ethiopic-abegede-ti-er { list-style-type: ethiopic-abegede-ti-er; }
ol.tigrinya-et { list-style-type: tigrinya-et; }
ol.ethiopic-halehame-ti-et { list-style-type: ethiopic-halehame-ti-et; }
ol.tigrinya-et-abegede { list-style-type: tigrinya-et-abegede; }
ol.ethiopic-abegede-ti-et { list-style-type: ethiopic-abegede-ti-et; }
ol.upper-alpha { list-style-type: upper-alpha; }
ol.upper-latin { list-style-type: upper-latin; }
ol.upper-greek { list-style-type: upper-greek; }
ol.upper-norwegian { list-style-type: upper-norwegian; }
</style>
<script src="resources/dump-list.js"></script>
<script>
......
CSS3 Fallback to Decimal List Style
Algorithmic
armenian
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is Ա.
PASS list marker is Ք̂Ջ̂Ղ̂Թ̂ՔՋՂԹ.
PASS list marker is 100000000.
cjk-ideographic
PASS list marker is -1.
PASS list marker is 零.
PASS list marker is 一.
ethiopic-numeric
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
georgian
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ა.
PASS list marker is ჵჰშჟთ.
PASS list marker is 20000.
PASS list marker is 20001.
hebrew
PASS list marker is -1.
PASS list marker is אפס.
PASS list marker is א.
PASS list marker is תתקצט'תתקצט.
PASS list marker is 1000000.
PASS list marker is 1000001.
japanese-formal
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
japanese-informal
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
lower-armenian
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
lower-roman
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is i.
simp-chinese-formal
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
simp-chinese-informal
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
syriac
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
tamil
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
trad-chinese-formal
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
trad-chinese-informal
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
upper-armenian
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 1.
upper-roman
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is I.
Alphabetic
afar
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-aa-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-aa-er
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
amharic
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-am-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
amharic-abegede
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
ethiopic-abegede-am-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
cjk-earthly-branch
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 子.
cjk-heavenly-stem
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 甲.
ethiopic
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-gez
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-abegede
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
ethiopic-abegede-gez
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
hangul-consonant
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ㄱ.
hangul
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is 가.
hiragana-iroha
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is い.
hiragana
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is あ.
katakana-iroha
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is イ.
katakana
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ア.
lower-alpha
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is a.
lower-latin
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is a.
lower-greek
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is α.
lower-norwegian
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is a.
oromo
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-om-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
sidama
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-sid-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
somali
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-so-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
tigre
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-tig
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
tigrinya-er
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-ti-er
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
tigrinya-er-abegede
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
ethiopic-abegede-ti-er
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
tigrinya-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
ethiopic-halehame-ti-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is ሀ.
tigrinya-et-abegede
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
ethiopic-abegede-ti-et
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is አ.
upper-alpha
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is A.
upper-latin
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is A.
upper-greek
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is Α.
upper-norwegian
PASS list marker is -1.
PASS list marker is 0.
PASS list marker is A.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="resources/w3-css3-list-styles-alphabetic.css" type="text/css" charset="utf-8" />
<style>
.test ol { float: left; padding-right: 20px; }
.test h2 { clear: left; }
hr { clear: left;}
hr + h2 { color: blue; }
/*
The following styles are ordered as they appear in section 4.2. of the
Draft 7 November 2002 draft of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#algorithmic>.
*/
ol.armenian { list-style-type: armenian; }
ol.cjk-ideographic { list-style-type: cjk-ideographic; }
ol.ethiopic-numeric { list-style-type: ethiopic-numeric; }
ol.georgian { list-style-type: georgian; }
ol.hebrew { list-style-type: hebrew; }
ol.japanese-formal { list-style-type: japanese-formal; }
ol.japanese-informal { list-style-type: japanese-informal; }
ol.lower-armenian { list-style-type: lower-armenian; }
ol.lower-roman { list-style-type: lower-roman; }
ol.simp-chinese-formal { list-style-type: simp-chinese-formal; }
ol.simp-chinese-informal { list-style-type: simp-chinese-informal; }
ol.syriac { list-style-type: syriac; }
ol.tamil { list-style-type: tamil; }
ol.trad-chinese-formal { list-style-type: trad-chinese-formal; }
ol.trad-chinese-informal { list-style-type: trad-chinese-informal; }
ol.upper-armenian { list-style-type: upper-armenian; }
ol.upper-roman { list-style-type: upper-roman; }
</style>
<script src="resources/dump-list.js"></script>
<script>
function runTest()
{
if (!window.layoutTestController)
return;
layoutTestController.dumpAsText();
filterListsWithReplacement(document.querySelectorAll(".test ol"), testListItemMarkerEqualsListItemText);
document.body.removeChild(document.getElementById("description")); // Remove description when running in DRT.
}
window.onload = runTest;
</script>
</head>
<body>
<h1>CSS3 Fallback to Decimal List Style</h1>
<div id="description">
<p>This tests that we fallback to the decimal list style type when the ordinal is outside the representable range for the list style type as per the <a href="http://www.w3.org/TR/css3-lists/">CSS3 Lists module</a> (Draft 7 November 2002). This test PASSED if the list item matches its marker for every list item (below).</p>
<p>Note, as of 08/23/2010, ethiopic-numeric; japanese-formal; japanese-informal; lower-armenian; simp-chinese-formal; simp-chinese-informal; syriac; tamil; trad-chinese-formal; trad-chinese-informal; and upper-armenian are unsupported and hence have expected failure results.</p>
</div>
<hr/>
<h2>Algorithmic</h2>
<div class="test">
<h2>armenian</h2>
<ol class="armenian" start="-1">
<li>-1</li>
<li>0</li>
<li>&#x531;</li>
</ol>
<ol class="armenian" start="99999999">
<li>&#x554;&#x302;&#x54B;&#x302;&#x542;&#x302;&#x539;&#x302;&#x554;&#x54B;&#x542;&#x539;</li>
<li>100000000</li>
</ol>
</div>
<div class="test">
<h2>cjk-ideographic</h2>
<ol class="cjk-ideographic" start="-1">
<li>-1</li>
<li>&#x96F6;</li>
<li>&#x4E00;</li>
</ol>
</div>
<div class="test">
<!-- FIXME: We don't currently support this list-style-type. These are expected failure results. -->
<h2>ethiopic-numeric</h2>
<ol class="ethiopic-numeric" start="-1">
<li>-1</li>