|
|
Created:
3 years, 11 months ago by shend Modified:
3 years, 10 months ago 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. |
DescriptionReplace 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 #
Dependent Patchsets: Messages
Total messages: 29 (20 generated)
The CQ bit was checked by shend@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: No L-G-T-M from a valid reviewer yet. CQ run can only be started by full committers or once the patch has received an L-G-T-M from a full committer. Even if an L-G-T-M may have been provided, it was from a non-committer, _not_ a full super star committer. See http://www.chromium.org/getting-involved/become-a-committer Note that this has nothing to do with OWNERS files.
shend@chromium.org changed reviewers: + rjwright@chromium.org
hey Renee, PTAL :)
Description was changed from ========== 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=628043 ========== to ========== 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=684966 ==========
shend@chromium.org changed reviewers: + nainar@chromium.org
Hi Naina, PTAL. I'm not sure if this might cause a perf regression, but I can't run perf trybots until I get a committer LGTM :)
lgtm with caveat that perf impact is explored in that case :)
The CQ bit was checked by shend@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by shend@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
shend@chromium.org changed reviewers: + sashab@chromium.org
Hey Sasha PTAL. I ran some layout benchmarks locally on release and there doesn't seem to be any perf issue.
I don't think this will introduce a regression either, but just in case and just so you get experience using the infra, get anna to show you how to run the perf bots :) ccing anna in now. if they all look good LGTM
Description was changed from ========== 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=684966 ========== to ========== 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 ==========
The CQ bit was checked by shend@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 1, "attempt_start_ts": 1485832128292400, "parent_rev": "de6c94731f626e4c6a4abee4b046a13d453edf83", "commit_rev": "b2ba6289f11d85440727609ac8430e7804933066"}
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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/+/b2ba6289f11d85440727609ac843... ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/b2ba6289f11d85440727609ac843...
Message was sent while issue was closed.
On 2017/01/30 18:24:32, sashab wrote: > I don't think this will introduce a regression either, but just in case and just > so you get experience using the infra, get anna to show you how to run the perf > bots :) ccing anna in now. > > if they all look good LGTM Hi Sasha, Perhaps you cc'd not Anna, but me here. Btw, old trick was really nice, and you might preserve it even with converting EClear to enum class by providing operator&. Bye.
Message was sent while issue was closed.
Haha thank you! Sorry for CCing the wrong person >< +the right anna this time |