[webkit-reviews] review denied: [Bug 86557] Allow WebTextFieldDecoratorClient to see applied decorations. : [Attachment 143861] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 24 18:49:52 PDT 2012


Kent Tamura <tkent at chromium.org> has denied Garrett Casto
<gcasto at chromium.org>'s request for review:
Bug 86557: Allow WebTextFieldDecoratorClient to see applied decorations.
https://bugs.webkit.org/show_bug.cgi?id=86557

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

------- Additional Comments from Kent Tamura <tkent at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=143861&action=review


Looks almost ok.  r- because of some nits.

> Source/WebCore/html/shadow/TextFieldDecorationElement.cpp:118
>      setInlineStyleProperty(CSSPropertyWebkitBoxFlex, 0.0,
CSSPrimitiveValue::CSS_NUMBER);
>      box->appendChild(this);
> +
> +    if (visible)
> +	   setInlineStyleProperty(CSSPropertyDisplay, CSSValueBlock);
> +    else
> +	   setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);

This should be put before box->appendChild(this) to avoid style-recalc after
renderer attachment.
Also, we can write this as setInlineStyleProperty(CSSPropertyDisplay, visible ?
CSSValueBlock : CSSValueNone);

> Source/WebKit/chromium/src/TextFieldDecoratorImpl.cpp:64
> +
> +

nit: should be one blank line.

> Source/WebKit/chromium/src/WebInputElement.cpp:236
> +	   if (decoration
> +	       &&
decoratorClient->isClientFor(decoration->textFieldDecorator())) {

nit: You don't need to wrap these line.
You don't need { }.

> Source/WebKit/chromium/src/WebTextFieldDecorationElement.cpp:49
> +    if (visible)
> +	  
unwrap<TextFieldDecorationElement>()->setAttribute(HTMLNames::styleAttr,
> +							      "display:block");

> +    else
> +	  
unwrap<TextFieldDecorationElement>()->setAttribute(HTMLNames::styleAttr,
> +							      "display:none");

You should use setInlineStyleProperty() like you did in
TextFieldDecorationElement::decorate().
Setting style attribute is expensive.


More information about the webkit-reviews mailing list