You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#content { flow-from: myContentFlow } /* NOTE: C and F in myContentFlow are uppercased */
#region { flow-into: myContentFlow }
Internally, the CSS flow name gets lowercased to mycontentflow. If later you execute this Javascript:
var myContentFlow = document.getNamedFlows()["myContentFlow"];
as the key we are looking up is the original and not the lowercased one, lookup fails and myContentFlow gets assigned the undefined value. Usually this reference will get accessed afterwards, causing an exception.
With document.getNamedFlow(...) it gets worse. If you invoke:
var myContentFlow = document.getNamedFlow("myContentFlow");
the parameter to document.getNamedFlow(...) does not get lowercased, with the result that the flow lookup does not succeed, and getNamedFlow(...) returns a new, "empty" flow (why? It's supposed to be a read access). The typical end result is that, without any warnings, the flow looks "dead": events not firing, properties not updating, ... Actually the flow is pretty much alive, it's just that we got a reference to an "artificial" flow instance that will never get updated, instead of a reference to the "good" flow.
document.getNamedFlows().namedItem("myContentFlow")behaves in a similar way to document.getNamedFlow("myContentFlow").
The obvious workaround is to limit flow names to lowercase ones to avoid this problem, but I think this should be addressed: either allow CSS flow names with uppercase characters or uniformly "translate" flow names to the internal form.
The text was updated successfully, but these errors were encountered:
The reason you can get a new empty flow for something that does not exist is that, well, it might actually exist by the time you execute your code, but the polyfill didn't yet find out about it because it runs asynchronously; so to get things running, I remember creating the flow on the fly, and the polyfill will use that flow if it gets created later in the async chain.
Now, I am not sure why flow names get lowercased; it is possible this is an issue with my css parser, or it might be me trying too hard to catch common mistakes. If this is the latter, I should just not do this. If this is the former, I should at the very least make the getNamedFlow() and similar calls convert the name to lowercase.
Supppose you have:
Internally, the CSS flow name gets lowercased to
mycontentflow
. If later you execute this Javascript:var myContentFlow = document.getNamedFlows()["myContentFlow"];
as the key we are looking up is the original and not the lowercased one, lookup fails and myContentFlow gets assigned the
undefined
value. Usually this reference will get accessed afterwards, causing an exception.With
document.getNamedFlow(...)
it gets worse. If you invoke:var myContentFlow = document.getNamedFlow("myContentFlow");
the parameter to
document.getNamedFlow(...)
does not get lowercased, with the result that the flow lookup does not succeed, andgetNamedFlow(...)
returns a new, "empty" flow (why? It's supposed to be a read access). The typical end result is that, without any warnings, the flow looks "dead": events not firing, properties not updating, ... Actually the flow is pretty much alive, it's just that we got a reference to an "artificial" flow instance that will never get updated, instead of a reference to the "good" flow.document.getNamedFlows().namedItem("myContentFlow")
behaves in a similar way todocument.getNamedFlow("myContentFlow")
.The obvious workaround is to limit flow names to lowercase ones to avoid this problem, but I think this should be addressed: either allow CSS flow names with uppercase characters or uniformly "translate" flow names to the internal form.
The text was updated successfully, but these errors were encountered: