Convert LogicalSide to enum class in WritingMode.h
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: TYLin, Assigned: flowejam, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=C++] )
Attachments
(1 file, 2 obsolete files)
LogicalSide
is still an old-style enum. Let's convert it to an enum class
to improve type safety.
https://searchfox.org/mozilla-central/rev/5f0a7ca8968ac5cef8846e1d970ef178b8b76dcc/layout/generic/WritingModes.h#54-59
See https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#variable-prefixes for the coding style for enum class
.
Assignee | ||
Comment 1•3 months ago
|
||
Could someone please assign me this bug? If it is possible to be mentored for it as well, that would be very much appreciated (it would be my first contribution to Firefox).
Reporter | ||
Comment 2•3 months ago
|
||
Once you upload a patch for review, this bug will be assigned to you automatically by a bot. You can start from https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html, and bug 1885691 is a similar bug you can reference. Feel free to ask any questions.
Assignee | ||
Comment 3•2 months ago
|
||
Sorry, perhaps this is a silly question, but for the enum LogicalSideBits, is it acceptable to leave it as is for now, just inserting static_casts for the bitwise operations?
I’ve managed to build Firefox and am making changes to WritingMode.h, and will take a look at the other areas of the codebase that are impacted.
Reporter | ||
Comment 4•2 months ago
|
||
Yes, we should leave LogicalSideBits
[1] as it for now. It can be converted to an enum class in a separate bug if needed.
Assignee | ||
Comment 5•2 months ago
|
||
Updated•2 months ago
|
Assignee | ||
Comment 6•2 months ago
|
||
Assignee | ||
Comment 7•2 months ago
|
||
Re. my submitted patch, I did run the local tests but can't yet assess the (many) results properly. I built the project and entered ./mach run without issue though.
Regarding the first commit, the changes spanned a number of files and sections - I was wondering if you have any guidance for such situations? Is it better to try to fix all the sections and include in one commit (as I've done here), or commit more frequently?
Assignee | ||
Comment 8•2 months ago
|
||
Reporter | ||
Comment 9•2 months ago
|
||
(In reply to [:flowejam] from comment #7)
Re. my submitted patch, I did run the local tests but can't yet assess the (many) results properly. I built the project and entered ./mach run without issue though.
I don't know if you have sufficient privilege to run tests on Firefox CI. You might want to try ./mach try auto
per https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#to-test-a-change-remotely
If you encounter any error, I can submit the tests for you.
Regarding the first commit, the changes spanned a number of files and sections - I was wondering if you have any guidance for such situations? Is it better to try to fix all the sections and include in one commit (as I've done here), or commit more frequently?
Yes, in this case, it would be better to include all the fix in one commit because there should be no whitespace and lint error/warning in the first place.
Updated•2 months ago
|
Assignee | ||
Comment 10•2 months ago
|
||
Thanks for the guidance Ting-Yu! I think I've incorporated all of your suggestions in the patch update. I tried running "./mach try auto", but I encountered a permission denied error. Could you please submit the tests for me?
Reporter | ||
Comment 11•2 months ago
|
||
Sure. Here is the try run on CI. https://treeherder.mozilla.org/jobs?repo=try&revision=7e43edc1c4e3b7a3a30d9a61d37708a113403327
The debug builds are broken. Could you fix it in https://phabricator.services.mozilla.com/D205510? You might want to configure a debug build locally via adding ac_add_options --enable-debug
to the mozcofig. See https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html#configuring-build-options for details.
Updated•2 months ago
|
Updated•2 months ago
|
Assignee | ||
Comment 12•2 months ago
|
||
:TYLin, here are some notes from my recent submission:
-
I tested with a debug build and didn't notice any errors this time
-
Although I don't have access to run the try auto tests, I ran the test "./mach wpt testing/web-platform/tests/webrtc-extensions/" locally, and I couldn't find the same error in the log that occurred for the test for "TEST-START | /webrtc-extensions/RTCRtpReceiver-video-jitterBufferTarget-stats.html". From what I could tell, these are performance tests, and I was a bit puzzled because changing to enum class, the static_casts etc. don't seem like changes that would impact performance.
Reporter | ||
Comment 13•2 months ago
|
||
From what I could tell, these are performance tests, and I was a bit puzzled because changing to enum class, the static_casts etc. don't seem like changes that would impact performance.
I think you are right. Your patch shouldn't have any impact on that test suites. It can just be an "intermittent" test failures on CI, which happens from time to time on certain tests.
Comment 14•2 months ago
|
||
Pushed by tlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e6295494089b Converted LogicalSide to an enum class, and renamed variables accordingly. r=TYLin
Assignee | ||
Comment 15•2 months ago
|
||
Thanks, Ting-Yu, for landing the patch for me while I don't yet have access. This has been a very interesting experience for me, and your mentorship for this bug was much appreciated!
Comment 16•2 months ago
|
||
bugherder |
Reporter | ||
Comment 17•2 months ago
|
||
Congrats on landing your first patch in Firefox, :flowejam!
Description
•