Fix up includes in layout/style

RESOLVED FIXED in mozilla22

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dzbarsky, Assigned: dzbarsky)

Tracking

unspecified
mozilla22
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Created attachment 720337 [details] [diff] [review]
Patch
Attachment #720337 - Flags: review?(dbaron)
(Assignee)

Comment 1

5 years ago
Created attachment 720338 [details] [diff] [review]
Patch
Attachment #720337 - Attachment is obsolete: true
Attachment #720337 - Flags: review?(dbaron)
Attachment #720338 - Flags: review?(dbaron)
Could you explain what led you to make this set of changes?  (Was the goal to reduce a particular set of #includes?  What set?)
(Assignee)

Comment 3

5 years ago
I remembered having to rebuild seemingly random parts of the tree when changing code under layout/style so I figured if less headers include each other it would make rebuilding easier.  This patch is the output of running include-what-you-use, which I fixed up.
So the pattern of using:
  class Foo;
  friend class Foo;
  class Foo {
     ...
  };
for nested classes is needed in C++98 (where nested classes don't automatically have access to private/protected members of their outer class) but not in C++11.  I'd prefer to leave all of those rather than removing them; some ports might still be depending on those.
Comment on attachment 720338 [details] [diff] [review]
Patch

>diff --git a/layout/style/nsCSSValue.h b/layout/style/nsCSSValue.h
>--- a/layout/style/nsCSSValue.h
>+++ b/layout/style/nsCSSValue.h
>@@ -23,18 +23,16 @@
> #include "nsStyleConsts.h"
> #include "mozilla/FloatingPoint.h"
> 
> class imgRequestProxy;
> class nsIDocument;
> class nsIPrincipal;
> class nsPresContext;
> class nsIURI;
>-template <class T>
>-class nsPtrHashKey;

Seems like you ought to leave this as well.

(also see previous comment)

Otherwise the patch looks fine.


So r=dbaron with those parts left.  (Note that there are quite a few nested classes where you removed the friend declarations and the declarations needed before the friend declarations.)
Attachment #720338 - Flags: review?(dbaron) → review+
(Assignee)

Comment 6

5 years ago
Landed with all the friend declarations put back.
https://hg.mozilla.org/integration/mozilla-inbound/rev/d3c43fa2f2ae
https://hg.mozilla.org/mozilla-central/rev/d3c43fa2f2ae
https://hg.mozilla.org/mozilla-central/rev/82d62fac2ac6
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.