Bug 52233 - WebKitCSSMatrix constructor should accept 'none'
Summary: WebKitCSSMatrix constructor should accept 'none'
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-01-11 12:14 PST by Dean Jackson
Modified: 2011-01-11 14:02 PST (History)
2 users (show)

See Also:


Attachments
Patch (4.83 KB, patch)
2011-01-11 12:25 PST, Dean Jackson
no flags Details | Formatted Diff | Diff
Patch (4.99 KB, patch)
2011-01-11 12:54 PST, Dean Jackson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2011-01-11 12:14:34 PST
Sometime recently-ish, an element without a transform started returning 'none' as a computed style. This breaks existing code that simply pushes the computed style into the WebKitCSSMatrix constructor, since it does not accept the 'none' string.

Update the constructor to accept 'none'.

<rdar://problem/8844355>
Comment 1 Dean Jackson 2011-01-11 12:25:57 PST
Created attachment 78577 [details]
Patch
Comment 2 Simon Fraser (smfr) 2011-01-11 12:31:49 PST
Comment on attachment 78577 [details]
Patch

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

> LayoutTests/transforms/cssmatrix-2d-interface.xhtml:19
> +function testConstructor(desc, parameter) {
> +  var m = null;
> +  m = new WebKitCSSMatrix(parameter);
> +  if (m)
> +    testPassed(desc);
> +  else
> +    testFailed(desc);
> +}

No need for this, since you can do 1-line tests:
shouldBeNull('"new WebKitCSSMatrix(foopy)"')
or similar (with some quoting magic).

> LayoutTests/transforms/cssmatrix-2d-interface.xhtml:31
> +var m = new WebKitCSSMatrix();
>  if (m)
>    testPassed("default constructor");
>  else
>    testFailed("default constructor");

These should be 1-liners using shouldBeNull() etc.

> Source/WebCore/css/WebKitCSSMatrix.cpp:61
> -        PassRefPtr<CSSValue> val =  styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform);
> +        CSSValue* value =  styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform).get();

This should be a RefPtr<CSSValue>
Comment 3 Dean Jackson 2011-01-11 12:54:03 PST
Created attachment 78586 [details]
Patch
Comment 4 Dean Jackson 2011-01-11 14:02:52 PST
Landed in http://trac.webkit.org/changeset/75542