[whatwg] prefilling select
Olav Junker Kjær
olav at olav.dk
Mon Aug 2 05:31:41 PDT 2004
A few questions to prefilling select elements (Section 6.1):
I understand that when a selected element with a data attribute is
parsed, the data document should be immediately fetched, and the
select-element is prefilled before the parser continues. This might give
a slight pause in page loading, but it's not different form how script
src elements are loadet. The upside is that it enables us to manipulate
the data in script immediatly after the element, instead of having to
wait for some event to fire.
However:
"If a select element has its data attribute manipulated via the DOM,
then that should immediately begin the prefilling process too. However,
any currently executing script must be guaranteed to run to completion
before the changes required by the process take effect."
So in this case, the data document(s) are loaded asynchronously, and
several data requests might be running at the same time, though the
resulting documents should be processed in the same order they were
initiated.
Why the difference in these two cases? In the second case, we need some
kind of event to notify when all pending requests has been processed, to
trigger form prefilling and the onload event. Why dont use the same
mechanism in the first case then, and have the page load faster?
Another question: isn't it a bit confusing to use a property to load
data into the control, when the effect of loading (may be) cumulative?
Usually attributes setting is idempotent. Maybe it would be more natural
to use a method called loadData(uri) or something like that.
Olav Junker Kjær
More information about the whatwg
mailing list