Open Bug 1503608 Opened Last year Updated 5 months ago

Only pass properties mentioned in specification

Categories

(DevTools :: Framework, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: ochameau, Unassigned)

References

(Blocks 2 open bugs)

Details

There is at least one case, related to DictType, where a property is serialized to RDP even if there is no mention of this property in the spec.

It is related to this code:
https://searchfox.org/mozilla-central/rev/eac6295c397133b7346822ad31867197e30d7e94/devtools/shared/protocol.js#277-279
        if (prop in specTypes) {
          ret[prop] = specTypes[prop].write(v[prop], ctx);
        } else {
          ret[prop] = v[prop];
        }
The else branch let pass any property that isn't in the spec.

It is very confusing to have things being transferred via the RDP that aren't mentioned in any spec. We should try to remove this and always explicitly mention all properties. But I wouldn't be surprise if various code currently depend on such behavior...
Try is very orange. A couple of properties are visible: pseudoElement, primitive and appliedstyle.
It is not clear if that is just it or if many other are hidden in this orange tree!
Whiteboard: dt-fission

The goal is to apply the following patch:
https://hg.mozilla.org/try/rev/f4d16ebd1493bd173833c94db2e69967574ae080
Push to try and fix all the failure by:

  • identifying which request fails on which actor.
  • fix the actor specification file in order to type the unmentioned attributes.

For example:
Error while calling actor 'pagestyle's method 'getApplied'" "Trying to pass 'pseudoElement' property in DicType 'appliedstyle' without any definition in the specification"
means that:
getApplied request of pagestyle actor, returned a dictionnary whose type is called appliedstyle and the actor implementation pass a pseudoElement attribute that isn't mentioned in the specification.

The specification of appliedstyle is here:
https://searchfox.org/mozilla-central/source/devtools/shared/specs/styles.js#32-36
And miss the specification of the pseudoElement attribute, which is returned over here:
https://searchfox.org/mozilla-central/source/devtools/server/actors/styles.js#736-741

Whiteboard: dt-fission → dt-fission, dt-fission-framework
Whiteboard: dt-fission, dt-fission-framework → dt-fission
No longer blocks: dt-fission-framework
Whiteboard: dt-fission
You need to log in before you can comment on or make changes to this bug.