Hi T.J., ticket#559 is very relevant indeed, and the final patch contained " ... id = id.replace(/[\.:]/g, "\\$1"); ... " [1] does solve the issue with dots and colons in IDs.
However, looks like this patch didn't make it to the 'bleeding-edge version'. [3] Instead, there is the old (still buggy) patch " ... id = id.replace(/[\.:]/g, "\\$0"); ... " [2] So, I don't know how to go from here, is RC4 due any time soon (i really dislike manual changes in prototype core :) ) [1] http://github.com/sstephenson/prototype/commit/059ce21040ce1c469d13c3633ead78d03fc610c3 [2] http://github.com/sstephenson/prototype/commit/97fc24a0b2f32717c40a0d71bbdea4ca58e0847b [3] http://prototypejs.org/assets/2009/6/16/prototype.js Thanks a lot, always helpful cheers -- mona On Tue, Jul 21, 2009 at 11:41 AM, T.J. Crowder<[email protected]> wrote: > > Hi Mona, > > I agree, dots and colons are valid in HTML, and so should work with > the selector engine. > > I took a quick look at Lighthouse[1], and it looks like there may be a > ticket[2] or two[3] there that is relevant, although #559 is marked as > fixed in 1.6.1 and you say what you're seeing is still an issue in > RC3. It was a very quick search, though, so please have a good look > and open a ticket if you don't find one already open for this. (I'm > surprised that both 1.6.0.3 and 1.6.1 should have this bug, as they > use completely different selector engines.) > > FWIW, can I suggest a one-page test case with no dependancies other > than Prototype? Just something very simple; the one you posted > earlier is a bit much to grok in the time most people have available. > (Maybe this is less true for people who have used scripty's unit test > suite more than I.) > > [1] http://prototype.lighthouseapp.com/projects/8886-prototype > [2] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/559 > [3] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/501 > > Cheers, > -- > T.J. Crowder > tj / crowder software / com > Independent Software Engineer, consulting services available > > On Jul 21, 10:28 am, Mona Remlawi <[email protected]> wrote: >> " >> .... >> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be >> followed by any number of letters, digits ([0-9]), hyphens ("-"), >> underscores ("_"), colons (":"), and periods ("."). >> ... >> " [1] >> >> So if HTML permits a '.' in the ID value of elements, so should prototype >> core. >> >> Another point is that even if I rewrote my selectors, there would >> still be a problem in doing the following >> >> $('my\.long\.id').down('.myclass'); >> >> as prototype would translate this into : >> element.querySelectorAll('#my.long.id .myclass') >> >> I still insist that escaping 'special' chars in Element#identify >> method is the way to go ... >> >> [1]http://www.w3.org/TR/html4/types.html#type-name >> >> cheers >> >> -- >> mona >> >> >> >> On Tue, Jul 21, 2009 at 4:16 AM, Rick Waldron<[email protected]> wrote: >> > I feel like i should provide more insight. That was rather vague. An ID >> > could be labelled "a.b:c" and referenced in your style sheet as #a.b:c but >> > as well as being the id of an element, it could mean: >> >> > id "a", class "b", pseudo-selector "c". >> >> > Best to avoid the confusion and stay away from using . and : altogether. >> >> > On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron <[email protected]> >> > wrote: >> >> >> Instead of changing the way the core works... and potentially causing >> >> breakage to existing code - perhaps you might try rewriting your selector >> >> statement with escaped periods. >> >> >> This question caused me to read a bunch regarding valid id's from one html >> >> spec to another, and then double back to css selector specs. Apparently, >> >> they didn't compare notes... >> >> >> Rick >> >> >> On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi <[email protected]> >> >> wrote: >> >> >>> You've guessed it, it's unfeasible, the amount of effort that takes >> >>> makes my head hurt :) >> >>> Anyway, i found the little bug in prototype (hooray!). >> >> >>> IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into >> >>> some debugging (version: 1.6.0.3) >> >>> << >> >>> 2723: this.mode = 'selectorsAPI'; >> >>> ... >> >>> 2823: findElements: function(root) { >> >>> ... >> >>> 2837: case 'selectorsAPI': >> >>> ... >> >>> 2842: var oldId = root.id, id = $(root).identify(); >> >>> 2843: e = "#" + id + " " + e; >> >>> alert(e) // you'll see how the dots are confusing >> >>> the selector for classnames ... >> >> >>> Now for a fix, i changed the following line in Element#identify >> >>> << >> >>> 1782: if (id) return id.replace(/\./g, '\\.'); >> >> >>> to escape the dots. >> >> >>> with that, the unit test will succeed. >> >> >>> I'm not sure if this is the best way to go around it, or if there is >> >>> another chars for escaping, so it's in your hands now. >> >> >>> Waiting for the feedback and hopefully a patch :) >> >> >>> cheers >> >> >>> -- >> >>> mona >> >> >>> On Mon, Jul 20, 2009 at 5:06 PM, Richard >> >>> Quadling<[email protected]> wrote: >> >> >>> > 2009/7/20 Mona Remlawi <[email protected]>: >> >> >>> >> Hello prototypers, >> >> >>> >> I'm getting a basic error (in selectors) in *IE8/FF3* and don't think >> >>> >> anyone has reported it yet -- or maybe did, i searched but not >> >>> >> extensively. >> >>> >> The problem is that the Element#selector fails when invoked on an >> >>> >> Element that has a '.' in its id. >> >>> >> I've put a small unit test on pastie, you just need to get a copy of >> >>> >> unittest.js from scriptaculous (and test.css if you like colors :) ) >> >>> >>http://pastie.org/552134 >> >> >>> >> Tested with both version#1.6.0.3 and version#1.6.1RC#3 with the same >> >>> >> results. >> >> >>> >> Any help is greatly appreciated, I'm trying to debug on my own but >> >>> >> doubt i'll reach somewhere. >> >> >>> >> cheers >> >> >>> >> -- >> >>> >> mona >> >> >>> > I don't know how feasible it it, but maybe globally changing your IDs >> >>> > to use "_" rather than "." would be a quick and easy fix. >> >> >>> > -- >> >>> > ----- >> >>> > Richard Quadling >> >>> > Zend Certified Engineer : >> >>> >http://zend.com/zce.php?c=ZEND002498&r=213474731 >> >>> > "Standing on the shoulders of some very clever giants!" >> >>> > ZOPA :http://uk.zopa.com/member/RQuadling > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
