[Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-19 Thread Stephan Richter
On Thursday 14 June 2007 12:11, Gary Poster wrote:
 I understand your argument, but I'd be worried about being hosed anyway.

This worry is logicially unjustified. :-) From the sources you gave me to read 
and the comments others provided, IE merely merges the namespaces. By 
ensuring that the id and name namespace never intersect, this problem can 
never occur within our framework. An added bonus to all this is that I think 
that the checkin I made was the best solution. ;-)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-19 Thread Gary Poster


On Jun 19, 2007, at 1:47 PM, Stephan Richter wrote:


On Thursday 14 June 2007 12:11, Gary Poster wrote:
I understand your argument, but I'd be worried about being hosed  
anyway.


This worry is logicially unjustified. :-) From the sources you gave  
me to read

and the comments others provided, IE merely merges the namespaces. By
ensuring that the id and name namespace never intersect, this  
problem can
never occur within our framework. An added bonus to all this is  
that I think

that the checkin I made was the best solution. ;-)


Sorry, haven't had much time to think about this, but yes, I think  
you are right.


Gary

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-14 Thread Gary Poster


On Jun 13, 2007, at 1:22 AM, Stephan Richter wrote:


Hello Gary,

I am sorry that it took me so long to respond, but I had to think  
about this

problem for while and family is in town as well.


Very much understood.


On Sunday 03 June 2007 14:18, Gary Poster wrote:

Hey.  I've only had limited time to look at the new package(s) but
what I've seen so far looks good.  I hope to give it a whirl soon.


You should!


Definitely.


You may want to check about the browser compatibility of having ids
and names different.


...


This example just shows me that the fix I checked in is correct.


...

This checkin guarantees that the id and the name *never* share the  
same prefix
namespace (ids use - and names . as separators) thus  
eliminating the

problem alltogether.


...

If you can send me a z3c.form-based form that does not behave  
correctly in
IE6, I will be more than glad to revert this change and find  
another solution

to the problem.


I won't have time to do that anytime very soon.  We encountered this  
problem again very recently actually.  Here's a very small test  
case.  Works correctly on Firefox, breaks on IE 7(!).
Title: test



  


  
  bar (ok)
  foo (problem on IE 6 & 7)




I understand your argument, but I'd be worried about being hosed anyway.

Gary


___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-14 Thread Gary Poster
The html is very lame, btw, including, as someone pointed out to me,  
a  rather than a amp;.  However, it shouldn't affect the  
demonstration. :-)


Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-12 Thread Stephan Richter
Hello Gary,

I am sorry that it took me so long to respond, but I had to think about this 
problem for while and family is in town as well.

On Sunday 03 June 2007 14:18, Gary Poster wrote:
 Hey.  I've only had limited time to look at the new package(s) but  
 what I've seen so far looks good.  I hope to give it a whirl soon.

You should!

 You may want to check about the browser compatibility of having ids  
 and names different. I know I used to have IE problems when I did   
 this.  I tried to Google for verification.  I think you'll find some  
 here:

 http://channel9.msdn.com/wiki/default.aspx/
 Channel9.InternetExplorerProgrammingBugs

 Look for the section titled META tags improperly register them  
 selfs as an ID with document.getElementById(), specifically the  
 *second* example.  AFAIK, this would be an IE6 thing; I don't have  
 much hands-on pain knowledge with IE7.

This example just shows me that the fix I checked in is correct. As it seems 
from the referenced report, the id and name share the same namespace with the 
name being given precendence. Thus problems occur only when an id is also 
used as a name somewhere else.

This checkin guarantees that the id and the name *never* share the same prefix 
namespace (ids use - and names . as separators) thus eliminating the 
problem alltogether. Thus, if people use the JS functions as intended, 
everything should work great in IE.

 In fact, HTML 4 does regard name and id to be in the same namespace  
 for anchor tags (see http://www.w3.org/TR/html4/struct/links.html,  
 12.2.3) and even requires that they be identical (example is in the  
 section).  The IE bug, apparently, is to assume that this constraint  
 holds for all name attributes, such as form fields.

