SlideShare a Scribd company logo
Hybrid Apps (Native + Web) using WebKit

             ARIYA HIDAYAT, SENCHA
whoami
Overview
Going Hybrid?

   Platform Integration      Security



                            App Store/
    Advanced Technologies   Marketplace
WebKit Everywhere

 Browser



 Devices



Runtime
~2000 commits/month
            History
            90000
            80000
            70000
            60000
Revisions




            50000
            40000
            30000
            20000
            10000
               0
                    0   1   2   3   4     5     6    7     8     9    10
                                        Years
Extensive Tests



 ≈ 20,000 tests    tests
                  904 MB   the rest
                           229 MB
Workflow
                             quality control


    1     Every commit needs to be reviewed



    2     Broken commit must be reverted

                     zero-regression policy
Level of Involvement
    Contributor
                       after 10-20 patches




                                              after 80 patches
                       Committer

               ≈ 150                                     Reviewer

     checks in reviewed patches              ≈ 90
                                                           accept or reject patches
WebKit Reviewers
              Apple
               39




                              Google
                                25
      Misc
       11

       1     RIM
                      Nokia
              7
                        7
Components of WebKit
        DOM              CSS

              WebCore             SVG

 HTML
                   rendering
                                        JavaScriptCore


                 WebKit Library
Platform Abstractions

       Network     Unicode      Clipboard


       Graphics     Theme        Events


       Thread     Geolocation    Timer
WebCore
Di erent “Ports”                                      graphics


GraphicsContext
                      Mac        Chromium            Qt     Gtk


                                   Skia                          Cairo
                  CoreGraphics
                                                 QPainter


                                          graphics stack
Use
Web Browsers
                          Arora




  Demo Browser         http://arora.googlecode.com

       demos/browser
QWebView, QWebPage, QWebFrame
                    QWebView (widget)




                  QWebPage (object)


                            QWebFrame (object)

                     At least one, i.e. the main frame of the page
Using WebView


 QWebView webView;
 webView.show();
 webView.setUrl(QUrl("http://meego.com"));
Contents via String


 QWebView webView;
 webView.show();
 webView.setContent("<body>Hello, MeeGo!</body>");
Contents via Resource
                      <RCC>
                          <qresource prefix="/">
                              <file>content.html</file>
                          </qresource>
                      </RCC>


QWebView webView;
webView.show();
webView.setUrl(QUrl("qrc:/content.html"));
Capture to Image

QWebPage page;
QImage image(size, QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::transparent);
QPainter p(&image);
page.mainFrame()->render(&p);
p.end();
image.save(fileName);



           http://labs.qt.nokia.com/2009/01/15/capturing-web-pages/
SVG Rasterizer




     http://labs.qt.nokia.com/2008/08/06/webkit-based-svg-rasterizer/
Search + Preview




     http://labs.qt.nokia.com/2008/11/04/search-with-thumbnail-preview/
Bridging the Two Worlds
Exposing to the Web world

QWebFrame::addToJavaScriptWindowObject(QString, QObject*)



                                  Public functions
                                  Object properties
                                    Child objects
Exposing to the Web world
page()->mainFrame()->addToJavaScriptWindowObject("Dialog", new Dialog);



                 class Dialog: public QObject
                 {
                     Q_OBJECT

                 public:
                     Dialog(QObject *parent = 0);

                 public slots:
                     void showMessage(const QString& msg);
                 };
Exposing to the Web world

   <input type="button" value="Try this"
   onClick="Dialog.showMessage('You clicked me!')">




    instance of
                             public slot
   Dialog object
Signal and Slot
              signal


   foobar.modified.connect(refresh);

    QObject instance       JavaScript function


  foobar.modified.connect(obj, refresh);
                             any object
Triggering Action from Native
class Stopwatch: public QObject
{                                     Stopwatch::Stopwatch(QObject *parent)
    Q_OBJECT                              : QObject(parent)
                                          , m_index(0)
public:                               {
    Stopwatch(QObject *parent = 0);       QTimer *timer = new QTimer(this);
                                          timer->setInterval(1000);
signals:                                  connect(timer, SIGNAL(timeout()), SLOT(update()));
    void tick(int t);                     timer->start();
                                      }
private slots:
    void update();                    void Stopwatch::update()
                                      {
private:                                  emit tick(m_index++);
    int m_index;                      }
};
Triggering Action from Native
   instance of
 Stopwatch object
                                  signal


      <script>
      Stopwatch.tick.connect(function(t) {
          document.getElementById('tick').innerText = t;
      });
      </script>
