This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6855 - OBJECTS_OR_SCRIPT-2 FAIL may be overriden by OBJECTS_OR_SCRIPT-3 WARN
Summary: OBJECTS_OR_SCRIPT-2 FAIL may be overriden by OBJECTS_OR_SCRIPT-3 WARN
Status: RESOLVED FIXED
Alias: None
Product: mobileOK Basic checker
Classification: Unclassified
Component: Java Library (show other bugs)
Version: unspecified
Hardware: Other All
: P2 normal
Target Milestone: ---
Assignee: fd
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-30 16:15 UTC by fd
Modified: 2009-05-04 11:28 UTC (History)
0 users

See Also:


Attachments

Description fd 2009-04-30 16:15:41 UTC
When an anchor contains both an href with a Javascript URI and an event attribute, the OBJECTS_OR_SCRIPT-3 WARN on the event attribute is triggered, but not the OBJECTS_OR_SCRIPT-3 FAIL on the javascript link.

Ex:
 <a href="javascript:test()" onmouseout="mouseOut();">link</a>

I added a test in the test suite to track the bug:
 ObjectsOrScriptTest/6/index.xhtml

The error occurs because two XSLT templates match the link, which creates an ambiguous rule match that gets silently recovered by Saxon. Saxon basically chooses one of the templates, and not the one we want in our case, since there should be a FAIL, and only a WARN is retrieved!

The error is signaled by Saxon as:
[[[
Error 
  XTRE0540: Ambiguous rule match for
  /moki/primaryDoc[1]/XHTMLDocInfo[1]/docContent[1]/html[1]/body[1]/div[2]/div[3]/div[1]/div[2]/div[1]/span[1]/a[2]
Matches both "html:a[starts-with(lower-case(@href),'javascript:')]" on line 71 of mobileok-ref/build/org/w3c/mwi/mobileok/basic/xslt/ObjectsOrScriptTest.xsl
and "html:*[@onload or @onunload or @onclick or @ondblclick or @onmousedown or @onmouseup or @onmouseover or @onmousemove or @onmouseout or @onfocus or @onblur or @onkeypress or @onkeydown or @onkeyup or @onsubmit or @onreset or @onselect or @onchange]" on line 189 of mobileok-ref/build/org/w3c/mwi/mobileok/basic/xslt/ObjectsOrScriptTest.xsl
]]]
Comment 1 fd 2009-05-04 11:28:04 UTC
I removed the ambiguity in the template rules in:
 ObjectOrScriptsTest.xsl
 StyleSheetsUseTest.xsl

The solution I used was to define a named template, e.g. checkStyleAttribute that gets called explicitly whenever an html:[foo] element gets processed.