Closed
Bug 1307728
Opened 9 years ago
Closed 9 years ago
Convert LineReflowStatus to an enum class
Categories
(Core :: Layout: Block and Inline, defect)
Core
Layout: Block and Inline
Tracking
()
RESOLVED
FIXED
mozilla52
| Tracking | Status | |
|---|---|---|
| firefox52 | --- | fixed |
People
(Reporter: chenpighead, Assigned: chenpighead)
Details
Attachments
(2 files)
No description provided.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 3•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8797964 [details]
Bug 1307728 - use LineReflowStatusToString to support debugging.
https://reviewboard.mozilla.org/r/83584/#review82160
There are few extra whitespaces that should be purged. I decided to purge them while converting LineReflowStatus to an enum class since the number is few. Hope this won't cause any pain while reviewing the patch.
| Assignee | ||
Updated•9 years ago
|
Attachment #8797964 -
Flags: review?(cam)
Attachment #8797965 -
Flags: review?(cam)
Comment 4•9 years ago
|
||
Perhaps we should remove the "default:" branch in the switch so we'll
get a warning there if someone adds a new value without updating it?
| Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #4)
> Perhaps we should remove the "default:" branch in the switch so we'll
> get a warning there if someone adds a new value without updating it?
Hi Mats, shouldn't this be caught by the MOZ_ASSERT_UNREACHABLE() outside the switch?
Flags: needinfo?(mats)
Comment 6•9 years ago
|
||
An enum class cannot have a value other than defined, so "default:" branch is not needed. And without the "default:", if some one adds a new value without a correspond switch-case added, compiler could output a warning says something like "enumeration value XXX not handled in switch."
Flags: needinfo?(mats)
| Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (UTC+8) from comment #6)
> An enum class cannot have a value other than defined, so "default:" branch
> is not needed. And without the "default:", if some one adds a new value
> without a correspond switch-case added, compiler could output a warning says
> something like "enumeration value XXX not handled in switch."
Sounds great! Mats, TY, thank you for the pointer. :-)
BTW, Mats, since you've already taken a peek at these patches, could you help review them?
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 10•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8797964 [details]
Bug 1307728 - use LineReflowStatusToString to support debugging.
https://reviewboard.mozilla.org/r/83586/#review82464
Attachment #8797964 -
Flags: review?(mats) → review+
Comment 11•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8797965 [details]
Bug 1307728 - convert LineReflowStatus to an enum class.
https://reviewboard.mozilla.org/r/83588/#review82462
::: layout/generic/nsBlockFrame.cpp:3953
(Diff revision 2)
>
> aState.mFlags.mIsLineLayoutEmpty = aLineLayout.LineIsEmpty();
>
> // We only need to backup if the line isn't going to be reflowed again anyway
> bool needsBackup = aLineLayout.NeedsBackup() &&
> - (lineReflowStatus == LINE_REFLOW_STOP || lineReflowStatus == LINE_REFLOW_OK);
> + (lineReflowStatus == LineReflowStatus::Stop || lineReflowStatus == LineReflowStatus::OK);
This line is a tad long, could you wrap it please?
Attachment #8797965 -
Flags: review?(mats) → review+
| Assignee | ||
Comment 12•9 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8797965 [details]
Bug 1307728 - convert LineReflowStatus to an enum class.
https://reviewboard.mozilla.org/r/83588/#review82462
> This line is a tad long, could you wrap it please?
Sure, will do. Thank you for the review.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 15•9 years ago
|
||
Pushed by jichen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dc76dc5df6d9
use LineReflowStatusToString to support debugging. r=mats
https://hg.mozilla.org/integration/autoland/rev/6ffa724dba73
convert LineReflowStatus to an enum class. r=mats
Comment 16•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/dc76dc5df6d9
https://hg.mozilla.org/mozilla-central/rev/6ffa724dba73
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in
before you can comment on or make changes to this bug.
Description
•