Closed Bug 1339546 Opened 3 years ago Closed 3 years ago

Make layout/style/*.cpp include corresponding .h file as the first header

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(2 files)

We have a convention that Foo.cpp should list Foo.h as its very-first #include.  

(This helps us ensure that Foo.h has all of the requisite #includes/forward-declarations to build successfully on its own.  At least when building in non-unified mode, this gives us that assurance, for all headers that have a corresponding .cpp file.)

I noticed that a number of our .cpp files in layout/style do not match this convention. Filing this bug on fixing that.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Part 1 is a helper-patch, to fix preexisting non-unified-build bustage (to provide the mozilla namespace for a reference to "StyleBackendType::Gecko" further down).

With that fixed, I can build with this directory in non-unified mode -- and I can confirm that my "part 2" doesn't break that build configuration, which indicates that all the headers in question are indeed #including/declaring all the requisite stuff. (which surprised me a bit! :) )
(There's clearly further cleanup/reshuffling that could be done to the #include lists in these files, but I'm not going to bother with that at this point -- I'm just focusing on this one narrow thing.)
Comment on attachment 8837275 [details]
Bug 1339546 part 1: Add "using namespace mozilla" decl in nsRuleData.cpp, to fix build bustage for non-unified builds.

https://reviewboard.mozilla.org/r/112444/#review113964
Attachment #8837275 - Flags: review?(xidorn+moz) → review+
Comment on attachment 8837276 [details]
Bug 1339546 part 2: Make layout/style/*.cpp include corresponding .h file as the first header.

https://reviewboard.mozilla.org/r/112446/#review113966
Attachment #8837276 - Flags: review?(xidorn+moz) → review+
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/78bc75996acd
part 1: Add "using namespace mozilla" decl in nsRuleData.cpp, to fix build bustage for non-unified builds. r=xidorn
https://hg.mozilla.org/integration/autoland/rev/ba2907a40e09
part 2: Make layout/style/*.cpp include corresponding .h file as the first header. r=xidorn
Thanks!
https://hg.mozilla.org/mozilla-central/rev/78bc75996acd
https://hg.mozilla.org/mozilla-central/rev/ba2907a40e09
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.