Bug 81492 - Use CSSPrimitiveValue::convertToLength() in a few places.
Summary: Use CSSPrimitiveValue::convertToLength() in a few places.
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: 2012-03-18 22:57 PDT by Luke Macpherson
Modified: 2012-03-21 17:58 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.21 KB, patch)
2012-03-18 23:01 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (5.83 KB, patch)
2012-03-20 19:43 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch for landing (6.18 KB, patch)
2012-03-21 17:13 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 2012-03-18 22:57:20 PDT
Use CSSPrimitiveValue::convertToLength() in a few places.
Comment 1 Luke Macpherson 2012-03-18 23:01:37 PDT
Created attachment 132546 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-03-20 16:05:31 PDT
Comment on attachment 132546 [details]
Patch

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

OK.  These template functions seem slightly awkward to use.  I could easily imagine missing one of the OR bits I should have when writing new code. :(

> Source/WebCore/css/CSSStyleApplyProperty.cpp:1568
> +        selector->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()));

I think having a Length local might help readability here. :)
Comment 3 Luke Macpherson 2012-03-20 19:43:02 PDT
Created attachment 132949 [details]
Patch
Comment 4 WebKit Review Bot 2012-03-20 19:49:20 PDT
Attachment 132949 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/css/CSSPrimitiveValueMappings.h:34:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Luke Macpherson 2012-03-20 19:50:42 PDT
Comment on attachment 132949 [details]
Patch

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

>> Source/WebCore/css/CSSPrimitiveValueMappings.h:34
>> +#include "CSSCalculationValue.h"
> 
> Alphabetical sorting problem.  [build/include_order] [4]

It lies!
Comment 6 Simon Fraser (smfr) 2012-03-21 16:48:45 PDT
Comment on attachment 132949 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        No new tests - refactoring only.

Why no description of changes? You at least need to justify the refactoring.
Comment 7 Eric Seidel (no email) 2012-03-21 16:48:57 PDT
Comment on attachment 132949 [details]
Patch

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

Seems reasonable.

>>> Source/WebCore/css/CSSPrimitiveValueMappings.h:34
>>> +#include "CSSCalculationValue.h"
>> 
>> Alphabetical sorting problem.  [build/include_order] [4]
> 
> It lies!

It thinks ColorSpace should be after CSS.  the capital S is before all lower case letters, I believe.
Comment 8 Luke Macpherson 2012-03-21 17:13:37 PDT
Created attachment 133146 [details]
Patch for landing
Comment 9 WebKit Review Bot 2012-03-21 17:58:52 PDT
Comment on attachment 133146 [details]
Patch for landing

Clearing flags on attachment: 133146

Committed r111631: <http://trac.webkit.org/changeset/111631>
Comment 10 WebKit Review Bot 2012-03-21 17:58:57 PDT
All reviewed patches have been landed.  Closing bug.