Closed Bug 848252 Opened 7 years ago Closed 7 years ago

Replace NS_FRAME_IS_SVG_TEXT checks with IsSVGText()

Categories

(Core :: SVG, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: dholbert, Assigned: longsonr)

References

Details

Attachments

(1 file)

Bug 655877 Part 3 added a state bit "NS_FRAME_IS_SVG_TEXT":
  https://hg.mozilla.org/mozilla-central/rev/7bb6717bc95f#l2.14
and part 7 added a utility method "IsSVGText()" for concisely checking for this bit:
 https://hg.mozilla.org/mozilla-central/rev/b5d5270fbd92

However, we still have a bunch of long-form checks for the bit which could easily be replaced with the short-form version -- e.g. nsHTMLReflowState.cpp has several lines that check "frame->GetStateBits() & NS_FRAME_IS_SVG_TEXT".

These should presumably be replaced with frame->IsSVGText().

This applies to nearly all of the mentions NS_FRAME_IS_SVG_TEXT mentions in our codebase. We've got the helper-function, so we might as well use it. (or drop it if we prefer the long-form check)
Attached patch patchSplinter Review
Assignee: nobody → longsonr
Attachment #721809 - Flags: review?(dholbert)
Comment on attachment 721809 [details] [diff] [review]
patch

> uint8_t
> nsStyleDisplay::GetDisplay(const nsIFrame* aFrame) const
> {
>-  if ((aFrame->GetStateBits() & NS_FRAME_IS_SVG_TEXT) &&
>+  if ((aFrame->IsSVGText()) &&
>       mDisplay != NS_STYLE_DISPLAY_NONE) {

Remove unnecessary parens around (aFrame->IsSVGText()) there.

r=me with that. Thanks!
Attachment #721809 - Flags: review?(dholbert) → review+
https://hg.mozilla.org/mozilla-central/rev/0a80836e1a6b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.