Contenu connexe Similaire à Introduction to QtWebKit Similaire à Introduction to QtWebKit (20) Introduction to QtWebKit5. History ~2000 commits/month
90000
80000
70000
60000
Revisions
50000
40000
30000
20000
10000
0
0 1 2 3 4 5 6 7 8 9 10
Years
5
7. Workflow
quality control
1 Every commit needs to be reviewed
2 Broken commit must be reverted
zero-regression policy
7
8. Level of Involvement
Contributor
after 10-20 patches
after 80 patches
Committer
≈ 130 Reviewer
checks in reviewed patches
≈ 80
accept or reject patches
8
12. WebCore
Di erent “Ports” graphics
GraphicsContext Mac Chromium Qt Gtk
Skia Cairo
CoreGraphics
QPainter
graphics stack
12
19. 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/
19
23. Exposing to the Web world
QWebFrame::addToJavaScriptWindowObject(QString, QObject*)
Public functions
Object properties
Child objects
23
24. Signal and Slot
signal
foobar.modified.connect(refresh);
QObject instance JavaScript function
foobar.modified.connect(obj, refresh);
any object
24
25. Coming back to the Native
QVariant QWebFrame::evaluateJavaScript(QString)
mostly key-value pair
(like JavaScript objects)
25
26. Other Bridging Solutions
Custom network protocol
QNetworkAccessManager
http://labs.qt.nokia.com/2010/11/16/some-webkit-hybrid-stu /
26
27. Deployment
O ine Packaging
Cache Manifest
QtWebKit boilerplate
Local Storage
27
39. WebGL for 3-D
http://webglsamples.googlecode.com/hg/aquarium/aquarium.html
39
43. 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?...
43
46. 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
46
52. Today
Web technologies are moving really fast
Various frameworks and libraries boost the productivity
Hybrid approach helps the migration
Tools need to catch-up
52
53. Future
More bindings to the native world
Platinum-grade productivity tools
Ubiquitous mesh and cloud solutions
53
54. THANK YOU!
ariya @ kde.org
ariya.blogspot.com
ariyahidayat
54