In #12353, I added Exposed=(Window,Worker)
to all interfaces, to preserve our previous behaviour. We need to go through all the interfaces, check in the specification what the correct value is, and update our implementation.
components/script/dom/webidls/
.tests/wpt/mozilla/tests/mozilla/interfaces.html
, tests/wpt/mozilla/tests/mozilla/interfaces.worker.js
and probably some others.It would be quite difficult to review a PR that changed all interfaces at once, so please avoid doing that.
Please make a comment here if you intend to work on this issue. Thank you!
Since I started with Worker I might as well go through the whole list. So I'm taking this.
@johannhof if you haven't started on the rest, perhaps it would be better to let others help out wit this, and move on to other bugs where you might learn more :)
Good point! Other people who want to solve this, you can find reference webidls for Firefox here: http://searchfox.org/mozilla-central/source/dom/webidl
Untaking this!
I would like to take this, but I need to make sure I know what's to be done. From what I understand, I need to go through all webidls in components/scripts/dom/webidls
, and expose Window
or Worker
only where it appears in the specification ?
Also, is there any particular way you would like me to split this up so it doesn't go into one PR ?
I would choose an arbitrary number of interfaces that isn't too large like 10. And yes, that is correct.
Hi there, I'd like to help also on this one. I'm still trying to understand exactly what to do but, @ice9js, could you tell which webidl you're going to modify so we don't overlap? (if it's fine we're more than one on this issue at the same time, of course!)
@woshilapin Sure. We can just split it in half alphabetically. I will do everything from Attr.webidl
to HTMLOutputElement.webidl
. Everything from HTMLParagraphElement.webidl
on, I'll leave up to you.
Nice, thanks :-)
Builds are failing, don't loose time on reviewing them, I'm gonna investigate.
Should we keep track of which webidl file has been already reviewed? I'm proposing a list in the following comment (it may be better to have it in the first comment?).
Is the checklist ☝🏼 current? Is there a process with which to claim a part of it and submit PR's?
I think you should be able to claim the ones that start with WebGL.
Thanks, @jdm! Should I check them off to claim them, or when they're done?
Let's check them to claim them.
Can't seem to check them (they're greyed out), but I won't let that hold me up. Consider this notice that I intend to take the WebGL .webidls
Fixed interfaces:
HTMLHeadingElement.webidl
HTMLHRElement.webidl
HTMLHtmlElement.webidl
HTMLHyperlinkElementUtils.webidl
HTMLIFrameElement.webidl
HTMLImageElement.webidl
HTMLInputElement.webidl
HTMLLabelElement.webidl
HTMLLegendElement.webidl
HTMLLIElement.webidl
I unmarked the WebGL interfaces since that work was never performed.
Sorry if that was on me! I went to go do them, and I saw they were all checked! I'll be happy to hop back on that since it wasn't finished.
@scotttrinh Ah, I guess we crossed wires. I checked them to ensure that nobody else tried to do the work at the same time :P Please do!
Looks like everything in WebGL*
was is exposed correctly according to the equivalent Firefox webidl. I couldn't find a reference IDL for WebGLObject
in Firefox's webidl definitions, but I'm assuming it should be exposed to both.
Having said that I just checked the specs at https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl, I didn't see _any_ of the WebGL interfaces exposed, but I'm not sure if that's relevant.
If there's no [Exposed]
, that means the same as [Exposed=Window]
.
@Ms2ger I would assume that the spec should trump Firefox's implementation, but I don't want to assume that. Any guidance? Firefox says everything is available to the Worker
, but the spec has no exposed (therefore [Exposed=Window]
as you mentioned).
Let's keep WebGL limited to Window, at least for now.
Taking CanvasGradient
, CanvasPattern
, CanvasRenderContext2D
, if someone can check those boxes.
Turns out I should take HTMLCanvasElement
! Check the box for that one for me, too.
Once #13747 is finished, I'll take:
Oof. Bluetooth*
seems to be one of those threads that is pulling a bunch of other things into it: Navigator
, Document
, Element
, Comment
, etc. etc. etc.
Should I let someone else handle this or are you guys cool with a big PR that fixes a few dozen things all in one?
Another fix you can do is add an Exposed annotation on the properties that return/accept interfaces that are conditionally exposed (like matchMedia in Window). That may avoid the need for a large PR right now. However, those will need to be done sometime, so I wouldn't mind it happening now.
I'm all for not kicking the can down the road, so I'll scoop up a bunch of interfaces into this PR.
I'll take
@lucasloisp
Those are all on the list of interfaces I would need to remove in the aforementioned "bunch of interfaces", so thanks for taking them. I'll keep an eye out for your PR to be merged and then I'll finish up mine with whatever is left. 🙌🏽
Should be done with it later today if nothing in unexpected comes up. I'll mention you in my PR so you know it's done
@woshilapin If you could update your list it would be great. I just updated a few Interfaces (list above)
@jdm this issue should be reopened. It was closed automatically by bors-servo. Just letting you know, as you reopened it last time
I'm working on XMLHttpRequest.webidl
and I'm running into a syntax error:
WebIDL.WebIDLError: error: invalid syntax, /Users/strinh/projects/servo/components/script/dom/webidls/XMLHttpRequest.webidl line 73:2
[Exposed=Window] readonly attribute Document? responseXML;
^
Anyone know how to correctly annotate this attribute with the Exposed
extended attribute? It's written like that in the spec, and it's commented out in the original just like that...
The WebIDL parser is complaining about multiple independent annotations: [Throws] [Exposed=Window]
. They should be merged into one annotation instead.
I'll take DOM*
.
I just added a PR which fixes Touch
, TouchList
and ValidityState
. Please check them off the list.
AFAICT, WebGL interfaces haven't been taken care of yet.
The WebGL interfaces are taken care of by https://github.com/servo/servo/pull/14376.
I checked the following interfaces, they can be removed from the list:
Location.webidl
MediaError.webidl
MimeTypeArray.webidl
MimeType.webidl
PageTransitionEvent.webidl
PluginArray.webidl
Plugin.webidl
PopStateEvent.webidl
I noticed PerformanceTiming.webidl and Performance.webidl specs have changed. Should those files be updated ?
Updating those other interfaces separately would be useful!
I checked
CSSStyleDeclaration.webidl
ElementCSSInlineStyle.webidl
ElementContentEditable.webidl
EventHandler.webidl
Screen.webidl
StyleSheetList.webidl
StyleSheet.webidl
Client.webidl
I had issues with the following:
WebIDL.WebIDLError: error: Unknown [Exposed] value SharedWorker, /home/tim/dev/servo/components/script/dom/webidls/ProgressEvent.webidl line 17:0
interface ProgressEvent : Event {
error[E0308]: mismatched types
--> /home/tim/dev/servo/target/debug/build/script-2db9432a6e2c7798/out/Bindings/StorageEventBinding.rs:1031:83
|
1031 | let result: Result<Root<StorageEvent>, Error> = StorageEvent::Constructor(&global, arg0, &arg1);
| ^^^^^^^ expected struct `dom::globalscope::GlobalScope`, found struct `dom::bindings::js::Root`
|
= note: expected type `&dom::globalscope::GlobalScope`
found type `&dom::bindings::js::Root<dom::window::Window>`
error: aborting due to previous error
error: Could not compile `script`.
Yeah, BrowserElement.webidl is a Servo-only interface. The error about SharedWorker makes sense since we don't support Shared Workers yet (so it can be left out). The errors in the storage IDLs can be fixed by making StorageEvent::Constructor
take a &Window
argument instead of &GlobalScope
in storageevent.rs.
We've done as much as we can in this issue. I'm filing individual ones for any remaining interfaces.