Bug 151431

Summary: Add WebCore namespace for generated bindings for supplemental method calls
Product: WebKit Reporter: Nikos Andronikos <nikos.andronikos>
Component: Tools / TestsAssignee: Nikos Andronikos <nikos.andronikos>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, cgarcia, commit-queue, lforschler
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Nikos Andronikos 2015-11-18 21:33:51 PST
This patch adds "WebCore::" to supplemental method calls for bindings code generated for JS and Objective-C.
This will solve a build failure we have observed while trying to add a partial interface Document binding for the Web Animation API implementation.
Comment 1 Nikos Andronikos 2015-11-18 21:47:52 PST
Created attachment 265845 [details]
Patch
Comment 2 Alex Christensen 2015-11-18 23:27:38 PST
What is the build failure?  What does the generated code look like?  Is it calling WebCore namespace code from a namespace inside WebCore?  I would believe this change is necessary, but I'd like a little more info.
Comment 3 Darin Adler 2015-11-19 08:50:31 PST
Comment on attachment 265845 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=265845&action=review

> Source/WebCore/ChangeLog:3
> +        Add WebCore namespace for generated bindings for supplemental method calls

Why?
Comment 4 Nikos Andronikos 2015-11-22 16:38:24 PST
(In reply to comment #2)
> What is the build failure?  What does the generated code look like?  Is it
> calling WebCore namespace code from a namespace inside WebCore?  I would
> believe this change is necessary, but I'd like a little more info.

The build failure is that the namespace “WebCore::” is missing before the class name.  A little background of what I am implementing:

I am implementing a partial interface extension to the “Document” interface using "Supplement" (see “Supplementable.h”).

The generated code is output into DOMDocument.mm and looks like this:
  
- (DOMDocumentTimeline *)timeline
 {
     WebCore::JSMainThreadNullState state;
     return kit(WTF::getPtr(DocumentAnimation::timeline(IMPL)));
}
  
The compiler complains that “DocumentAnimation” cannot be resolved, because “WebCore::” is missing.  My fix corrects this by adding the namespace to “DocumentAnimation”.
  
Note: It looks to me like the lack of the WebCore namespace specifier was an oversight by the author of the supplemental interface changes. He seems to have corrected that oversight for GObject (see: https://bugs.webkit.org/show_bug.cgi?id=79293), but not here. I presume no code has been generated that has hit this before.
Comment 5 Nikos Andronikos 2015-11-22 16:49:14 PST
Created attachment 266073 [details]
Patch
Comment 6 Nikos Andronikos 2015-11-22 16:50:13 PST
(In reply to comment #3)
> Comment on attachment 265845 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=265845&action=review
> 
> > Source/WebCore/ChangeLog:3
> > +        Add WebCore namespace for generated bindings for supplemental method calls
> 
> Why?

See updated patch
Comment 7 WebKit Commit Bot 2015-11-23 11:57:35 PST
Comment on attachment 266073 [details]
Patch

Clearing flags on attachment: 266073

Committed r192750: <http://trac.webkit.org/changeset/192750>
Comment 8 WebKit Commit Bot 2015-11-23 11:57:39 PST
All reviewed patches have been landed.  Closing bug.