Closed Bug 507695 Opened 16 years ago Closed 16 years ago

Remove unneeded #includes from nsStyleContext.cpp

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

References

()

Details

Attachments

(1 file)

Attached patch patch v1Splinter Review
In glancing over nsStyleContext.cpp, I noticed it #includes "prenv.h", which it doesn't actually need. Turns out this dates back to 2000, when a commit added a call to "PR_GetEnv": http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/layout/style&command=DIFF_FRAMESET&file=nsStyleContext.cpp&rev2=3.144&rev1=3.143 But that call has since been removed, so this header isn't needed anymore. The attached patch removes the #include for prenv.h, and for three other headers that don't seem to be needed (imgIRequest.h, nsCRT.h, nsPrintfCString.h).
(In reply to comment #0) Here's some archaeology on why the other removed headers were originally needed & aren't needed anymore. > imgIRequest.h This header was added with a method "URICString(imgIRequest* aImageRequest)". That method still remains on 1.9.0: http://mxr.mozilla.org/mozilla/source/layout/style/nsStyleContext.cpp?mark=526#526 but it's gone in mozilla-central, so we no longer need imgIRequest.h. > nsCRT.h This header has been there since the very first checked-in version of nsStyleContext.cpp, apparently due to an initial use of the method "nsCRT::zero(rv, sz)". However, that call is long gone, so we don't seem to need the header anymore. > nsPrintfCString.h "nsPrintfCString" was originally used in a method called DumpRegressionData, which is still there on the 1.9.0 branch: http://mxr.mozilla.org/mozilla/source/layout/style/nsStyleContext.cpp?mark=654#654 but it's gone on mozilla-central, so we don't need that header anymore.
(Just pushed this to the try-server as a sanity check, to make sure these headers aren't required for building on another platform for some obscure reason. Assuming that passes, I'll request review)
Comment on attachment 391936 [details] [diff] [review] patch v1 try-server likes it! Successful builds on Linux, Mac, Windows, WinMo, & Maemo. https://build.mozilla.org/tryserver-builds/dholbert@mozilla.com-try-97251e8b313e/ Requesting review.
Attachment #391936 - Flags: review?(dbaron)
Comment on attachment 391936 [details] [diff] [review] patch v1 r=dbaron
Attachment #391936 - Flags: review?(dbaron) → review+
Thanks! Tree's closed; I'll land once it's re-opened & green.
Whiteboard: [needs landing]
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: