crosswordplayer FIXMEs

crosswordplayer FIXMEs  (was "Re: SVG crosswordplayer first release!!")
Renamed thread in order not to confuse the ongoing  interesting  
discussion.

Thanks for all of the help! Specifically for detailed emails from  
Tobias Reif and Thomas DeWeese, quoted below. And especially to Jim Ley  
and #svg.

L.

On Dec 1, 2003, at 2:38 PM, Tobias Reif wrote:
> 1. Batik Squiggle says that the CSS has an error:
[...]
> 2. The SVG itself is invalid too:
[...]
> If you don't want to install validators locally you can surf to
> http://www.pinkjuice.com/check/? 
> url=http%3A%2F%2Fwww.koonts.com%2Fcrossword%2Fcrossword.svg
>
I use xmllint, er much more frequently now. Validators are helpful in  
spellchecker capacity, reguardless of other discussions. :).

xmllint keeps giving a warning about style, not sure if it matters, the  
latest one is:
	Entity: line 1: validity warning: Attribute space of element style:  
already defined
		 %SVG.Core.attrib;
                                                                          
        ^
> crossword.svg:1168: element rect: validity error : ID handler already  
> defined
> /tspan></text><rect id="handler" x="0" y="0" width="30" height="1.5"  
> opacity="0"
  CSS & Batik Squiggle :
In Batik Squiggle, ids which are used in both CSS and SVG must be  
unique in the SVG. This is much more strict than the ASV viewer, but  
seems reasonable and correct to me. However, it does seem that CSS has  
.bla and  SVG has <rect id="bla" class="bla"> should not generate an  
error.


> crossword.svg:8: element svg: validity error : No declaration for  
> attribute onkeyup of element svg
>     xmlns:xlink="http://www.w3.org/1999/xlink">

After much testing, the following seems to work in both ASV & Batik:
<script type="text/ecmascript"> <![CDATA[
[...]
var svgDoc
var svgRoot

function handle_onload(evt) {
     svgDoc  = evt.target.ownerDocument
     svgRoot = svgDoc.documentElement

     svgRoot.addEventListener('click',handle_click,false)
     svgRoot.addEventListener('keydown',handle_key,false)
[...]
}

function handle_key(evt) {
     try {
         if (!evt) { var evt = window.event }

         var code = evt.keyCode ? evt.keyCode :
             evt.which ? evt.which : void 0
[...]
}

keyup events are preferable, as they only register once per key, but  
they do not work on Batik at all.
keypress events do not include DELETE, TAB, Left Arrow ...



I am happy to be able to have the functionality now. This kind of  
temporary work around in new things is common. I will be thrilled to  
replace this "it works now" key handling with proper will work  
everywhere in the spec key handling. Following clear and reasonable  
specifications is fine, tuning basic operability for every not well  
documented peculiarity of each version/platform/bla/bla of a viewer is  
annoying.


On Dec 2, 2003, at 2:59 PM, Thomas DeWeese wrote:
>
>    Recent version of Batik now only produce a warning and continues
> to display the document.
I downloaded and have been testing with Batik 1.5, is this the "recent"  
version or does "recent" refer to a build from cvs?

>
>    Actually the dependencies on ASV extensions appear to be minimal.
> I found only four additional issues (one might be Batik's).
>
>   1) parseXML w/o a document
>   2) getDocumentElement on the return value from parseXML.
Thanks, this code is much better. Technically, it should have worked as  
it was. And allows for better catching of 'file loaded' status.  
Especially as I'd like to add a couple of retrys to the getURL process.  
Note that parseXML now returns a Document Fragment, not a Document.

<script type="text/ecmascript"> <![CDATA[
[...]
  getURL(url, fileLoaded)
[...]
function fileLoaded(data) {
     var string = ''
     if (data.success) {
         string = data.content
     } else {
         view.progress.message("loadFile : Puzzle not retrieved. May be  
slow server response, try again.")
         return
     }
     makeCrossword(parseXML(string, svgDoc))
}
[...]
function makeCrossword(svgDocFragment) {
	var xmlRoot = svgDocFragment.firstChild // xmlRoot is the XML "puzzle"  
element
[...]

>   4) The CSS for text.clue's uses .3em - to get this right I have
>      to use .09em in Batik.  This may indicate that Batik is using
>      the wrong base value to calculate em sizes in this case
>     (.3*.3 = 0.9 so if one of the parent elements has
>     font-size=".3em" and Batik misses it then you might see
>     this issue).
I haven''t had time to look at this yet. Am hoping there is some way  
that works in both.


SVG private attribute:

I am using this to create a "binding" between a JS object and a SVG  
object. Then I 'pretend' that the two objects are one SVGJS object. It  
works in Safari. I am not having much luck with using the private  
attribute  in Batik. And so, even though the crossword does build  
correctly (except for the lager clues), much of the functionality is  
missing. Including the crossword and control menu "show" functions. In  
this case, the functions change the "display" value to "inherit" or  
"none". While it is changed in the DOM, the change is not reflected in  
the viewer. I wanted to put up crosswordplayer 1.0b3 for FIXMEs and  
have it working with Batik, but i have to admit defeat at the moment.

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
[
<!ENTITY % SVG.Core.extra.attrib
     "xmlns:svgjs CDATA #FIXED 'http://schema.koonts.com/svgjs'
     svgjs:binding CDATA #IMPLIED"
 >
]>

<script type="text/ecmascript"> <![CDATA[
[...]
var svgjsNS = "http://schema.koonts.com/svgjs"
[...]

Following are results of tests of get and set attrubute, run in order  
of a1..a5. Batik and Safari differ in interpretation.
Here, results are from log messages following calls to has,set,get  
attrubute:

GET after SET in BATIK and SAFARI               	BATIK           	SAFARI
AttributeNS(svgjsNS, 'binding', 'a1')           		a5, a1          	a5,  
a1
Attribute('binding', 'a2')                      			a2              	a5,  
a2
Attribute('svgjs:binding', 'a3')                		a3              	a3
AttributeNS('svgjs', 'binding', 'a4')          		a4			a4
AttributeNS(svgjsNS, 'svgjs:binding', 'a5')		no attribute    	no  
attribute

Here I am guessing at the NAMESPACE:

SET in BATIK's DOM Viewer                       NAMESPACE?  NAME         
        VALUE
                                                 			svgNS(default)   
xmlns:svgjs      http://schema.koonts.com/svgjs
AttributeNS(svgjsNS, 'binding', 'a1')           svgjsNS		 binding        
       a1
Attribute('binding', 'a2')                      		svgNS(default)   
binding             a2
Attribute('svgjs:binding', 'a3')                	svgNS(default)   
svgjs:binding   a3
AttributeNS('svgjs', 'binding', 'a4')           	svgjs           	  
binding             a4
AttributeNS(svgjsNS, 'svgjs:binding', 'a5')	svgjsNS         	  
svgjs:binding   a5 (replaces? binding a1)

Received on Thursday, 11 December 2003 12:03:45 UTC