But ids and names have to be only identical for the listed elements. For those 
this constraint does make sense. For INPUT and SELECT/OPTION elements this 
constraint does not make sense at all. As Roger points out later, for radio 
buttons, the id and name *must* even be different.

input type=radio name=question1 id=question1.option1 /
input type=radio name=question1 id=question1.option2 /

Reading the end of the section, I would think that using the id for the 
anchor name is even somewhat discouraged. In XHTML 1.0, on the other 
hand, name is just deprecated. See 
http://www.w3.org/TR/2002/REC-xhtml1-20020801/, section 4.10.

 So, what you did is technically correct.  However, if you want your  
 code to be used be folks who care about supporting IE6 and JS, I  
 believe you will want your names and ids to be identical.

I disagree with your conclusion. By ensuring that names and ids are always 
different, I avoid the namespace issue.

 I've rung this alarm bell before in other contexts, but this is the  
 first time I was able to find corroboration.

If you can send me a z3c.form-based form that does not behave correctly in 
IE6, I will be more than glad to revert this change and find another solution 
to the problem.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-12 Thread Stephan Richter
On Monday 04 June 2007 15:41, Marius Gedminas wrote:
  Log message for revision 76258:
    HTML element ids containing dots are not very good, because then the
    element#id CSS selector does not work

 FYI it works just fine (at least in Firefox) if you escape the dots:

   element#id\.with\.dots

 I'm pretty sure it works in MSIE6 as well, but don't quote me on that.

Initially I had no luck finding the escape character. But googling for it 
again, the CSS specification defines the backslash as the escape character 
for CSS. Having said this, I find the backslash annoying, so I still like my 
solution better.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-04 Thread Marius Gedminas
On Sun, Jun 03, 2007 at 02:18:47PM -0400, Gary Poster wrote:
 On Jun 3, 2007, at 12:58 PM, Stephan Richter wrote:
 
 Log message for revision 76258:
   HTML element ids containing dots are not very good, because then the
   element#id CSS selector does not work 

FYI it works just fine (at least in Firefox) if you escape the dots:

  element#id\.with\.dots

I'm pretty sure it works in MSIE6 as well, but don't quote me on that.

Marius Gedminas
-- 
When I'm not in my right mind, my left mind gets a little crowded.


signature.asc
Description: Digital signature
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Checkins] SVN: z3c.form/trunk/src/z3c/form/ HTML element ids containing dots are not very good, because then the

2007-06-03 Thread Gary Poster


On Jun 3, 2007, at 12:58 PM, Stephan Richter wrote:


Log message for revision 76258:
  HTML element ids containing dots are not very good, because then the
  element#id CSS selector does not work and at least in firefox the
  attribute selector (element[attr=value]) does not work for the id
  either.

  Thus I converted the entire codebase to use dashes in ids  
instead. I am
  sorry if this causes some test-fixing issues for some of you, but  
making

  this change sooner rather than later is better in the long run.

  I am going to test this some more now.


Hey.  I've only had limited time to look at the new package(s) but  
what I've seen so far looks good.  I hope to give it a whirl soon.


You may want to check about the browser compatibility of having ids  
and names different.  I know I used to have IE problems when I did  
this.  I tried to Google for verification.  I think you'll find some  
here:


http://channel9.msdn.com/wiki/default.aspx/ 
Channel9.InternetExplorerProgrammingBugs


Look for the section titled META tags improperly register them  
selfs as an ID with document.getElementById(), specifically the  
*second* example.  AFAIK, this would be an IE6 thing; I don't have  
much hands-on pain knowledge with IE7.


In fact, HTML 4 does regard name and id to be in the same namespace  
for anchor tags (see http://www.w3.org/TR/html4/struct/links.html,  
12.2.3) and even requires that they be identical (example is in the  
section).  The IE bug, apparently, is to assume that this constraint  
holds for all name attributes, such as form fields.


So, what you did is technically correct.  However, if you want your  
code to be used be folks who care about supporting IE6 and JS, I  
believe you will want your names and ids to be identical.


I've rung this alarm bell before in other contexts, but this is the  
first time I was able to find corroboration.


Gary
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com