[webkit-reviews] review granted: [Bug 238035] nj.gov: Background color incorrect for 'State Vehicles' section : [Attachment 455054] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 17 21:58:54 PDT 2022


Aditya Keerthi <akeerthi at apple.com> has granted Kate Cheney
<katherine_cheney at apple.com>'s request for review:
Bug 238035: nj.gov: Background color incorrect for 'State Vehicles' section
https://bugs.webkit.org/show_bug.cgi?id=238035

Attachment 455054: Patch

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




--- Comment #10 from Aditya Keerthi <akeerthi at apple.com> ---
Comment on attachment 455054
  --> https://bugs.webkit.org/attachment.cgi?id=455054
Patch

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

> Source/WebCore/rendering/RenderTheme.cpp:114
> +static bool styleBorderAndBackgroundDiffer(const RenderStyle& style, const
RenderStyle& otherStyle)

I saw that we have the following methods in RenderStyle which compare two
styles:

```
bool inheritedEqual(const RenderStyle&) const;
bool descendantAffectingNonInheritedPropertiesEqual(const RenderStyle&) const;
```

Consider declaring this as `bool borderAndBackgroundEqual(const RenderStyle&)
const;` and implementing in `RenderStyle`.

> Source/WebCore/rendering/RenderTheme.cpp:124
> +    auto part = adjustAppearanceForElement(style, element,
autoAppearanceForElement);

I prefer to avoid out-parameters when possible, as they add indirection when
reading code, and can give a single method too much responsibility.

Consider moving the call to `autoAppearanceForElement()` to the line above, and
passing the result into `adjustAppearanceForElement`.


More information about the webkit-reviews mailing list