Some bindings are using dom StaticPrefs but not including the corresponding header
Categories
(Core :: DOM: Bindings (WebIDL), defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: gsvelto, Assigned: edgar)
Details
Attachments
(1 file)
While investigating a b2g/KaiOS build failure I noticed that some of the bindings we generate call StaticPrefs::dom_missing_prop_counters_enabled()
without including StaticPrefs_dom.h
.
This applies to m-c too, see this call:
https://searchfox.org/mozilla-central/source/__GENERATED__/dom/bindings/ImageDocumentBinding.cpp#453
And these are the headers:
That code is being generated from here:
I'm not super-familiar with this code so I'll need a little help here. Boris, should we always add StaticPrefs_dom.h
to the list of headers we include in the binding when needsMissingPropUseCounters
is set in the descriptor? Or should this apply only to the bindings for which missingPropUseCountersForDescriptor
gets called?
Note that this isn't causing compilation issues on m-c at the moment because of unified builds.
Comment 1•5 years ago
|
||
Perhaps peterv has an opinion here.
![]() |
||
Comment 2•5 years ago
•
|
||
The code at https://searchfox.org/mozilla-central/rev/de782976bf97669f1e8edee59e7a2398154efe06/dom/bindings/Codegen.py#18232-18236 should be generating the right include. Presumably it's failing in this case because the instrumented prop is on HTMLDocument
, which ImageDocument
inherits from.
Changing that logic accordingly, probably to set descriptorsHaveInstrumentedProps
to true if there's descriptor with instrumented props anywhere on its ancestor chain, should help.
![]() |
||
Comment 3•5 years ago
|
||
And specifically, descriptorsHaveInstrumentedProps
should probably be set based on needsMissingPropUseCounters
, not based on d.instrumentedProps
, if I recall correctly how this works. And should likely be renamed accordingly to descriptorsNeedMissingPropUseCounters
. Which would also make it clear that the current condition for UseCounter.h
is wrong too...
Comment 4•5 years ago
|
||
Gabriele, in the meantime I landed a workaround: https://github.com/kaiostech/gecko-b2g/commit/8dc30447fcbbc1ea6917a511f58fec70a7e89075
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
![]() |
||
Comment 6•5 years ago
|
||
Doesn't the UseCounter.h
condition need adjusting too? That is should descriptorsHaveInstrumentedProps
go away completely?
Assignee | ||
Comment 7•5 years ago
|
||
For the case that the instrumented prop is from the ancestor, it only uses StaticPref and calls the ancestor's CountMaybeMissingProperty, so we don't need to include UseCounter.h in that case.
Comment 9•5 years ago
|
||
bugherder |
Description
•