RESOLVED FIXED 57239
Use forward class declaration instead of including header
https://bugs.webkit.org/show_bug.cgi?id=57239
Summary Use forward class declaration instead of including header
David Kilzer (:ddkilzer)
Reported 2011-03-28 09:26:43 PDT
Created attachment 87153 [details] Patch Reviewed by NOBODY (OOPS!). Adding a "using namespace WebCore;" statement in a header may cause issues when <WebCore/Length.h> is included before <CoreText/CoreText.h>. Length.h defines the LengthType enum with a 'Fixed' value. CoreText.h includes MacTypes.h, which has a "typedef SInt32 Fixed;" statement, and then CoreText.h includes other headers that also use 'Fixed', but expect the typedef to be defined, not the enum. If another header includes "using namespace WebCore;" before CoreText.h, the following compiler errors result (paths abbreviated): CoreText.framework/Headers/SFNTLayoutTypes.h:689: error: reference to 'Fixed' is ambiguous MacTypes.h:184: error: candidates are: typedef SInt32 Fixed Length.h:37: error: WebCore::LengthType WebCore::Fixed SFNTLayoutTypes.h:689: error: 'Fixed' does not name a type * platform/mac/HTMLConverter.h: Use forward declaration of DocumentLoader class instead of including header. Remove the unused "using namespace WebCore;" statement. --- 2 files changed, 31 insertions(+), 3 deletions(-)
Attachments
Patch (2.55 KB, patch)
2011-03-28 09:26 PDT, David Kilzer (:ddkilzer)
mitz: review+
WebKit Review Bot
Comment 1 2011-03-28 09:29:46 PDT
Attachment 87153 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 2 2011-03-28 09:42:04 PDT
I filed Bug 57241 about check-webkit-style flagging "using namespace Foo;" statements in headers.
David Kilzer (:ddkilzer)
Comment 3 2011-03-28 09:42:26 PDT
David Kilzer (:ddkilzer)
Comment 4 2011-03-28 09:55:36 PDT
(In reply to comment #1) > Attachment 87153 [details] did not pass style-queue: > > Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 > > Source/WebCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] > Total errors found: 1 in 2 files > > If any of these errors are false positives, please file a bug against check-webkit-style. I want webkit-patch to support a placeholder for the bug number. I filed: Bug 57242.
David Kilzer (:ddkilzer)
Comment 5 2011-03-28 10:08:27 PDT
WebKit Review Bot
Comment 6 2011-03-28 10:41:47 PDT
http://trac.webkit.org/changeset/82128 might have broken Leopard Intel Debug (Tests)
Note You need to log in before you can comment on or make changes to this bug.