[webkit-reviews] review denied: [Bug 223946] Do not paint native decorations for search fields without "-webkit-appearance: searchfield" : [Attachment 424675] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 31 00:50:01 PDT 2021


Antti Koivisto <koivisto at iki.fi> has denied Aditya Keerthi
<akeerthi at apple.com>'s request for review:
Bug 223946: Do not paint native decorations for search fields without
"-webkit-appearance: searchfield"
https://bugs.webkit.org/show_bug.cgi?id=223946

Attachment 424675: Patch

https://bugs.webkit.org/attachment.cgi?id=424675&action=review




--- Comment #11 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 424675
  --> https://bugs.webkit.org/attachment.cgi?id=424675
Patch

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

> Source/WebCore/rendering/RenderSearchField.cpp:193
> +void RenderSearchField::updateResultsButtonAppearance() const
> +{
> +    if (style().appearance() != SearchFieldPart ||
document().quirks().shouldHideSearchFieldResultsButton()) {
> +	  
resultsButtonElement()->setInlineStyleProperty(CSSPropertyWebkitAppearance,
CSSValueNone);
> +	   return;
> +    }
> +
> +   
resultsButtonElement()->removeInlineStyleProperty(CSSPropertyWebkitAppearance);
> +}

RenderSearchField::updateFromElement() gets called after style resolution from
HTMLFormControlElement::didRecalcStyle. Mutating the style here will result in
another style resolution. Also mutating DOM from the render tree is generally
wrong, DOM/style is the input not the output.

I believe the correct way to do this is to implement
SearchFieldResultsButtonElement::resolveCustomStyle() function and looking into
appearance of the passed in shadowHostStyle. See
TextControlPlaceholderElement::resolveCustomStyle and others for examples.


More information about the webkit-reviews mailing list