Replace NS_FRAME_IS_SVG_TEXT checks with IsSVGText()

RESOLVED FIXED in mozilla22

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: longsonr)

Tracking

Trunk
mozilla22
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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)
(Assignee)

Comment 1

6 years ago
Created attachment 721809 [details] [diff] [review]
patch
Assignee: nobody → longsonr
Attachment #721809 - Flags: review?(dholbert)
(Reporter)

Comment 2

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.