D
David Mark
More ace reporting from Ajaxian:-
http://ajaxian.com/archives/the-maturation-of-a-framework-qooxdoo-reaches-1-0
It's a 20MB download (no other option). I assume the bulk of that is
pretty graphics and useless tools (e.g. API viewer).
Doesn't take long to determine that the API is built on flyweight JS:-
/*
************************************************************************
qooxdoo - the new era of web development
More like another old time capsule of poor Web development practices
(would have been laughable at the turn of the century).
http://qooxdoo.org
Copyright:
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
License:
LGPL: http://www.gnu.org/licenses/lgpl.html
EPL: http://www.eclipse.org/org/documents/epl-v10.php
See the LICENSE file in the project's top-level directory for
details.
Authors:
* Sebastian Werner (wpbasti)
======================================================================
This class contains code based on the following work:
* Yahoo! UI Library
http://developer.yahoo.com/yui
Version 2.2.0
Oops.
[...]
************************************************************************
*/
/**
* Includes library functions to work with the client's viewport
(window).
*/
That's a pretty slap-dash description for a module in a "mature"
framework.
qx.Class.define("qx.bom.Viewport",
{
statics :
{
/**
* Returns the current width of the viewport (excluding a
eventually visible scrollbar).
*
* <code>clientWidth</code> is the inner width of an element in
pixels. It includes padding
* but not the vertical scrollbar (if present, if rendered),
border or margin.
*
* The property <code>innerWidth</code> is not useable as defined
by the standard as it includes the scrollbars
What standard?
* which is not the indented behavior of this method. We can
decrement the size by the scrollbar
* size but there are easier possibilities to work around this.
Yes, there are.
*
* Safari 2 and 3 beta (3.0.2) do not correctly implement
<code>clientWidth</code> on documentElement/body,
Sounds like dated observations.
* but <code>innerWidth</code> works there. Interesting is that
webkit do not correctly implement
* <code>innerWidth</code>, too. It calculates the size excluding
the scroll bars and this
* differs from the behavior of all other browsers - but this is
exactly what we want to have
* in this case.
A dated coincidence.
*
* Opera less then 9.50 only works well using
<code>body.clientWidth</code>.
Works well?
*
* Verified to correctly work with:
*
* * Mozilla Firefox 2.0.0.4
* * Opera 9.2.1
* * Safari 3.0 beta (3.0.2)
* * Internet Explorer 7.0
Definitely dated testing. But what were they testing anyway?
*
* @signature function(win)
* @param win {Window?window} The window to query
* @return {Integer} The width of the viewable area of the page
(excludes scrollbars).
*/
getWidth : qx.core.Variant.select("qx.client",
{
"opera" : function(win) {
They were testing if their UA sniffing was "accurate".
if (qx.bom.client.Engine.VERSION < 9.5) {
return (win||window).document.body.clientWidth;
}
else
{
var doc = (win||window).document;
return qx.bom.Document.isStandardMode(win) ?
doc.documentElement.clientWidth : doc.body.clientWidth;
}
},
Who wants to download this sort of bullshit (users or developers?)
"webkit" : function(win) {
if (qx.bom.client.Engine.VERSION < 523.15) { // Version <
3.0.4
return (win||window).innerWidth;
}
else
{
That's enough of that. It's another browser sniffing preserve.
http://www.cinsoft.net/viewport.asp
The FAQ has featured similar code for a decade.
And yes, the rest of it appears much the same:-
contains : qx.core.Variant.select("qx.client",
{
"webkit|mshtml|opera" : function(element, target)
{
if (qx.dom.Node.isDocument(element))
{
var doc = qx.dom.Node.getDocument(target);
return element && doc == element;
}
else if (qx.dom.Node.isDocument(target))
{
return false;
}
else
{
return element.contains(target);
}
},
// http://developer.mozilla.org/en/docs/DOM:Node.compareDocumentPosition
"gecko" : function(element, target) {
return !!(element.compareDocumentPosition(target) & 16);
},
"default" : function(element, target)
{
while(target)
{
if (element == target) {
return true;
}
target = target.parentNode;
}
return false;
}
}),
/**
* Whether the element is inserted into the document
* for which it was created.
*
* @param element {Element} DOM element to check
* @return {Boolean} <code>true</code> when the element is
inserted
* into the document.
*/
isRendered : function(element)
{
// This module is highly used by new qx.html.Element
// Copied over details from qx.dom.Node.getDocument() and
// this.contains() for performance reasons.
// Offset parent is a good start to test. It omits document
detection
// and function calls.
if (!element.offsetParent) {
return false;
}
var doc = element.ownerDocument || element.document;
// This is available after most browser excluding gecko haved
copied it from mshtml.
// Contains() is only available on real elements in webkit and
not on the document.
if (doc.body.contains) {
return doc.body.contains(element);
}
// Gecko way, DOM3 method
if (doc.compareDocumentPosition) {
return !!(doc.compareDocumentPosition(element) & 16);
}
// Should not happen
throw new Error("Missing support for isRendered()!");
},
Frameworks built on solid foundations mature, preserves just rot over
time.
And in the comments for the cited posting, somebody pointed out that
the demos are all blank pages with scripting disabled. A retort was:-
"I wonder what the intersection is between users who use the web
without JS turned on, and users who use the web wearing tin-foil hats…
hmmm"
If they only had a brain.
http://ajaxian.com/archives/the-maturation-of-a-framework-qooxdoo-reaches-1-0
It's a 20MB download (no other option). I assume the bulk of that is
pretty graphics and useless tools (e.g. API viewer).
Doesn't take long to determine that the API is built on flyweight JS:-
/*
************************************************************************
qooxdoo - the new era of web development
More like another old time capsule of poor Web development practices
(would have been laughable at the turn of the century).
http://qooxdoo.org
Copyright:
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
License:
LGPL: http://www.gnu.org/licenses/lgpl.html
EPL: http://www.eclipse.org/org/documents/epl-v10.php
See the LICENSE file in the project's top-level directory for
details.
Authors:
* Sebastian Werner (wpbasti)
======================================================================
This class contains code based on the following work:
* Yahoo! UI Library
http://developer.yahoo.com/yui
Version 2.2.0
Oops.
[...]
************************************************************************
*/
/**
* Includes library functions to work with the client's viewport
(window).
*/
That's a pretty slap-dash description for a module in a "mature"
framework.
qx.Class.define("qx.bom.Viewport",
{
statics :
{
/**
* Returns the current width of the viewport (excluding a
eventually visible scrollbar).
*
* <code>clientWidth</code> is the inner width of an element in
pixels. It includes padding
* but not the vertical scrollbar (if present, if rendered),
border or margin.
*
* The property <code>innerWidth</code> is not useable as defined
by the standard as it includes the scrollbars
What standard?
* which is not the indented behavior of this method. We can
decrement the size by the scrollbar
* size but there are easier possibilities to work around this.
Yes, there are.
*
* Safari 2 and 3 beta (3.0.2) do not correctly implement
<code>clientWidth</code> on documentElement/body,
Sounds like dated observations.
* but <code>innerWidth</code> works there. Interesting is that
webkit do not correctly implement
* <code>innerWidth</code>, too. It calculates the size excluding
the scroll bars and this
* differs from the behavior of all other browsers - but this is
exactly what we want to have
* in this case.
A dated coincidence.
*
* Opera less then 9.50 only works well using
<code>body.clientWidth</code>.
Works well?
*
* Verified to correctly work with:
*
* * Mozilla Firefox 2.0.0.4
* * Opera 9.2.1
* * Safari 3.0 beta (3.0.2)
* * Internet Explorer 7.0
Definitely dated testing. But what were they testing anyway?
*
* @signature function(win)
* @param win {Window?window} The window to query
* @return {Integer} The width of the viewable area of the page
(excludes scrollbars).
*/
getWidth : qx.core.Variant.select("qx.client",
{
"opera" : function(win) {
They were testing if their UA sniffing was "accurate".
if (qx.bom.client.Engine.VERSION < 9.5) {
return (win||window).document.body.clientWidth;
}
else
{
var doc = (win||window).document;
return qx.bom.Document.isStandardMode(win) ?
doc.documentElement.clientWidth : doc.body.clientWidth;
}
},
Who wants to download this sort of bullshit (users or developers?)
"webkit" : function(win) {
if (qx.bom.client.Engine.VERSION < 523.15) { // Version <
3.0.4
return (win||window).innerWidth;
}
else
{
That's enough of that. It's another browser sniffing preserve.
http://www.cinsoft.net/viewport.asp
The FAQ has featured similar code for a decade.
And yes, the rest of it appears much the same:-
contains : qx.core.Variant.select("qx.client",
{
"webkit|mshtml|opera" : function(element, target)
{
if (qx.dom.Node.isDocument(element))
{
var doc = qx.dom.Node.getDocument(target);
return element && doc == element;
}
else if (qx.dom.Node.isDocument(target))
{
return false;
}
else
{
return element.contains(target);
}
},
// http://developer.mozilla.org/en/docs/DOM:Node.compareDocumentPosition
"gecko" : function(element, target) {
return !!(element.compareDocumentPosition(target) & 16);
},
"default" : function(element, target)
{
while(target)
{
if (element == target) {
return true;
}
target = target.parentNode;
}
return false;
}
}),
/**
* Whether the element is inserted into the document
* for which it was created.
*
* @param element {Element} DOM element to check
* @return {Boolean} <code>true</code> when the element is
inserted
* into the document.
*/
isRendered : function(element)
{
// This module is highly used by new qx.html.Element
// Copied over details from qx.dom.Node.getDocument() and
// this.contains() for performance reasons.
// Offset parent is a good start to test. It omits document
detection
// and function calls.
if (!element.offsetParent) {
return false;
}
var doc = element.ownerDocument || element.document;
// This is available after most browser excluding gecko haved
copied it from mshtml.
// Contains() is only available on real elements in webkit and
not on the document.
if (doc.body.contains) {
return doc.body.contains(element);
}
// Gecko way, DOM3 method
if (doc.compareDocumentPosition) {
return !!(doc.compareDocumentPosition(element) & 16);
}
// Should not happen
throw new Error("Missing support for isRendered()!");
},
Frameworks built on solid foundations mature, preserves just rot over
time.
And in the comments for the cited posting, somebody pointed out that
the demos are all blank pages with scripting disabled. A retort was:-
"I wonder what the intersection is between users who use the web
without JS turned on, and users who use the web wearing tin-foil hats…
hmmm"
If they only had a brain.