[webkit-reviews] review granted: [Bug 71444] [Part 4] Parse the custom() function in -webkit-filter: parse the matN() functions : [Attachment 198969] Patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 21 18:22:10 PDT 2013


Dean Jackson <dino at apple.com> has granted Dirk Schulze <krit at webkit.org>'s
request for review:
Bug 71444: [Part 4] Parse the custom() function in -webkit-filter: parse the
matN() functions
https://bugs.webkit.org/show_bug.cgi?id=71444

Attachment 198969: Patch.
https://bugs.webkit.org/attachment.cgi?id=198969&action=review

------- Additional Comments from Dean Jackson <dino at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=198969&action=review


> Source/WebCore/ChangeLog:23
> +	   * GNUmakefile.list.am: Added WebKitCSSMatFunctionValue to individual
build systems.
> +	   * Target.pri:
> +	   * WebCore.vcproj/WebCore.vcproj:
> +	   * WebCore.vcxproj/WebCore.vcxproj:
> +	   * WebCore.vcxproj/WebCore.vcxproj.filters:
> +	   * WebCore.xcodeproj/project.pbxproj:
> +	   * css/CSSComputedStyleDeclaration.cpp:
> +	   (WebCore::valueForCustomFilterMatParameter):

I really like per-function comments for significant changes.

> Source/WebCore/ChangeLog:29
> +	   (WebCore):

And hate these useless lines! :)

> Source/WebCore/css/CSSParser.cpp:8483
> +    // The name length must be 5;
> +    if (name.length() != 5)

This comment adds nothing.

> Source/WebCore/css/CSSParser.cpp:8499
> +    UChar characterBuffer[5];
> +    if (name.is8Bit()) {
> +	   const LChar* characters8 = name.characters8();
> +	   for (unsigned i = 0; i < 5; ++i)
> +	       characterBuffer[i] = characters8[i];
> +	   characters = characterBuffer;
> +    } else
> +	   characters = name.characters16();
> +
> +    if (!((characters[0] == 'm' || characters[0] == 'M')
> +	   && (characters[1] == 'a' || characters[1] == 'A')
> +	   && (characters[2] == 't' || characters[2] == 'T')
> +	   && characters[4] == '('))
> +	   return 0;

Is there a reason you didn't do something like
equalIgnoringCase(value->function->name, "mat2(") rather than this more complex
approach?

> Source/WebCore/css/WebKitCSSMatFunctionValue.cpp:2
> + * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.

It is 2013. Stop living in the past!!

> Source/WebCore/css/WebKitCSSMatFunctionValue.cpp:57
> +	   return "mat2(" + CSSValueList::customCssText() + ')';
> +    else if (length() == 9)
> +	   return "mat3(" + CSSValueList::customCssText() + ')';
> +    else if (length() == 16)
> +	   return "mat4(" + CSSValueList::customCssText() + ')';
> +    else {

Use StringBuilder?


More information about the webkit-reviews mailing list