This adds the new customElements.getName method which takes a constructor
and returns string if the definition has been registered, otherwise null.
Details
- Reviewers
smaug zcorpan - Commits
- rMOZILLACENTRALb2cfb5ac06ab: Bug 1829335 - Add customElements.getName. r=smaug
- Bugzilla Bug ID
- 1829335
Diff Detail
- Repository
- rMOZILLACENTRAL mozilla-central
- Build Status
Buildable 554150 Build 651495: arc lint + arc unit
Event Timeline
Web platform tests in https://bugzilla.mozilla.org/show_bug.cgi?id=1838986 and https://bugzilla.mozilla.org/show_bug.cgi?id=1837536. I don't know how to link those to this revision.
| dom/base/CustomElementRegistry.cpp | ||
|---|---|---|
| 1200 | I'm sure there's a better way to do this! | |
You'd need to remove the relevant .ini files, or remove at least annotations for the relevant failing subtests.
The .ini file is always basically testfilename.ini.
Looks like the tests are right now in autoland, but not yet in mozilla-central, so could you perhaps wait until those are merged to mozilla-central and then update this patch. I think that would be the easiest thing to do.
autoland -> mozilla-central merge happens rather often and the relevant bug is always updated one the merge has happened.
| dom/base/CustomElementRegistry.cpp | ||
|---|---|---|
| 1200 | You might want to use https://searchfox.org/mozilla-central/rev/3424c000a7ff304b2d1efb8561a924232f7f12fc/dom/bindings/Bindings.conf#35 I know, it should be an annotation in the webidl file itself (that would be just easier for everyone), but it isn't atm. | |
This looks fine, but we're still in the limbo state where it looks like some tests are already in tree https://bugzilla.mozilla.org/show_bug.cgi?id=1837536, but some are not https://bugzilla.mozilla.org/show_bug.cgi?id=1838986
So landing this is a bit tricky, since one needs to modify the relevant .ini files.
testing/web-platform/meta/custom-elements/CustomElementRegistry.html.ini at least need to be changed. That is already in mozilla-central
Looks like it has failures for getName only, so I assume the whole file could be removed.
But https://bugzilla.mozilla.org/show_bug.cgi?id=1838986 hints that the test is moving to a different place...
I'm not familiar enough with mercurial to know what to do here... in git I'd rebase against 3234b709b030 and change the file, or checkout to that commit and apply changes on top on a new branch. I'm struggling to do either here.... 😊
It is just that patches land first to https://hg.mozilla.org/integration/autoland which is then merged to https://hg.mozilla.org/mozilla-central (unless there are some issues with the patch, in which case it is backed out from autoland).
mozilla-central is usually used for development.
At least bug 1837536 has now landed to mozilla-central, so you could tweak testing/web-platform/meta/custom-elements/CustomElementRegistry.html.ini
Since if you run ./mach wpt testing/web-platform/tests/custom-elements/CustomElementRegistry.html
with your patch, you should see some unexpected passes. And you can make those expected by removing the relevant annotations from the .ini.
I guess we don't need to wait for https://bugzilla.mozilla.org/show_bug.cgi?id=1838986 since that isn't even in autoland.
| testing/web-platform/meta/custom-elements/CustomElementRegistry.html.ini | ||
|---|---|---|
| 9 | The whole .ini file can be removed if all the subtests pass. | |
I think this could land, even though it is a bit odd that the spec pr hasn't landed yet.