Skip to content

CSS flow name inconsistent lowercasing results in Javascript errors #35

Open
@gpeche

Description

Supppose you have:

#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.

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions