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

Issue 2652103002: Replace bitwise & on EClear enum with equality. (Closed)

Created:
3 years, 11 months ago by shend
Modified:
3 years, 10 months ago
Reviewers:
nainar, sashab, rjwright
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1, aazzam
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace bitwise & on EClear enum with equality. Currently EClear is defined so that ClearLeft = 1, ClearRight = 2, and ClearBoth = 3. Thus, we can use EClear like a bit flag and check if a clear value X is either left or both by writing X & ClearLeft. However, when we genereate EClear as part of generating ComputedStyle, there's no guarantee on the ordering of the enum values, so we can no longer depend on this trick. This patch simply replaces the bitwise operation with an equality expression which doesn't depend on the ordering of enum values. This is prework for converting EClear to an enum class. BUG=665272 Review-Url: https://codereview.chromium.org/2652103002 Cr-Commit-Position: refs/heads/master@{#447190} Committed: https://chromium.googlesource.com/chromium/src/+/b2ba6289f11d85440727609ac8430e7804933066

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -4 lines) Patch
M third_party/WebKit/Source/core/layout/LayoutBlock.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp View 1 chunk +4 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 29 (20 generated)
shend
hey Renee, PTAL :)
3 years, 11 months ago (2017-01-24 23:52:20 UTC) #6
shend
Hi Naina, PTAL. I'm not sure if this might cause a perf regression, but I ...
3 years, 10 months ago (2017-01-27 03:45:30 UTC) #9
nainar
lgtm with caveat that perf impact is explored in that case :)
3 years, 10 months ago (2017-01-27 03:53:27 UTC) #10
shend
Hey Sasha PTAL. I ran some layout benchmarks locally on release and there doesn't seem ...
3 years, 10 months ago (2017-01-30 00:24:44 UTC) #20
sashab
I don't think this will introduce a regression either, but just in case and just ...
3 years, 10 months ago (2017-01-30 18:24:32 UTC) #21
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/2652103002/1
3 years, 10 months ago (2017-01-31 03:09:18 UTC) #24
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/b2ba6289f11d85440727609ac8430e7804933066
3 years, 10 months ago (2017-01-31 04:43:01 UTC) #27
aazakh
On 2017/01/30 18:24:32, sashab wrote: > I don't think this will introduce a regression either, ...
3 years, 10 months ago (2017-01-31 10:35:51 UTC) #28
sashab
3 years, 10 months ago (2017-01-31 18:47:09 UTC) #29
Message was sent while issue was closed.
Haha thank you! Sorry for CCing the wrong person ><

+the right anna this time

Powered by Google App Engine
This is Rietveld 408576698