public
Description: Prototype JavaScript framework
Homepage: http://prototypejs.org/
Clone URL: git://github.com/sstephenson/prototype.git

Comments for sstephenson's prototype   feed

savetheclocktower commented on sstephenson/prototype Wed Nov 04 17:10:57 -0800 2009
Comment on src/dom/layout.js L144 in 97ea37d:

I'm going to rewrite this function entirely. I might not even need it.

savetheclocktower commented on sstephenson/prototype Wed Nov 04 17:10:25 -0800 2009
Comment on src/dom/layout.js L156 in 97ea37d:

You're right. I'll fix the behavior of getOffsetParent instead.

This fixes a quirk where getBoundingClientRect doesn't return proper offsets for the BODY tag. The margin of error is weird but predictable (something like 8px off horizontally and 12px off vertically).

staaky commented on sstephenson/prototype Tue Nov 03 16:58:43 -0800 2009
Comment on src/dom/layout.js L156 in 97ea37d:

That bug is convenient here, but getOffsetParent should probably do the right thing and return the BODY element on IE6. I remember that it was once fixed but it was reverted to clean up a 1.6.0.3 release.

Could still use the logic behind the bug to test but perhaps there's a better way. What quirk does this fix?

kangax commented on sstephenson/prototype Tue Nov 03 13:31:39 -0800 2009
Comment in 97ea37d:

@dperini What about:

function isRootElement(element) { 
  return element.tagName.toUpperCase() === 'HTML'; 
}
// is BODY a root element?
if (document.documentElement.clientWidth === 0) {
  isRootElement = function(element){ 
    return element.tagName.toUpperCase() === 'BODY'; 
  };
}

However, I think this won't really work with multiple documents (where an element whose tagName is "HTML" might not be a root ancestor of an element in question).

dperini commented on sstephenson/prototype Tue Nov 03 09:39:06 -0800 2009
Comment in 97ea37d:

I dig the suggested "isRootElement" name !

This is only a problem in IE browsers so I still think that for those browsers a load time feature test is better.
FT should check which one of HTML or BODY is considered the actual "root" element in that browser and in that specific page.
In IE I have successfully used the "compatMode" property or "DOCTYPE" sniffing using "systemId" and "publicId" properties of "doctype" object.

kangax commented on sstephenson/prototype Tue Nov 03 05:36:58 -0800 2009
Comment on src/dom/layout.js L144 in 97ea37d:

This is pretty slow and eats memory. The sugar is not worth perf. loss here, imo. Can we replace this with — var nodeName = element.nodeName.toUpperCase(); return nodeName === 'BODY' || nodeName === 'HTML'? I would also rename this method to — isRootElement, following CSS terminology.

dperini commented on sstephenson/prototype Tue Oct 27 19:01:19 -0700 2009
Comment in 5f85799:

I have a version around where I also added the "data" & "callback" functionality to the match() method.

Looking to the above adapter, I was wondering if it could be really useful to have something like this:

NWDom.match(element, selector, results, Element.extend);

results will be augmented and callback invoked only if element matches. Seems a good shortcut to me.

What do you think ?

samleb commented on sstephenson/prototype Sun Oct 25 06:39:09 -0700 2009
Comment in 8382682:

Agreed, or even Legacy.Selector, Legacy being a namespace for legacy stuff.

kangax commented on sstephenson/prototype Sat Oct 24 18:10:16 -0700 2009
Comment on vendor/legacy/selector_engine.js L24 in 8382682:

Doesn't Legacy sound ambiguous? Why not name it LegacySelector?

RStankov commented on sstephenson/prototype Sat Oct 24 01:56:19 -0700 2009
Comment in 7f5ce1e:

@tobie @kangax - 10x for explanations, actually my fail was understanding how NW.select works, and I thought that only NW.select could be used without callback and results.

kangax commented on sstephenson/prototype Fri Oct 23 19:22:14 -0700 2009
Comment in 5f85799:

I would go with results.push(Element.extend(element)) too.

kangax commented on sstephenson/prototype Fri Oct 23 19:19:40 -0700 2009
Comment in 7f5ce1e:

@RStankov Element.extend is essentially Prototype.K (function returning first argument) in browsers that support host objects' prototype extensions.

tobie commented on sstephenson/prototype Fri Oct 23 10:45:12 -0700 2009
Comment in 7f5ce1e:

It is, actually. It's an empty function.

samleb commented on sstephenson/prototype Fri Oct 23 10:42:52 -0700 2009
Comment in 5f85799:

or even results.push(Element.extend(element)) which is used throughout the framework

samleb commented on sstephenson/prototype Fri Oct 23 10:40:54 -0700 2009
Comment on vendor/nwmatcher/selector_engine.js L29 in 5f85799:

element = Element.extend(element) still works if it's a proxy.

RStankov commented on sstephenson/prototype Fri Oct 23 10:08:17 -0700 2009
Comment in 7f5ce1e:

I'm wondering if Element.extend could be skipped, and used only if current browser doesn't support element prototype extensions ?

samleb commented on sstephenson/prototype Fri Oct 23 03:58:35 -0700 2009
Comment in 9d7a981:

This closing parenthesis breaks the link sorry, here it is again : http://github.com/samleb/prototype/commit/caa2bf02b2ef641d1583ccbdb170d7baccb7788b

tobie commented on sstephenson/prototype Thu Oct 22 22:55:19 -0700 2009
Comment in af89847:

The fruit of a git reset HEAD missing ^. So sorry.

subtleGradient commented on sstephenson/prototype Thu Oct 22 22:03:09 -0700 2009
Comment in 7762e00:

Good stuff.

jdalton commented on sstephenson/prototype Thu Oct 22 21:56:56 -0700 2009
Comment in 7762e00:

@tobie here is his project link http://github.com/dperini/nwmatcher