[Prototype-core] Re: $$() and :nth psuedo-elements
Hey Andrew, Andrew Dupont a écrit : I'm frustrated at the ambiguity of the CSS3 spec on this issue. See for yourself at (http://www.w3.org/TR/2001/CR-css3-selectors-2003/ OK, start by using the latest version, OK? http://www.w3.org/TR/css3-selectors/ #nth-child-pseudo). The spec says that a and b must be zero, negative integers or positive integers, but does not give any examples in which b is negative -- neither in the spec nor in the test suite. It's much better expressed in the latest version. For instance: The value a can be negative, but only the positive values of an+b, for n≥0, may represent an element in the document tree. html|tr:nth-child(-n+6) represents the 6 first rows of XHTML tables When the value b is negative, the + character in the expression must be removed (it is effectively replaced by the - character indicating the negative value of b). :nth-child(10n-1) represents the 9th, 19th, 29th, etc, element :nth-child(10n+9) (same) :nth-child(10n+-1) (Syntactically invalid, and would be ignored) Based on this, I'll review your latest parseNth today ;-) -- Christophe Porteneuve a.k.a. TDD [They] did not know it was impossible, so they did it. --Mark Twain Email: [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Opera and prototype
I was playing around with the testing framework and decided to see if I could get it working with Opera and appeared to be successful. But when I ran the tests, opera failed the dom, form, position, and selector tests. Is prototype supposed to support Opera? Trevan P.S. I submitted a patch to add opera to the test suites as well as a possible fix the problem where you have to close IE before it goes to the next test case (http://dev.rubyonrails.org/ticket/7852) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Opera 9 support
I don't know what you've done so far in this aspect but I looked into a few tests (Opera 9, Windows XP). testFormActivating: passed for me testFormRequest All three errors that this test throws are caused by a problem with hasAttribute('method'). It looks like if you don't specify a method for the form, then Opera automatically assigns it to get. And the current test setup is expecting there to be no attribute 'method' and for the Ajax.Request to default it to post. This looks like an unsolvable problem so we would have to change the tests to accommodate this. testElementReadAttribute: element.getAttribute('title') returns null directly from Opera and the test expects it to be blank. We will probably need to check for this case and fix it to be similar across browsers. testElementGetStyle: Looks to be a problem with grabbing the width from an element that has display:none. Opera doesn't return auto as prototype is expecting but 0px. Trevan On Feb 10, 8:23 pm, Tobie Langel [EMAIL PROTECTED] wrote: Hi, AlthoughOpera9 is *not* officially supported by Prototype, it passes nearly all tests. It would be great to be able to officialy supportOpera9 in upcoming versions of Prototype. This would at least imply dealing with the currently failing tests. Here's a list forOpera9.02 (on Mac OSX 10.4). in form.js: * testFormActivating and * testFormRequest. in position.js: * testWithin. in dom.js: * testElementUpdateInTableRow, * testElementUpdateInTable, * testElementGetStyle and * testElementReadAttribute. As you see, there's not that much to do (although there might be other issues that the unit tests don't cover). So if anybody is willing to help me out on this issue, that would be very much appreciated. Tobie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: $$() and :nth psuedo-elements
This is what I came up with for the XPath version: http://pastie.caboo.se/47671 It's a direct port of the logic of parseNth (albeit not yet tested). I'll look at yours and see if it makes more sense, though. Cheers, Andrew On Mar 17, 4:51 pm, Trevan Richins [EMAIL PROTECTED] wrote: Andrew Dupont wrote: This site might be useful:http://gallery.theopalgroup.com/selectoracle/ I'd found that site as well, but it seems to get stuff wrong. If I ask it to explain ulli:nth-child(n+2), it replies with: Wow, I didn't notice that one. The parseNth code looks better. I'm wondering, though, how you are going to convert it to Xpath? This is what I came up with:http://pastie.caboo.se/47653. It is similar to the patch I submitted in the original bug but is slightly more condensed. It first reduces the selection to the elements that fit the bth item from groups of a. Then, in the resulting selection, it grabs the elements that have a position (in this new selection, not the original one) that are = b/a (for a 0) or = b/a (for a 0). Trevan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---