Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Issue 2736563002: Remove unused equality operator from ComputedStyleBase. (Closed)

Created:
3 years, 9 months ago by shend
Modified:
3 years, 9 months ago
Reviewers:
meade_UTC10, sashab
CC:
blink-reviews, blink-reviews-style_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove unused equality operator from ComputedStyleBase. ComputedStyleBase::operator== is generated incorrectly since it includes nonproperty fields as well. Fortunately, the equality operator is never called anywhere, so it didn't cause any issues. This patch removes this operator so that we don't accidentally use it in the future. ComputedStyle has a correct equality implementation that should be used instead. BUG=628043 Review-Url: https://codereview.chromium.org/2736563002 Cr-Commit-Position: refs/heads/master@{#455606} Committed: https://chromium.googlesource.com/chromium/src/+/483a632594b00e8cbaa061aeb86c9f9fd965e2ba

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+0 lines, -10 lines) Patch
M third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl View 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 15 (9 generated)
shend
Hi Eddy, PTAL :)
3 years, 9 months ago (2017-03-07 06:08:34 UTC) #6
meade_UTC10
lgtm
3 years, 9 months ago (2017-03-07 23:12:13 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2736563002/1
3 years, 9 months ago (2017-03-08 23:05:42 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/483a632594b00e8cbaa061aeb86c9f9fd965e2ba
3 years, 9 months ago (2017-03-09 00:17:40 UTC) #12
sashab
Hold on, this patch not LGTM. Eventually ComputedStyle will go away, so we want ComputedStyleBase ...
3 years, 9 months ago (2017-03-09 00:21:02 UTC) #14
shend
3 years, 9 months ago (2017-03-09 02:47:44 UTC) #15
Message was sent while issue was closed.
On 2017/03/09 at 00:21:02, sashab wrote:
> Hold on, this patch not LGTM.
> 
> Eventually ComputedStyle will go away, so we want ComputedStyleBase to have
the correct equality implementation for when that happens.
> 
> What we should be doing instead, if we want to keep operator==, is:
> 
> ComputedStyleBase::operator==(other) {
>       ... generated fields ...
> }
> 
> ComputedStyle::operator==(other) {
>     return ComputedStyleBase::operator==(other) &&
>       ... existing nongenerated fields ...
> }
> 
> Otherwise, when the fields in the existing equality operator become generated,
the behavior will be inconsistent.

After some offline discussion, we agreed that the current implementation of
ComputedStyle::operator== is misleading since some fields are excluded in the
comparison. I'll add a TODO in a separate patch to change ::operator== to a
named method (like nonInheritedEquals) that better describes what it's doing.

Powered by Google App Engine
This is Rietveld 408576698