Coming back to the Native

  QVariant QWebFrame::evaluateJavaScript(QString)


      mostly key-value pair
     (like JavaScript objects)
Other Bridging Solutions


                                           Custom network protocol
                                           QNetworkAccessManager




       http://labs.qt.nokia.com/2010/11/16/some-webkit-hybrid-stu /
Platform Integration

                   Menu and Menu Bar

                                              Dialogs
                          Application
   System Access



                               Notifications
Debugging


     Web Inspector




settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
Deployment

     O ine                Packaging
 Cache Manifest      QtWebKit boilerplate
  Local Storage
                               Tools

              PhoneGap
          AppUp Encapsulator
Real-world Hybrid Apps




      Ext Designer       Sencha Animator
Technologies
Key Technologies
JavaScript
Libraries and Frameworks
Content Editing




      http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/
Consume Web 2.0




http://labs.qt.nokia.com/2009/03/08/creating-a-google-chat-client-in-15-minutes/
Vector Graphics




           http://raphaeljs.com/polar-clock.html
Canvas-based Game




      http://ariya.blogspot.com/2010/09/invade-destroy.html
Diagrams & Visualization




    JavaScript InfoVis Toolkit   http://thejit.org/
CSS3 Animations




      http://mozillademos.org/demos/planetarium/demo.html
Accelerated Composition

                          GPU FTW
Sencha Animator
Device Access




           http://ariya.github.com/js/marblebox/
WebGL for 3-D




        http://webglsamples.googlecode.com/hg/aquarium/aquarium.html
PhiloGL: WebGL Framework




            http://senchalabs.github.com/philogl/
Tools
Web Inspector
Network Log

28: GET http://www.google.com/m/gp
292: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp
311: GET data:image/gif;base64,R0lGODlhiA...
312: GET data:image/gif;base64,R0lGODlhJA...
312: GET data:image/gif;base64,R0lGODlhGA...
312: Response 0 image/gif 3611 bytes data:image/gif;base64,R0lGODlhiA...
312: Finish fail data:image/gif;base64,R0lGODlhiA...
312: Response 0 image/gif 284 bytes data:image/gif;base64,R0lGODlhJA...
312: Finish fail data:image/gif;base64,R0lGODlhJA...
312: Response 0 image/gif 178 bytes data:image/gif;base64,R0lGODlhGA...
312: Finish fail data:image/gif;base64,R0lGODlhGA...
317: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp
324: Finish fail http://www.google.com/m/gp
328: GET http://www.google.com/m/gn/user?...
329: Finish success http://www.google.com/m/gn/user?...
Typical Scenario
                         This is
                        awesome!




                   un
            t to r
       forge ests
          the t
Test Framework

specrunner SpecRunner.html
5 specs, 0 failures in 0.013s

specrunner SpecRunner.html
FAIL: 5 specs, 1 failure in 0.014s




               Selenium, Watir, Squish Web, JSUnit, Jasmine,
                                 QUnit, ...
Headless WebKit

if (phantom.state.length === 0) {
    phantom.state = 'pizza';
    phantom.open('http://www.google.com/m/local?site=local&q=pizza+in+new+york');
} else {
    var list = document.querySelectorAll('div.bf');
    for (var i in list) {
        console.log(list[i].innerText);
    }
    phantom.exit();
}




                               http://phantomjs.org
UI Designer
IDE: AKShell
IDE: Cloud9
Recorder and Replayer
Get + Compile
Using git

  git clone git://git.webkit.org/WebKit.git
  cd WebKit



                       ≈ 1.2 GB .git
Build

Tools/Scripts/build-webkit --qt




      --debug for “Debug” mode
Launch

Tools/Scripts/run-launcher --qt
Conclusion
Today
       Web technologies are moving really fast
Various frameworks and libraries boost the productivity
         Hybrid approach helps the migration
                Tools need to catch-up
Future
 More bindings to the native world
 Platinum-grade productivity tools
Ubiquitous mesh and cloud solutions
THANK YOU!

         ariya.hidayat@gmail.com


         ariya.blogspot.com


         ariyahidayat

More Related Content

What's hot (20)

KEY
State of the art - server side JavaScript - web-5 2012
Alexandre Morgaut
 
PDF
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
KAI CHU CHUNG
 
PDF
GDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
KAI CHU CHUNG
 
PDF
Writing Tools using WebKit
Ariya Hidayat
 
PDF
In the Brain of Hans Dockter: Gradle
Skills Matter
 
PDF
NoSQL and JavaScript: a love story
Alexandre Morgaut
 
PDF
A friend in need - A JS indeed
Yonatan Levin
 
