Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[resize-observer] the spec text on explanatory "ResizeObservation" interface (not intended as a real interface) gets picked up by Reffy tool and baked into WPT tests #3839

Open
dholbert opened this issue Apr 17, 2019 · 7 comments

Comments

@dholbert
Copy link
Member

dholbert commented Apr 17, 2019

https://wpt.fyi/results/resize-observer/idlharness.window.html shows a bunch of cross-browser test failures for the ResizeObservation interface, which come from chunk of IDL:

https://github.com/web-platform-tests/wpt/blob/a8d97c0c7c58cdc2def51573e30c2cad92923d75/interfaces/resize-observer.idl#L39-L43

interface ResizeObservation {
    readonly attribute Element target;
    readonly attribute ResizeObserverBoxOptions observedBox;
    readonly attribute ResizeObserverSize lastReportedSize;
};

This interface is mentioned in the spec, but it's clearly labeled as an "example" which is not supposed to be exposed to JS:

§ 3.1. ResizeObservation example struct
This section is not normative. ResizeObservation is an example struct that can be used in implementation of Resize Observer. It is being included here in order to help provide clarity during the processing model. It effectively holds observation information for a single Element. This interface is not visible to Javascript.
[...]
interface ResizeObservation {

https://drafts.csswg.org/resize-observer/#resize-observation-interface

Unfortunately, the WPT interfaces/resize-observer.idl file is autogenerated, so we can't just edit it to remove this example interface. It'll just come back whenever the file gets regenerated, presumably. So I think we need to edit the spec to make it clearer (to the Reffy tool) that this interface is non-normative and not something that should be tested. (And really, someone should probably add a WPT test to validate that the interface does not exist, since it's not supposed to.)

@dholbert dholbert changed the title [resize-observer] the example "ResizeObservation" [resize-observer] the spec text on explanatory "ResizeObservation" interface (not intended as a real interface) gets picked up by Reffy tool and baked into WPT tests Apr 17, 2019
@dholbert
Copy link
Member Author

dholbert commented May 16, 2019

Also, worth stating for the record -- both Chrome 76 and Firefox Nightly 68 correctly "fail" all of the ResizeObservation subtests right now, as shown on wpt.fyi. (only mentioning those two because other engines don't implement ResizeObserver at all.)

So, all implementations are correct here, and we just need a spec-fix (which will then implicitly fix the test, since the test is generated by the spec).

@gregwhitworth
Copy link
Contributor

@dholbert I asked on the testing IRC channel, but I'll ask here too. I have no knowledge of the Reffy tool, so how do I change the spec to make it so that it isn't using this example IDL as actual IDL?

@dholbert
Copy link
Member Author

I'm afraid I have no knowledge of the Reffy tool either. (I only figured out that it was involved via following the trail of clues to figure out where the test data was coming from.)

@bkardell
Copy link
Contributor

(only mentioning those two because other engines don't implement ResizeObserver at all.)

ResizeObserver is in the latest webkit tech previews too

@gregwhitworth
Copy link
Contributor

ok calling in the big guns - @gsnedders any ideas?

@gsnedders
Copy link
Contributor

I can only suggest posting an issue on the Reffy repo or just asking @tidoust.

@tidoust
Copy link
Member

tidoust commented May 21, 2019

Reffy extracts the IDL index at the end of the spec. That index contains ResizeObservation, so Reffy picks it up as well. To drop the interface from the index, you have to tell Bikeshed not to process it, which can be done by adding a class="extract" to the IDL block definition (see Turning off processing).

By the way, I do not know what you're trying to achieve here with ResizeObservation, but I note that the definition of observe currently normatively references ResizeObservation, which seems wrong to me (a spec should not normatively reference something that is defined informatively).

dlibby- pushed a commit that referenced this issue Mar 27, 2020
Fix invalid WebIDL by changing sequence to FrozenArray for lastReportedSizes in the ResizeObservation interface. Currently there are still normative references to this non-normative interface, discussed in #3839. These will be addressed in a follow-up.
JTensai pushed a commit to JTensai/csswg-drafts that referenced this issue May 13, 2020
Fix invalid WebIDL by changing sequence to FrozenArray for lastReportedSizes in the ResizeObservation interface. Currently there are still normative references to this non-normative interface, discussed in w3c#3839. These will be addressed in a follow-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants