Closed Bug 509956 Opened 15 years ago Closed 15 years ago
Bogus code in ns
Text Frame::Is Floating First Letter Child
This part of nsTextFrame:IsFloatingFirstLetterChild: if (!GetStateBits() & TEXT_FIRST_LETTER) return PR_FALSE; does absolutely nothing, since ! has higher precedence than &. Therefore we're doing either 0 & TEXT_FIRST_LETTER or 1 & TEXT_FIRST_LETTER, both of which are 0. I assume the compiler just optimizes this whole block away. If this block is needed for performance reasons, we need to fix the parentheses. If it's not needed, it should be removed so as to not confuse people. Note that this was pointed out almost a year ago in bug 426772 comment 55.
Status: NEW → ASSIGNED
Sorry, I missed to check the neil's comment and thank you Boris, you reported this bug.
Comment on attachment 394508 [details] [diff] [review] Patch v1.0 r=dbaron. (sr is not needed)
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
I'm not sure this patch should be also landed to 1.9.2 branch. The IsFloatingFirstLetterChild is called from nsTextFrame::Reflow. So, that is called many times. But I'm not sure the impact for the performance.
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.