PDF
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
KAI CHU CHUNG
 
PDF
Meet the Widgets: Another Way to Implement UI
ICS
 
PDF
Performance #1: Memory
Yonatan Levin
 
PDF
Best Practices in Qt Quick/QML - Part 2
Janel Heilbrunn
 
KEY
CDI e as ideias pro futuro do VRaptor
Caelum
 
PDF
Rock GWT UI's with Polymer Elements
Manuel Carrasco Moñino
 
PDF
Under the Hood: Using Spring in Grails
Burt Beckwith
 
PDF
Building scalable applications with hazelcast
Fuad Malikov
 
PDF
The Ring programming language version 1.7 book - Part 75 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 77 of 202
Mahmoud Samir Fayed
 
PDF
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
GITS Indonesia
 
PDF
Groovy And Grails JUG Padova
John Leach
 
PDF
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Applitools
 
State of the art - server side JavaScript - web-5 2012
Alexandre Morgaut
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
KAI CHU CHUNG
 
GDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
KAI CHU CHUNG
 
Writing Tools using WebKit
Ariya Hidayat
 
In the Brain of Hans Dockter: Gradle
Skills Matter
 
NoSQL and JavaScript: a love story
Alexandre Morgaut
 
A friend in need - A JS indeed
Yonatan Levin
 
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
KAI CHU CHUNG
 
Meet the Widgets: Another Way to Implement UI
ICS
 
Performance #1: Memory
Yonatan Levin
 
Best Practices in Qt Quick/QML - Part 2
Janel Heilbrunn
 
CDI e as ideias pro futuro do VRaptor
Caelum
 
Rock GWT UI's with Polymer Elements
Manuel Carrasco Moñino
 
Under the Hood: Using Spring in Grails
Burt Beckwith
 
Building scalable applications with hazelcast
Fuad Malikov
 
The Ring programming language version 1.7 book - Part 75 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 77 of 202
Mahmoud Samir Fayed
 
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
GITS Indonesia
 
Groovy And Grails JUG Padova
John Leach
 
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Applitools
 

Similar to Hybrid Apps (Native + Web) using WebKit (20)

PDF
Hybrid Apps (Native + Web) via QtWebKit
Ariya Hidayat
 
PDF
Introduction to QtWebKit
Ariya Hidayat
 
PDF
Analyzing the Performance of Mobile Web
Ariya Hidayat
 
PDF
Developments in the Qt WebKit Integration
account inactive
 
PDF
Next Generation Hybrid Applications with Qt - presentation for SEE 2009
Nokia
 
KEY
HTML5 and the Future of Apps
Tom Croucher
 
PDF
Guides To Analyzing WebKit Performance
National Cheng Kung University
 
PDF
The WebKit project
juanjosanchezpenas
 
PDF
Mobile Widgets Development
Maximiliano Firtman
 
PDF
Inside Mobile Widgets Publish
360|Conferences
 
PDF
appborg, coffeesurgeon, moof, logging-system
endian7000
 
PDF
An Introduction to Sencha Touch
James Pearce
 
PDF
Copy Your Favourite Nokia App with Qt
account inactive
 
PDF
A More Flash Like Web?
Murat Can ALPAY
 
PDF
HTML5 and Google Chrome - DevFest09
mihaiionescu
 
PPTX
HTML5 for Rich User Experience
Mahbubur Rahman
 
KEY
Mobile Web Apps: State of the Tools
Ernesto Jiménez
 
PDF
Cutest technology of them all - Forum Nokia Qt Webinar December 2009
Nokia
 
KEY
End of native?
Yuki Naotori
 
PDF
Implementing new WebAPIs
Julian Viereck
 
Hybrid Apps (Native + Web) via QtWebKit
Ariya Hidayat
 
Introduction to QtWebKit
Ariya Hidayat
 
Analyzing the Performance of Mobile Web
Ariya Hidayat
 
Developments in the Qt WebKit Integration
account inactive
 
Next Generation Hybrid Applications with Qt - presentation for SEE 2009
Nokia
 
HTML5 and the Future of Apps
Tom Croucher
 
Guides To Analyzing WebKit Performance
National Cheng Kung University
 
The WebKit project
juanjosanchezpenas
 
Mobile Widgets Development
Maximiliano Firtman
 
Inside Mobile Widgets Publish
360|Conferences
 
appborg, coffeesurgeon, moof, logging-system
endian7000
 
An Introduction to Sencha Touch
James Pearce
 
Copy Your Favourite Nokia App with Qt
account inactive
 
A More Flash Like Web?
Murat Can ALPAY
 
