Bug 44486 - Suffix for CSS alphabetic list style types should fallback to decimal for ordinals outside of their representable range
Summary: Suffix for CSS alphabetic list style types should fallback to decimal for ord...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-23 21:39 PDT by Daniel Bates
Modified: 2010-08-24 20:55 PDT (History)
5 users (show)

See Also:


Attachments
Patch with test case (55.24 KB, patch)
2010-08-23 23:13 PDT, Daniel Bates
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2010-08-23 21:39:37 PDT
The suffix character of a CSS alphabetic list style type should be decimal for all ordinals that cannot be represented by such a list style as per the last sentence of the first paragraph of section 4.3 of the CSS3 Lists spec. <http://www.w3.org/TR/css3-lists/#numeric>: "If an alphabetic system is selected to render zero or a negative number then the decimal numbering style must be used instead."

Note, some alphabetic list style types use a suffix other than a dot. For example, Afar uses the suffix represented by the Unicode code point U+1366.
Comment 1 Daniel Bates 2010-08-23 23:13:29 PDT
Created attachment 65212 [details]
Patch with test case

Moved the bounds checking code from the separate list style functions to effectiveListMarkerType() so that we can re-use this code for determining the fallback suffix style (i.e. decimal).

I am open to name suggestions for the function effectiveListMarkerType.

We need DRT support to test the actual suffix, see bug #44489 for more details.
Comment 2 Darin Adler 2010-08-24 13:46:57 PDT
Comment on attachment 65212 [details]
Patch with test case

> +    EListStyleType effectiveType = type;

I'd prefer if we just used return statements rather than a local variable that we alter and then fall through to a shared return statement.

> +    // If the list-style-type, say hebrew, cannot represent |value| because it's outside
> +    // its ordinal range then we fallback to some list style that can represent |value|.

The word "fallback" is a noun or adjective. You want the verb phrase "fall back".

I don't think the words "say hebrew" help much here.
Comment 3 Daniel Bates 2010-08-24 19:41:11 PDT
(In reply to comment #2)
> (From update of attachment 65212 [details])
> > +    EListStyleType effectiveType = type;
> 
> I'd prefer if we just used return statements rather than a local variable that we alter and then fall through to a shared return statement.
>

Will change.
 
> > +    // If the list-style-type, say hebrew, cannot represent |value| because it's outside
> > +    // its ordinal range then we fallback to some list style that can represent |value|.
> 
> The word "fallback" is a noun or adjective. You want the verb phrase "fall back".
> 

Will change.

> I don't think the words "say hebrew" help much here.

Will remove from comment.
Comment 4 Daniel Bates 2010-08-24 20:05:45 PDT
Committed r65967: <http://trac.webkit.org/changeset/65967>
Comment 5 WebKit Review Bot 2010-08-24 20:55:39 PDT
http://trac.webkit.org/changeset/65970 might have broken SnowLeopard Intel Release (Tests)