| Summary: | [Conditional=] not working for operations in WebGLRenderingContextBase.idl | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Sergio Villar Senin <svillar> | ||||||
| Component: | Bindings | Assignee: | Sergio Villar Senin <svillar> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | cdumez, darin, eric.carlson, esprehn+autocc, ews-watchlist, jer.noble, kondapallykalyan, webkit-bug-importer, ysuzuki | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Sergio Villar Senin
2020-05-06 13:27:47 PDT
Seems likely the perl script just doesn’t have the support for the multiple layers of conditional. Won’t be super-hard to fix, I don’t think. Maybe you can reproduce with a test case in the bindings tests directory. (In reply to Darin Adler from comment #1) > Seems likely the perl script just doesn’t have the support for the multiple > layers of conditional. Won’t be super-hard to fix, I don’t think. That's what I thought in the beginning but it just works fine with other IDL files as mentioned. Created attachment 398718 [details]
Minimal test case
This pretty reduced test case reproduces exactly what I'm seeing. Using generate-bindings.pl and the supplemental file attached generates JSTestOperationConditional.* files where the conditionalOperation() is guarded by Condition1 instead of Condition2.
The command I used to generate the bindings is:
Source/WebCore/bindings/scripts/generate-bindings.pl --generator JS --outputDir . --idlAttributesFile Source/WebCore/bindings/scripts/IDLAttributes.json --supplementalDependencyFile supplemental Source/WebCore/bindings/scripts/test/TestOperationConditional.idl Source/WebCore/bindings/scripts/test/TestOperationBase.idl
OK I think I found a way to "fix" it. I am not not an expert on bindings generators so I am not sure whether what I am doing is an unsupported configuration, a limitation of the generator or just a bug in the IDL. So if I remove the Conditional in the Base interface then everything works fine. The TestOperationConditional is properly generated. The Condition1 guards all the code (as if it were specified in the base class and Condition2 guards the method that specified its own conditional. Using the same fix for 211506 (i.e. removing Conditional=WEBGL from WebGLRenderingContextBase.idl) makes the build succeed. (In reply to Sergio Villar Senin from comment #5) > OK I think I found a way to "fix" it. I am not not an expert on bindings > generators so I am not sure whether what I am doing is an unsupported > configuration, a limitation of the generator or just a bug in the IDL. > > So if I remove the Conditional in the Base interface then everything works > fine. The TestOperationConditional is properly generated. The Condition1 > guards all the code (as if it were specified in the base class and > Condition2 guards the method that specified its own conditional. > > Using the same fix for 211506 (i.e. removing Conditional=WEBGL from > WebGLRenderingContextBase.idl) makes the build succeed. After checking the WebGL example again I think that Darin is right. The generator is working fine as it's guarding the base class methods with the base class conditional (while the whole file is guarded by the derived interface conditional). The problem is that the generator should also add the operation specific conditional for the operation. Created attachment 398730 [details]
Patch
Committed r261317: <https://trac.webkit.org/changeset/261317> |