Hi Frode,
> the newDocument() method takes "forever"
I suspect that it's nearly instantaneous, but that what takes time is
the "Object reference not set to an instance of an object" exception
being thrown almost immediately afterwards: perhaps that's launching a
debugger, trying to load symbols etc.
> the component faults with an "Object reference not set to an instance of an object"
That's interesting.
Look at the definition of your ReadOnly predicate: you're saying that
every element is read-only unless it's a <ol> element.
A new/empty document is like <html><body><p></p></body></html>.
According to the ReadOnly predicate which you installed, all of these
elements are read-only.
The behaviour/effect of this predicate is described at
http://www.modeltext.com/html/apis/html/6d6425a8-2ea4-cad9-9af0-437b5f41af66.htm
When the predicate is true, theen the control tries to move the
insertion cursor until it's outside the read-only section.
With your predicate installed, the whole document is read-only: so the
control keep trying moves the cursor until there's an exception
(moving the cursor beyong the end of the document).
I can add a new line of code to avoid the exception: the control tries
to move the cursor, but stops trying when it reaches the edge of the
document.
If I do that, then the cursor eventually remains positioned inside you
entirely read-only document.
Any attempt to edit the document (e.g. by pressing a key like 'a' or
'b') would then result in a ...
throw new
DomException(DomException.Code.NO_MODIFICATION_ALLOWED_ERR);
... wich may be not what you want either.
What behaviour exactly are you trying to get by using the
setTestIsReadonly functionality?
The use case for which I developed it is when the user being given an
existing document or document template, some elements of which should
be editable and some elements not.
Regards,
Christopher.