HTML5 and Google Chrome - DevFest09
mihaiionescu
 
HTML5 for Rich User Experience
Mahbubur Rahman
 
Mobile Web Apps: State of the Tools
Ernesto Jiménez
 
Cutest technology of them all - Forum Nokia Qt Webinar December 2009
Nokia
 
End of native?
Yuki Naotori
 
Implementing new WebAPIs
Julian Viereck
 
Ad

More from Ariya Hidayat (7)

PDF
Understanding Webkit Rendering
Ariya Hidayat
 
PDF
Understanding Hardware Acceleration on Mobile Browsers
Ariya Hidayat
 
PDF
Understanding Hardware Acceleration on Mobile Browsers
Ariya Hidayat
 
PDF
JavaScript Parser Infrastructure for Code Quality Analysis
Ariya Hidayat
 
PDF
Build HTML5 App (Intel Elements 2011)
Ariya Hidayat
 
PDF
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
PDF
Efficient Graphics with Qt
Ariya Hidayat
 
Understanding Webkit Rendering
Ariya Hidayat
 
Understanding Hardware Acceleration on Mobile Browsers
Ariya Hidayat
 
Understanding Hardware Acceleration on Mobile Browsers
Ariya Hidayat
 
JavaScript Parser Infrastructure for Code Quality Analysis
Ariya Hidayat
 
Build HTML5 App (Intel Elements 2011)
Ariya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Efficient Graphics with Qt
Ariya Hidayat
 
Ad

Recently uploaded (20)

PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 

