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

[cssom][css-images] CSS.elementSources incompatible with CSS being an IDL namespace #428

Closed
zcorpan opened this issue Aug 25, 2016 · 4 comments · Fixed by #3572
Closed
Assignees
Labels

Comments

@zcorpan
Copy link
Member

zcorpan commented Aug 25, 2016

From https://www.w3.org/Bugs/Public/show_bug.cgi?id=29623

https://drafts.csswg.org/css-images-4/#elementsources

reads

partial interface CSS {
  [SameObject] readonly attribute Map elementSources;
};

If we switch CSS over to be IDL namespace instead of interface, it can only use operations, not attributes, as far as I can tell.

elementSources is not implemented anywhere, is it? Should we change it to an operation when switching to IDL namespace? Or should namespaces be able to use attributes in Web IDL?

@nox
Copy link
Contributor

nox commented Aug 26, 2016

AFAICT that specification is wrong anyway, because it's an attribute so CSS should be instantiated first, but then the code snippet said:

CSS.elementSources.set('fancy', bg);

Which clearly is trying to use elementSources has a static attribute.

@zcorpan
Copy link
Member Author

zcorpan commented Aug 26, 2016

Yep, indeed.

On a related note document.cssElementMap was removed from HTML in whatwg/html#258 (due to lack of implementations for years).

@bzbarsky
Copy link

The use of Map here is a concern as well. It causes some implementation issues and couples layout to scripting in ways that are not necessarily desirable. A maplike would make a lot more sense.

Anyway, we could add attribute support to namespaces. We just didn't have any use cases so far, and it's hard to design in a vacuum....

zcorpan added a commit to zcorpan/csswg-drafts that referenced this issue Sep 2, 2016
Web IDL added support for namespaces in
whatwg/webidl#121

elementSources in css-images-4 is commented out for now because
IDL namespaces don't support attributes yet, see w3c#428.

Fixes part of https://www.w3.org/Bugs/Public/show_bug.cgi?id=29623
@tabatkins
Copy link
Member

Yeah, that spec version is way out of date and needs to get some stuff dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants