Closed
Bug 972119
Opened 11 years ago
Closed 11 years ago
Simplify logic in nsCSSFrameConstructor::ConstructDocElementFrame
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(2 files)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
While working on bug 969460, I noticed an opportunity to simplify some logic in nsCSSFrameConstructor::ConstructDocElementFrame.
Filing this bug on doing that.
Assignee | ||
Comment 1•11 years ago
|
||
Here's the patch.
Much-easier-to-read "diff -w" version coming up.
Attachment #8375227 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•11 years ago
|
||
(This is the version you probably want to review.)
So the idea here is to:
(a) Invert the "Tag() == svg" logic, so that an early-return gets moved from "else"-body to "if"-body, which does away with the need for the "else" entirely.
(b) Drop the unnecessary 'docElemIsTable' variable
(c) Flatten "else { if" into "else if" to save on indentation.
Assignee | ||
Comment 3•11 years ago
|
||
and the point of all this is that now this function ends up looking like:
if (style/tag is $FOO) {
set up a particular frame;
} else if (style/tag is $BAR) {
set up a particular frame;
} else if (style/tag is $BAZ) {
[...etc...]
} else {
set up a block;
}
Comment 4•11 years ago
|
||
Comment on attachment 8375227 [details] [diff] [review]
fix v1
r=me. Thank you for the diff -w!
Attachment #8375227 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Thanks for the review!
Try run: https://tbpl.mozilla.org/?tree=Try&rev=bebe01ea1dd6
Assignee | ||
Comment 6•11 years ago
|
||
Flags: in-testsuite-
Comment 7•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•