Re: Link traversal failure with <load/>

Yes, I understand that if you actually activate the link, and then there's  
a 404, and you replace the context, there's nothing we can do. But there  
are other cases.

For instance, if I look at the event log in XSLTForms for a load that is  
failing for me, I see:

0 -> Dispatching event DOMActivate on <SPAN class="testCaseName Value  
xforms-control xforms-trigger xforms-appearance-minimal xforms-focus"  
id="clonedId1397"/>
2 -> effectiveTarget:true
3 -> Captured event DOMActivate on <SPAN class="testCaseName Value  
xforms-control xforms-trigger xforms-appearance-minimal xforms-focus"  
id="clonedId1397"/>
4 -> Load Chapt07/7.12/7.12.a.xhtml
119 -> Cannot convert 'targetelt' to object
10 -> ERROR: Cannot dispatch event as the target is null

I haven't worked out what is happening yet, but it seems to me that in  
this sort of case something like an xforms-link-error would be in order  
(https://www.w3.org/community/xformsusers/wiki/XForms_2.0#evt-linkError),  
though something that was just a notification, not an error.

Something like:

"If traversal fails, an xforms-load-error should be dispatched, though  
this may not be possible if the error is discovered after traversal.
Otherwise, processing of the resource reached by traversing the link  
depends on the obtained context: ..."

It's also worth noting that with a target="_blank" on the load, XForms  
processing still continues in the original context, so there is code  
remaining that could check even in that case.

Steven


On Tue, 31 Oct 2017 17:08:48 +0100, Erik Bruchez <ebruchez@orbeon.com>  
wrote:

> It depends on how browsers do it. In this fairly old SO question [1],  
> somebody says:
>
>> Not really possible, because when window.location = someURL is  
>> executed, before the URL is even tested, your document is removed from  
>> the window. You have no code remaining >that could test if it worked.
>> If the link is on the same origin, you may issue an XMLHttpRequest to  
>> test if the page is reachable but there doesn't seem to be a way to  
>> test if a page isn't requestable >just due to cross origin request or  
>> because the URL is wrong.
>> For a general document, I don't know any way to test if a foreign  
>> origin page is reachable (but it can be done for an image using the  
>> onload event handler).
>
> If it is indeed true that in the case of an external, not same-origin  
> URL the document is unloaded before the error is known, then there will  
> be at least some situations where >nothing can be done. In some other  
> cases, like navigation within the same app or when accessing same-origin  
> documents, then more could be done.
>
> -Erik
>
> [1]  
> https://stackoverflow.com/questions/18404148/how-do-i-detect-if-window-location-failed
>
> On Tue, Oct 31, 2017 at 7:28 AM, Steven Pemberton  
> <steven.pemberton@cwi.nl> wrote:
>> "The link indicated by the URI is traversed. If traversal fails, then  
>> an implementation-specific means of conveying the link traversal  
>> failure occurs."
>>
>> https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_load_Element
>>
>> We may have discussed this before, but I've just hit it.
>>
>> Is there really nothing better that we can do than this?
>>
>> Clicking on a 'link' just does nothing. It would be really nice to have  
>> something like xforms-submit-error that at least tells you what's  
>> wrong...
>>
>> Steven

Received on Wednesday, 1 November 2017 10:38:08 UTC