Bug 62964 - Support cast from CSSPrimitiveValue to short and use for CSSPropertyWidows and CSSPropertyOrphans.
Summary: Support cast from CSSPrimitiveValue to short and use for CSSPropertyWidows an...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luke Macpherson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-19 22:28 PDT by Luke Macpherson
Modified: 2011-06-22 10:42 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.76 KB, patch)
2011-06-19 22:29 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (2.77 KB, patch)
2011-06-19 23:44 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Macpherson 2011-06-19 22:28:14 PDT
Support cast from CSSPrimitiveValue to short and use for CSSPropertyWidows and CSSPropertyOrphans.
Comment 1 Luke Macpherson 2011-06-19 22:29:47 PDT
Created attachment 97746 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-06-19 23:36:03 PDT
Comment on attachment 97746 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=97746&action=review

These seem kinda scary.  But maybe they're useful?

> Source/WebCore/ChangeLog:8
> +        No new tests. (OOPS!)

This will cause the cq to fail.  Normally you replace this with a list of tests or why testing is impossible/impractical/unnecessary.
Comment 3 Luke Macpherson 2011-06-19 23:38:07 PDT
(In reply to comment #2)
> (From update of attachment 97746 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=97746&action=review
> 
> These seem kinda scary.  But maybe they're useful?
> 
> > Source/WebCore/ChangeLog:8
> > +        No new tests. (OOPS!)
> 
> This will cause the cq to fail.  Normally you replace this with a list of tests or why testing is impossible/impractical/unnecessary.

Ack. Yeah just overlooked that.
Comment 4 Luke Macpherson 2011-06-19 23:44:00 PDT
Created attachment 97753 [details]
Patch
Comment 5 Dimitri Glazkov (Google) 2011-06-20 08:34:53 PDT
Comment on attachment 97753 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=97753&action=review

> Source/WebCore/css/CSSPrimitiveValueMappings.h:57
> +template<> inline CSSPrimitiveValue::operator short() const

I worry that we're getting a bit too fancy here. Will I be able to understand what this means 2 years from now?
Comment 6 Luke Macpherson 2011-06-22 10:21:50 PDT
Since CSSPrimitiveValue is essentially a union of all possible CSS types, including the number type, being able to cast CSSPrimitiveValue to numeric types seems reasonable.

Could you expand on why you think this will be hard to understand (or harder than the numerous other casts that CSSPrimitiveValue supports)?
Comment 7 Dimitri Glazkov (Google) 2011-06-22 10:29:53 PDT
Comment on attachment 97753 [details]
Patch

I think it's because I have an unnatural antipathy toward templates and operators.
Comment 8 WebKit Review Bot 2011-06-22 10:42:41 PDT
Comment on attachment 97753 [details]
Patch

Clearing flags on attachment: 97753

Committed r89448: <http://trac.webkit.org/changeset/89448>
Comment 9 WebKit Review Bot 2011-06-22 10:42:45 PDT
All reviewed patches have been landed.  Closing bug.