Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

nsIFrame::StyleContext() or nsIFrame::Style() ?

10 views
Skip to first unread message

L. David Baron

unread,
Feb 15, 2013, 12:59:18 AM2/15/13
to dev-tec...@lists.mozilla.org
So I was just using sed to write a (long-overdue) patch to rename
nsIFrame::GetStyleContext to nsIFrame::StyleContext to follow our
convention that getters that can't return null don't have "Get" in
the name.

While I was doing that, it occurred to me that perhaps, instead of
nsIFrame::StyleContext(), it should just be nsIFrame::Style().

Thoughts?

-David

--
𝄞 L. David Baron http://dbaron.org/ 𝄂
𝄢 Mozilla http://www.mozilla.org/ 𝄂

Robert O'Callahan

unread,
Feb 15, 2013, 3:11:01 AM2/15/13
to L. David Baron, dev-tec...@lists.mozilla.org
On Fri, Feb 15, 2013 at 6:59 PM, L. David Baron <dba...@dbaron.org> wrote:

> So I was just using sed to write a (long-overdue) patch to rename
> nsIFrame::GetStyleContext to nsIFrame::StyleContext to follow our
> convention that getters that can't return null don't have "Get" in
> the name.
>
> While I was doing that, it occurred to me that perhaps, instead of
> nsIFrame::StyleContext(), it should just be nsIFrame::Style().
>

They sound about the same level of goodness to me.

Are you going to rename GetStyleBackground as well? To StyleBackground() or
BackgroundStyle()?

Rob
--
Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur
Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl
bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat
lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir
— whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb
tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]

L. David Baron

unread,
Feb 15, 2013, 12:17:15 PM2/15/13
to Robert O'Callahan, dev-tec...@lists.mozilla.org
On Friday 2013-02-15 21:11 +1300, Robert O'Callahan wrote:
> On Fri, Feb 15, 2013 at 6:59 PM, L. David Baron <dba...@dbaron.org> wrote:
>
> > So I was just using sed to write a (long-overdue) patch to rename
> > nsIFrame::GetStyleContext to nsIFrame::StyleContext to follow our
> > convention that getters that can't return null don't have "Get" in
> > the name.
> >
> > While I was doing that, it occurred to me that perhaps, instead of
> > nsIFrame::StyleContext(), it should just be nsIFrame::Style().
> >
>
> They sound about the same level of goodness to me.

I'll probably stick with StyleContext(), since I already have the
patch to do that, and it's more familiar to people.

> Are you going to rename GetStyleBackground as well?

That's the plan, but maybe not right now; it's probably a rather
larger patch.

> To StyleBackground() or BackgroundStyle()?

I hadn't thought about it yet, but probably just dropping the "Get"
is simpler both in terms of function/type correspondence and
people's existing expectations.
0 new messages