Hybrid Apps (Native + Web) using WebKit

  • 1. Hybrid Apps (Native + Web) using WebKit ARIYA HIDAYAT, SENCHA
  • 4. Going Hybrid? Platform Integration Security App Store/ Advanced Technologies Marketplace
  • 5. WebKit Everywhere Browser Devices Runtime
  • 6. ~2000 commits/month History 90000 80000 70000 60000 Revisions 50000 40000 30000 20000 10000 0 0 1 2 3 4 5 6 7 8 9 10 Years
  • 7. Extensive Tests ≈ 20,000 tests tests 904 MB the rest 229 MB
  • 8. Workflow quality control 1 Every commit needs to be reviewed 2 Broken commit must be reverted zero-regression policy
  • 9. Level of Involvement Contributor after 10-20 patches after 80 patches Committer ≈ 150 Reviewer checks in reviewed patches ≈ 90 accept or reject patches
  • 10. WebKit Reviewers Apple 39 Google 25 Misc 11 1 RIM Nokia 7 7
  • 11. Components of WebKit DOM CSS WebCore SVG HTML rendering JavaScriptCore WebKit Library
  • 12. Platform Abstractions Network Unicode Clipboard Graphics Theme Events Thread Geolocation Timer
  • 13. WebCore Di erent “Ports” graphics GraphicsContext Mac Chromium Qt Gtk Skia Cairo CoreGraphics QPainter graphics stack
  • 14. Use
  • 15. Web Browsers Arora Demo Browser http://arora.googlecode.com demos/browser
  • 16. QWebView, QWebPage, QWebFrame QWebView (widget) QWebPage (object) QWebFrame (object) At least one, i.e. the main frame of the page
  • 17. Using WebView QWebView webView; webView.show(); webView.setUrl(QUrl("http://meego.com"));
  • 18. Contents via String QWebView webView; webView.show(); webView.setContent("<body>Hello, MeeGo!</body>");
  • 19. Contents via Resource <RCC> <qresource prefix="/"> <file>content.html</file> </qresource> </RCC> QWebView webView; webView.show(); webView.setUrl(QUrl("qrc:/content.html"));
  • 20. Capture to Image QWebPage page; QImage image(size, QImage::Format_ARGB32_Premultiplied); image.fill(Qt::transparent); QPainter p(&image); page.mainFrame()->render(&p); p.end(); image.save(fileName); http://labs.qt.nokia.com/2009/01/15/capturing-web-pages/
  • 21. SVG Rasterizer http://labs.qt.nokia.com/2008/08/06/webkit-based-svg-rasterizer/
  • 22. Search + Preview http://labs.qt.nokia.com/2008/11/04/search-with-thumbnail-preview/
  • 24. Exposing to the Web world QWebFrame::addToJavaScriptWindowObject(QString, QObject*) Public functions Object properties Child objects
  • 25. Exposing to the Web world page()->mainFrame()->addToJavaScriptWindowObject("Dialog", new Dialog); class Dialog: public QObject { Q_OBJECT public: Dialog(QObject *parent = 0); public slots: void showMessage(const QString& msg); };
  • 26. Exposing to the Web world <input type="button" value="Try this" onClick="Dialog.showMessage('You clicked me!')"> instance of public slot Dialog object
  • 27. Signal and Slot signal foobar.modified.connect(refresh); QObject instance JavaScript function foobar.modified.connect(obj, refresh); any object
  • 28. Triggering Action from Native class Stopwatch: public QObject { Stopwatch::Stopwatch(QObject *parent) Q_OBJECT : QObject(parent) , m_index(0) public: { Stopwatch(QObject *parent = 0); QTimer *timer = new QTimer(this); timer->setInterval(1000); signals: connect(timer, SIGNAL(timeout()), SLOT(update())); void tick(int t); timer->start(); } private slots: void update(); void Stopwatch::update() { private: emit tick(m_index++); int m_index; } };
  • 29. Triggering Action from Native instance of Stopwatch object signal <script> Stopwatch.tick.connect(function(t) { document.getElementById('tick').innerText = t; }); </script>
  • 30. Coming back to the Native QVariant QWebFrame::evaluateJavaScript(QString) mostly key-value pair (like JavaScript objects)
  • 31. Other Bridging Solutions Custom network protocol QNetworkAccessManager http://labs.qt.nokia.com/2010/11/16/some-webkit-hybrid-stu /
  • 32. Platform Integration Menu and Menu Bar Dialogs Application System Access Notifications
  • 33. Debugging Web Inspector settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
  • 34. Deployment O ine Packaging Cache Manifest QtWebKit boilerplate Local Storage Tools PhoneGap AppUp Encapsulator
  • 35. Real-world Hybrid Apps Ext Designer Sencha Animator
  • 40. Content Editing http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/
  • 42. Vector Graphics http://raphaeljs.com/polar-clock.html
  • 43. Canvas-based Game http://ariya.blogspot.com/2010/09/invade-destroy.html
  • 44. Diagrams & Visualization JavaScript InfoVis Toolkit http://thejit.org/
  • 45. CSS3 Animations http://mozillademos.org/demos/planetarium/demo.html
  • 48. Device Access http://ariya.github.com/js/marblebox/
  • 49. WebGL for 3-D http://webglsamples.googlecode.com/hg/aquarium/aquarium.html
  • 50. PhiloGL: WebGL Framework http://senchalabs.github.com/philogl/
  • 51. Tools
  • 53. Network Log 28: GET http://www.google.com/m/gp 292: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp 311: GET data:image/gif;base64,R0lGODlhiA... 312: GET data:image/gif;base64,R0lGODlhJA... 312: GET data:image/gif;base64,R0lGODlhGA... 312: Response 0 image/gif 3611 bytes data:image/gif;base64,R0lGODlhiA... 312: Finish fail data:image/gif;base64,R0lGODlhiA... 312: Response 0 image/gif 284 bytes data:image/gif;base64,R0lGODlhJA... 312: Finish fail data:image/gif;base64,R0lGODlhJA... 312: Response 0 image/gif 178 bytes data:image/gif;base64,R0lGODlhGA... 312: Finish fail data:image/gif;base64,R0lGODlhGA... 317: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp 324: Finish fail http://www.google.com/m/gp 328: GET http://www.google.com/m/gn/user?... 329: Finish success http://www.google.com/m/gn/user?...
  • 54. Typical Scenario This is awesome! un t to r forge ests the t
  • 55. Test Framework specrunner SpecRunner.html 5 specs, 0 failures in 0.013s specrunner SpecRunner.html FAIL: 5 specs, 1 failure in 0.014s Selenium, Watir, Squish Web, JSUnit, Jasmine, QUnit, ...
  • 56. Headless WebKit if (phantom.state.length === 0) {     phantom.state = 'pizza';     phantom.open('http://www.google.com/m/local?site=local&q=pizza+in+new+york'); } else {     var list = document.querySelectorAll('div.bf');     for (var i in list) {         console.log(list[i].innerText);     }     phantom.exit(); } http://phantomjs.org
  • 62. Using git git clone git://git.webkit.org/WebKit.git cd WebKit ≈ 1.2 GB .git
  • 63. Build Tools/Scripts/build-webkit --qt --debug for “Debug” mode
  • 66. Today Web technologies are moving really fast Various frameworks and libraries boost the productivity Hybrid approach helps the migration Tools need to catch-up
  • 67. Future More bindings to the native world Platinum-grade productivity tools Ubiquitous mesh and cloud solutions
  • 68. THANK YOU! [email protected] ariya.blogspot.com ariyahidayat