Web Info & Tutorials

March 6th, 2008

TO EXTPHP, OR TO PHP-EXT?

I got emails on the same day from two developers letting me know about ExtJS wrappers for PHP.

PHP-Ext

First, Sergei Walter Guerra told me about PHP-Ext "an open source widget library written for PHP 4 and 5 to empower the UI Layer."

The API looks like this:

PHP:
echo Ext::onReady(
        Javascript::stm(ExtQuickTips::init()),
        Javascript::assign("data",Javascript::valueToJavascript($myData)),
        //Javascript::valueToJavascript($myData),
        $store->getJavascript(false, "ds"),
        $italicRenderer,
        $changeRenderer,
        $pctChangeRenderer,
        $colModel->getJavascript(false, "colModel"),
        $gridForm->getJavascript(false, "gridForm")
);

$gridForm = new ExtFormPanel("company-form");
$gridForm->Frame = true;
$gridForm->LabelAlign = EXT_FORM_LABEL_ALIGN_LEFT;
$gridForm->Title = "Company Data";
$gridForm->BodyStyle = "padding: 5px;";
$gridForm->Width = 750;
$gridForm->Layout = EXT_CONTAINER_LAYOUTS_COLUMN;
 

ExtPHP

Then Chris Ravenscroft came to me to announce ExtPHP:

"It is something that I had to think about in my day job, because my team is migrating to PHP for web development and I believe that we simply do not have enough time for them to learn JavaScript's intricacies, I needed to be the one person who would have to wrestle JavaScript when problems happened. I therefore needed a way to insulate them from the gory details, which is why I created ExtPHP."

The API looks like this:

PHP:
$cfg = new Ext_Viewport_Config();
$viewport = new Ext_Viewport(
        $cfg->
                layout('border')->
                items(array($actionpanel, $tabpanel->name()))
);
$viewport->jsrender();

$tabpanel->add(
        array('title'=>'New Tab', 'iconCls'=>'tabs', 'autoLoad'=>
                array('url'=>'extphptest.php?content1'),
                'closable'=>true
        )
);

new JsReady(JsWriter::get());
 

Maybe you guys can join forces? :)

March 6th, 2008

BACKBASE TESTS BROWSER JAVASCRIPT AND RENDER PERFORMANCE INCLUDING IE 8

Sjoerd Mulder of Backbase ran a couple of performance tests on a slew of browsers, including IE 8 beta. He tested both the JavaScript performance, and the rendering performance:

A lot of respect and thanks to all the browser teams pushing the boundary of performance. I think it's an awesome result that the current nightlies of both Webkit and Gecko are 2x / 3x faster than the current production versions. Can't wait until Firefox 3 is released to the public!

It seems the IE team still needs to do a lot of optimization in the render engine, but still we have to consider that it's a beta 1. So let's hope they either improve some more or everybody switches to Firefox / Safari.

JavaScript Performance

The first section is the Javascript Engine of Backbase and testing various scenarios, for instance:

  • TDL Compiling / parsing
  • Javascript XPath 2.0 Engine
  • XEL execution / event propagation

Backbase Performance: JavaScript

Render Performance (DOM)

The second part is rendering widgets, for example:

  • Rendering 1 accordion
  • Rendering 5 accordions
  • Rendering a listGrid
  • etc..

Backbase Performance: Render

The full specification and timings is available to see.

March 6th, 2008

FIRECOOKIE: PUT YOU HAND IN THE COOKIE JAR WITH FIREBUG

Jan Odvárko "missed two movie nights" to create cookie support in Firebug. His Firebug plugin, Firecookie, gives you access to view, search, create, remove, and manage the permissions of a cookie, all from within a Firebug tab.

Firecookie creates a log entry every time when a cookie is created, changed, deleted or rejected (an option you can change).

Jan is looking for comments.

He has also written a nice tutorial on extending Firebug. It is great to see sub-plugins for Firebug such as YSlow, Firecookie, etc. Do you know of any other good ones?

NOTE: There are, of course, separate Firefox plugins for cookie management.

March 6th, 2008

IE 8 ON ACID

The IE team posted that they were passing Acid2 a few months ago, yet people are seeing a broken face when they tested with IE 8 beta.

Phil Nachreiner of IE explained the situation:

Although we said that IE8 Beta 1 passes the ACID2 test, some of you may be seeing results like the image above; we thought we should explain what’s going on. IE8 passes the official ACID2 test hosted on http://www.webstandards.org/files/acid2/test.html. (Note, this seems to be a popular destination at the moment. You may have trouble reaching the site.)There are also a number of copies of this test around the net. One popular copy that I’ve seen of late is http://acid2.acidtests.org/

IE8 fails the copies of ACID2 due to the cross domain security checks IE performs for ActiveX controls.  Since IE does not natively handle HTML content in the OBJECT tag, but rather uses IE’s rendering engine as an ActiveX to display this HTML content, the same cross domain security checks also apply.

Given that, let’s take a look at how the acidtests.org copy from above relies on OBJECT fallback to render the eyes. Here’s the snippet of the test for the eyes:

HTML:
<object data="data:application/x-unknown,ERROR">
    </object><object data="http://www.damowmow.com/404/" type="text/html">
                </object><object data=”data:*the eyes DATAURI* …>
    </object>

 

IE stops the OBJECT fallback process at the highlighted line above. The team and I involved in this work decided that this is the right thing to do because IE would have to allow navigation to this cross domain content in order to determine if the failed resource is a 404 HTTP error code or any of the other failed resource indicators that are part of the standard. To maintain compatibility and be secure by default we didn’t want to invoke fallback either, as original web authors might not have intended this behavior. We started with the most secure solution and are now looking into whether we can safely loosen this restriction in a future beta.
With all that said let’s also take a look at the official ACID2 page hosted by www.webstandards.org:

We see:

HTML:
<object data="data:application/x-unknown,ERROR">
    </object><object data="http://www.webstandards.org/404/" type="text/html">
         </object><object data="data:*the eyes DATAURI *>
    </object>

 

Note that we see the same domain as the test, so everything works fine.

What about Acid3?

For IE7 and ACID3 I got: 14/100

The rendering was seriously messed up (boxes and off-color elements everywhere).

For IE8B1 and ACID3 I got 17/100.

The rendering was much better. The blocks showed up and appeared to be pretty correct size but were all black and gray (no color).

This just came out, so hopefully the team will have time to look at it before a beta in the future.

John Resig has a nice catalog of JavaScript related fixes in IE 8. I like how it is our release:

Our day has finally come. CSS coders got some love with Internet Explorer 7 - us JavaScript folk got absolutely nothing. In fact, at last count, all we got were a couple new bugs to deal with (file:// requests not working via XMLHttpRequest and <object>.getElementsByTagName("*") always returning no elements).

Internet Explorer 8 is our release.

March 6th, 2008

WEBKIT, GTK, AND QT

Ryan Apostle has cursive most creating flush cyberspace applications on UNIX with WebKit:

The open-source WebKit HTML performance engine is apace gaining connector on the UNIX papers where it is progressively existence adoptive by customary screen applications for noesis display. Ongoing efforts to assist tighter WebKit combining are inaugural the entranceway for nonindustrial flush cyberspace applications on UNIX with the open-source GTK and Qt utilization toolkits.

The article talks most the HTML 5 recording hold in GTKWebkit, using Epiphony, Maemo, and OLPC.