tag:blogger.com,1999:blog-34168072024-03-13T19:52:39.483-07:00We Have The Construction!Rantings and Ravings about WebKit, Graphics, and functional programming.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.comBlogger121125tag:blogger.com,1999:blog-3416807.post-244048295880651422013-09-12T23:53:00.004-07:002013-09-13T23:57:16.915-07:00WebGL Continues to Plug AlongEven though Alex Christensen has gone back to school for the summer, I'm still playing with his WebGL code. Previously the performance was completely unusable, but some of the <a href="http://www.tidesdk.org/">TideSDK</a> guys pointed out some logging that had inadvertently been left on.<br />
<br />
The result is a credible (though modest) 15 FPS on the previously-unusable <a href="http://webglsamples.googlecode.com/hg/aquarium/aquarium.html">Aquarium</a> example.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaiTTXb0_KcJsKf7XdV5ciZwbHB2AgKyPdB7_l2CNPQXmrDwnrYKw_Ap5uebpCBReSSdXhHbiNR2wXxsBP4Y3IVRY3XfHEzlv3PjjbZFMS-ka9XOalzrxf8v9spj57HIDOCsLr/s1600/Screen+Shot+2013-09-12+at+11.46.37+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaiTTXb0_KcJsKf7XdV5ciZwbHB2AgKyPdB7_l2CNPQXmrDwnrYKw_Ap5uebpCBReSSdXhHbiNR2wXxsBP4Y3IVRY3XfHEzlv3PjjbZFMS-ka9XOalzrxf8v9spj57HIDOCsLr/s320/Screen+Shot+2013-09-12+at+11.46.37+PM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSISVckrCRfXIIJV_LCDKYzWagB2MGprscBkTBET9zckYrBsrkkPdBqdRNrVDsTlKAut8Gg-ZTwUrDvsGez0egfwZCp1TQgE5AJi7VIUoSz5MwRt0bgOgO12lYDTMVp68BCikL/s1600/Screen+Shot+2013-09-12+at+11.22.14+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSISVckrCRfXIIJV_LCDKYzWagB2MGprscBkTBET9zckYrBsrkkPdBqdRNrVDsTlKAut8Gg-ZTwUrDvsGez0egfwZCp1TQgE5AJi7VIUoSz5MwRt0bgOgO12lYDTMVp68BCikL/s320/Screen+Shot+2013-09-12+at+11.22.14+PM.png" width="320" /></a></div>
<br />
Hopefully things will continue to improve over the next few weeks!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com1tag:blogger.com,1999:blog-3416807.post-37451329435549795072013-08-20T22:55:00.001-07:002013-08-20T22:55:27.590-07:00Steps towards a new Web InspectorThose of you who follow the <a href="https://www.webkit.org/blog/2518/state-of-web-inspector/">Surfin' Safari</a> blog may remember that Apple recently Open Sourced the new Web Inspector shipping with the forthcoming version of Safari and Mac OS. You might even have tried the <a href="https://developer.apple.com/devcenter/safari/index.action">Developer Preview</a> to see how it worked.<br />
<br />
At the time there was some discussion about the fact that the original inspector was no longer being actively maintained, and some encouragement to other ports to migrate to the new infrastructure as soon as possible.<br />
<br />
I'm very pleased to announce that we are close to landing <a href="https://bugs.webkit.org/show_bug.cgi?id=120098">changes to the Windows and WinCairo ports</a> that will enable this awesome new development environment for those ports.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl9-g-rQ_FFGvtG-sDyQp8I25Hq779-BrrV1DdordXTeJ_tb7w0BcejkwOqBtr_moxmnVn7Ukk0492W169PKHQllZBgR-zu36EqLELLWoBf2X4C1a-vQry63myIrPzucHVG5rH/s1600/New_Inspector_Windows.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="269" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl9-g-rQ_FFGvtG-sDyQp8I25Hq779-BrrV1DdordXTeJ_tb7w0BcejkwOqBtr_moxmnVn7Ukk0492W169PKHQllZBgR-zu36EqLELLWoBf2X4C1a-vQry63myIrPzucHVG5rH/s320/New_Inspector_Windows.png" width="320" /></a></div>
<br />
There's still some work to be done: there are a few missing folder graphics, short cuts probably don't have the right key combinations, and I noticed that some 'localized strings' don't seem to be properly encoded. But the core functionality works, and now Windows users can access shadow DOM elements, check load times, and examine the size of resources retrieved from a website.<br />
<br />
For example, who knew that I downloaded a megabyte of material from the YouTube website each time it nags me that I don't have Flash Installed?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrKTRCid-eAcVFKN-TpCcKdjZmP7EWpOF-8NJMV1Kgdy-mXaRWqm3BzqqBwnCuvGzT-tGW_GghVmFH-7olzFxZLSgzDjwC2TRfg8mf842rZFdFTG7gxiXQUlzh68RuR021mK1Z/s1600/YouTube_Example.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="29" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrKTRCid-eAcVFKN-TpCcKdjZmP7EWpOF-8NJMV1Kgdy-mXaRWqm3BzqqBwnCuvGzT-tGW_GghVmFH-7olzFxZLSgzDjwC2TRfg8mf842rZFdFTG7gxiXQUlzh68RuR021mK1Z/s320/YouTube_Example.png" width="320" /></a></div>
<br />bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com4tag:blogger.com,1999:blog-3416807.post-87226343779298944772013-08-05T22:53:00.001-07:002013-08-05T22:53:51.741-07:00WebGL, at last!It's been a long time since I've written an update -- but my lack of blog posting is not an indication of a lack of progress in WebKit or the WinCairo port. Since I left my former employer (who *still* hasn't gotten around to updating the build machine I set up there), we've:<br />
<br />
<ul>
<li>Migrated from Visual Studio 2005 to Visual Studio 2010 (and soon, VS2012)</li>
<li>Enabled New-run-webkit-tests</li>
<li>Updated the WinCairo Support Libraries to support 64-bit builds</li>
<li>Integrated a ton of cURL improvements and extensions thanks to the <a href="http://www.tidesdk.org/">TideSDK</a> guys </li>
<li>and ...</li>
</ul>
<div>
... thanks to the hard work of Alex Christensen, brought up WebGL on the WinCairo port. This is a little exciting for me, because it marks the first time (I can recall) where the WinCairo port actually gained a feature that was not already part of the core Apple Windows port.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhavs9Ndu2QIUxtDU6Sd6JcFTYTFMTmww2BwKPp9jUdnu7RAEJYAyStPJ37fE1va1tRivIjsdOdogQ6Sx-oet2p1WoOMtThwKhyphenhypheneJGooUdSnyr1vPiqWXCyn1S8zjwLBmcVcT23/s1600/WebGL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhavs9Ndu2QIUxtDU6Sd6JcFTYTFMTmww2BwKPp9jUdnu7RAEJYAyStPJ37fE1va1tRivIjsdOdogQ6Sx-oet2p1WoOMtThwKhyphenhypheneJGooUdSnyr1vPiqWXCyn1S8zjwLBmcVcT23/s320/WebGL.png" width="320" /></a></div>
<div>
<br /></div>
<br />
The changes needed to see these circa-1992 graphics in all their three-dimensional glory are already landed in the WebKit tree. You just need to:<br />
<br />
<ol>
<li>Enable the libEGL, libGLESv2, translator_common, translator_glsl, and translator_hlsl for the WinCairo build (they are currently turned off).</li>
<li>Make the following change to WTF/wtf/FeatureDefines.h: </li>
</ol>
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Brent Fulgham@WIN7-VM ~/WebKit/Source/WTF/wtf</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">$ svn diff</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Index: FeatureDefines.h</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">===================================================================</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">--- FeatureDefines.h (revision 153733)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+++ FeatureDefines.h (working copy)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">@@ -245,6 +245,13 @@</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> #define ENABLE_VIEW_MODE_CSS_MEDIA 0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> #endif</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+#define ENABLE_WEBGL 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+#define WTF_USE_3D_GRAPHICS 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+#define WTF_USE_OPENGL 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+#define WTF_USE_OPENGL_ES_2 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+#define WTF_USE_EGL 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+#define WTF_USE_GRAPHICS_SURFACE 1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">+</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> #endif /* PLATFORM(WIN_CAIRO) */</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> /* --------- EFL port (Unix) --------- */</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
Performance is a little ragged, but we hope to improve that in the near future.<br />
<br />
We have plenty of more plans for the future, including full 64-bit support (soon), and hopefully some improvements to the WinLauncher application to make it a little more useful.<br />
<br />
As always, if you would like to help out,bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-17926440626240482482012-06-24T21:06:00.000-07:002012-06-24T21:06:56.228-07:00<h1>
OpenGL Cairo Backend</h1>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVwQzRS0BfdGwrIDyckhEgPxt_AxbzpcKXXgBpYOCd5yjYSKPjfyhCCBhtyrFf_tmL-jNb2G9-uwIlITy5cMTxU2-XbWHoyVSm1jWhB3qCwK4d-UOY_z2WMNBh4-abAnpRh22k/s1600/Screen+Shot+2012-06-24+at+9.02.25+PM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVwQzRS0BfdGwrIDyckhEgPxt_AxbzpcKXXgBpYOCd5yjYSKPjfyhCCBhtyrFf_tmL-jNb2G9-uwIlITy5cMTxU2-XbWHoyVSm1jWhB3qCwK4d-UOY_z2WMNBh4-abAnpRh22k/s320/Screen+Shot+2012-06-24+at+9.02.25+PM.png" width="310" /></a>
I've been trying to get the OpenGL backend working under Windows, and have finally gotten a simple test application to work.<br />
<br />
The next step is to attempt to tie in the various Cairo GL routines in the WebKit tree to see if we can get any hardware accelerated action on the 3D CSS and perhaps WebGL fronts.<br />
<br />
I'm in the process of updating the WinCairoRequirements tree with the changes (as well as pushing them upstream), and should have it wrapped up some time tomorrow.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-81033924135425661252012-06-13T20:11:00.000-07:002012-06-13T20:11:17.354-07:00<h1>
Updates Galore</h1>
After an extremely long delay, I have finally been able to devote a little time to WebKit hacking. Over the past couple of days I have completed the following:
<br />
<ul>
<li>Updated the <a href="https://github.com/bfulgham/WinCairoRequirements">WinCairoRequirements</a> source repository:
<ul>
<li>Cairo (version 1.12.2)</li>
<li>ICU (version 4.6.1, With Apple's 10.7.4 updates)</li>
<li>libxml2 (version 2.8.0)</li>
<li>libxslt (version 1.1.26)</li>
<li>libpng (version 1.5.10)</li>
<li>OpenCFLite (version 635.21)</li>
<li>Pixman (version 0.26.0)</li>
<li>SQLite (version 3.7.7.1)</li>
<li>zlib (version 1.2.7)</li>
</ul>
Note that anything I don't mention here is the same version as before. I also updated the build solutions for VS2005, VS2008, and VS2010.
</li>
<li>
Posted a <a href="http://dl.dropbox.com/u/39598926/WebKit_WinCairo_VS2008_VS2010.patch">patch</a> against WebKit rev 120024 that allows you to build with either Visual Studio 2008 or Visual Studio 2010.</li>
<li>And finally, I've moved the <a href="http://dl.dropbox.com/u/39598926/WinCairoRequirements.zip">WinCairoRequirements.zip</a> file from my soon-to-be-defunct iDisk to DropBox. As of <a href="https://trac.webkit.org/changeset/120235">r120235</a> the system should automatically grab the build dependencies from the new location. Please let me know if this does not work for you.</li>
</ul>
I'm hoping to devote a lot more time to WebKit over the next few weeks, and hope to focus on the glaring lack of 3D CSS support. I'd love to hear from anyone interested in helping out!
If you haven't used the WinCairo build recently, I suggest you give it a try with the updated Cairo release. Cairo 1.12.2 has significantly speed up several operations, and so 2D graphical work is faster than ever!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com1tag:blogger.com,1999:blog-3416807.post-31454065829373880242012-01-27T23:47:00.001-08:002012-01-27T23:47:20.184-08:00Github Archive Now Available<p>Based on popular request, I've published my full build tree for generating the WinCairoRequirements bundle needed to build the WinCairo port.</p><p>You can access it at <a href="http://github.com/bfulgham/WinCairoRequirements">Github</a>.</p><p>It contains build targets for:</p><ul><li>VS2005, which is needed for compatibility with the main WebKit development effort.</li><li>VS2008, which I used on my last shipping application, and</li><li>VS2010 for new development.</li></ul><p>While I was at it, I also published <a href="http://github.com/bfulgham/CallJS">CallJS</a>, an example application exercising theWebKit framework, and provides an example of doing things like communicating between a WinApi application and the WebKit and JavaScriptCore instances.</p><p>Hopefully, these resources will make it easier for people to get started using, and perhaps contributing, to WebKit.</p><p>If you do try them out, please drop me a line and let me know if you had any difficulties.</p> bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-83293712714354534342011-10-08T19:30:00.001-07:002011-10-08T19:44:56.363-07:00Tests Active<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBLx-1i3PdOEQZBSxRv7hDcG3qCPgkcgL5JI1XnxD02slBlgNWfXRbEm2DQAnnph-G2BPZ4ConYT82n9VFL10ddEw9rUEk8jCxdvS7sCCZN9XmLQV2w2Htzwh9U66tg-f5TN9G/s1600/IMG_1436.JPG"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 239px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBLx-1i3PdOEQZBSxRv7hDcG3qCPgkcgL5JI1XnxD02slBlgNWfXRbEm2DQAnnph-G2BPZ4ConYT82n9VFL10ddEw9rUEk8jCxdvS7sCCZN9XmLQV2w2Htzwh9U66tg-f5TN9G/s320/IMG_1436.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5661316357377097202" /></a><br />Looking back over this blog, I see that it was around a year ago that I got the initial WinCairo buildbot running. I'm very pleased to announce that I have gotten ahold of a much more powerful machine, and am now able to run a full build and tests in slightly under an hour -- a huge improvement over the old hardware which took over two hours just to build the software! In fact, the image on the left shows the new build box, but unfortunately the flash on my iPhone wiped out the machine's label ("Webkit") on the rack faceplate.<br /><br />This is a big step, because we can now track regressions and gauge correctness compared to the other platforms. Up to now, testing has largely consisted of periodic manual runs of the test suite, and a separate set of high-level tests run as part of a larger application. This was not ideal, because it was easy for low-level functions in WebKit that I rarely use to be broken and missed.<br /><br />All is not perfect, of course. Although over 12,000 tests now run (successfully) with each build, that is effectively two thirds of the full test suite. Most of the tests I have disabled are due to small differences in the output layout. I'm trying to understand why these differences exist, but I suspect many of them simply reflect small differences in Cairo compared to the CoreGraphics rendering layer.<br /><br />If any of you lurkers are interested in helping out, trying out some of the tests I have disabled and figuring out why they fail would be a <strong>huge</strong> help!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com2tag:blogger.com,1999:blog-3416807.post-84716913325486096632011-10-08T19:30:00.000-07:002011-10-08T19:43:18.400-07:00Tests Active<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBLx-1i3PdOEQZBSxRv7hDcG3qCPgkcgL5JI1XnxD02slBlgNWfXRbEm2DQAnnph-G2BPZ4ConYT82n9VFL10ddEw9rUEk8jCxdvS7sCCZN9XmLQV2w2Htzwh9U66tg-f5TN9G/s1600/IMG_1436.JPG"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 239px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBLx-1i3PdOEQZBSxRv7hDcG3qCPgkcgL5JI1XnxD02slBlgNWfXRbEm2DQAnnph-G2BPZ4ConYT82n9VFL10ddEw9rUEk8jCxdvS7sCCZN9XmLQV2w2Htzwh9U66tg-f5TN9G/s320/IMG_1436.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5661316357377097202" /></a><br />Looking back over this blog, I see that it was around a year ago that I got the initial WinCairo buildbot running. I'm very pleased to announce that I have gotten ahold of a much more powerful machine, and am now able to run a full build and tests in slightly under an hour -- a huge improvement over the old hardware which took over two hours just to build the software!<br /><br />This is a big step, because we can now track regressions and gauge correctness compared to the other platforms. Up to now, testing has largely consisted of periodic manual runs of the test suite, and a separate set of high-level tests run as part of a larger application. This was not ideal, because it was easy for low-level functions in WebKit that I rarely use to be broken and missed.<br /><br />All is not perfect, of course. Although over 12,000 tests now run (successfully) with each build, that is effectively two thirds of the full test suite. Most of the tests I have disabled are due to small differences in the output layout. I'm trying to understand why these differences exist, but I suspect many of them simply reflect small differences in Cairo compared to the CoreGraphics rendering layer.<br /><br />If any of you lurkers are interested in helping out, trying out some of the tests I have disabled and figuring out why they fail would be a <strong>huge</strong> help!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com1tag:blogger.com,1999:blog-3416807.post-82807036674387378652011-07-05T12:35:00.000-07:002011-07-05T12:39:32.939-07:00WinCairoRequirements Sources ArchiveI've <a href="https://files.me.com/bfulgham/trnbu7">posted</a> the 80 MB source archive of the requirements needed to build the WinCairo port of WebKit.<br /><br />Note that you do NOT need these sources unless you plan on building them yourself or wish to archive the source code for these modules. The binaries are always present in the <a href="https://files.me.com/bfulgham/rtdib3">WinCairoRequirements.zip</a> file, which is downloaded and unzipped to the proper place when you execute the <code>update-webkit --wincairo</code> command.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com10tag:blogger.com,1999:blog-3416807.post-69436733897093794492011-06-27T21:27:00.000-07:002011-07-09T21:24:00.144-07:00Updated WebKit SDK (@r89864)I have updated the WebKitSDK to correspond to SVN revision r8984.<br /><br />Major changes in this revision:<br />* JavaScript engine improvements.<br />* Rendering improvements.<br />* New 'Transparent Web View' support.<br />* General performance and memory use improvements.<br /><br />This ZIP file also contains updated versions of Zlib, OpenSSL, cURL, and OpenCFLite.<br /><br />Note that I have stopped statically linking Cairo; I'm starting to integrate some more recent Cairo updates (working towards some new rendering features), and wanted to be able to update it incrementally as changes are made.<br /><br />This package contains the same Cairo library (in DLL form) as used in previous versions.<br /><br />As usual, please let me know if you encounter any problems with this build.<br /><br />[Update] I forgot to include zlib1.dll! Fixed in the revised zip file.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com4tag:blogger.com,1999:blog-3416807.post-85242689178737272312011-04-29T23:54:00.000-07:002011-07-14T11:34:23.677-07:00An Unseasonable SnowfallA year or two ago I ported the Cocoa "CallJS" application to MFC for use with WebKit. The only feedback I ever got on the topic was a complaint that it would not build under the Visual Studio Express software many people used.<br /><br />After seeing another few requests on the <a href="http://lists.webkit.org/mailman/listinfo/webkit-help">webkit-help</a> mailing list for information on calling JavaScript from C++ (and vice-versa), I decided to dust off the old program and convert it to pure WINAPI calls so that VS Express would work with it.<br /><br />Since my beloved <a href="http://whtconstruct.blogspot.com/2011/04/transparent-windows.html">Layered Window</a> patches finally <a href="http://trac.webkit.org/changeset/84990">landed</a> in WebKit, I also incorporated a transparent WebKit view floating over the main application window. Because I suck at art, I <strike>stole</strike> appropriated the <a href="http://girliemac.com/blog/2009/02/18/using-keyframes-webkit-css-animation-examples/">Let It Snow</a> animation example to give the transparent layer something to do.<br /><br />Want to see what it looks like?<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl9ViZ1J7yenw-d69nidsiQ3Y-rDmS4mECXKfL6xthc26dFzyIUxcsMFoyMcvlp2eD0Ozpoh4cEjy44wymPsxIEj3amv6iWTqGwbADCzNLUrOe_gFTTRuOc2IqQS-_QpnvtBnW/s1600/Screen+shot+2011-04-29+at+11.13.04+PM.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 293px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl9ViZ1J7yenw-d69nidsiQ3Y-rDmS4mECXKfL6xthc26dFzyIUxcsMFoyMcvlp2eD0Ozpoh4cEjy44wymPsxIEj3amv6iWTqGwbADCzNLUrOe_gFTTRuOc2IqQS-_QpnvtBnW/s320/Screen+shot+2011-04-29+at+11.13.04+PM.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5601268290472590386" /></a>bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com4tag:blogger.com,1999:blog-3416807.post-16539111453184851132011-04-18T17:13:00.001-07:002011-04-18T17:32:11.255-07:00Transparent Windows<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrVHWsfHr8YHc4Uo7P84pax1tTXa4BQMVSf8_kWat239C9CoEOM_r5HY3TB_ss-FQLkSeeGrFgJZQk9KI41N06hGSaeddrJLOeNiRAInRzT9lr3orV_Sp484kShAeIvFzCPhL9/s1600/Screen+shot+2011-04-18+at+5.12.07+PM.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 306px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrVHWsfHr8YHc4Uo7P84pax1tTXa4BQMVSf8_kWat239C9CoEOM_r5HY3TB_ss-FQLkSeeGrFgJZQk9KI41N06hGSaeddrJLOeNiRAInRzT9lr3orV_Sp484kShAeIvFzCPhL9/s320/Screen+shot+2011-04-18+at+5.12.07+PM.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5597081347946224034" /></a><br />Recently I've been hard at work reviving some old code originally written by the <a href="http://www.appcelerator.com/">Appcelerator</a> team. I tried to improve on the initial design by building the feature into the WebKit library itself. This reduces the need for clients of this functionality to have to figure out exactly how to construct their windows, and perform the layered window drawing logic.<br /><br />With this patch in place, you can create 'chromeless' WebKit windows that you can fill with whatever rendering content you like. For example, you can tell WebKit to fill your entire desktop with a WebView that points at a copy of the awesome <a href="http://localhost/~brent/www.satine.org/research/webkit/snowleopard/snowstack.html">Snowstack</a> implementation. Of course, to get a transparent view you have to be able to set the background color to something semi- (or fully) transparent. Consequently, I had to mirror Snowstack on a server I had access to so I could adjust the background. The screenshot shows the result of this effort. <br /><br />I'm hoping to get the changes approved and landed soon, once I've created a decent example program that can be landed in the tree.<br /><br />Oh, by the way, this change works on the Apple version of WebKit as well!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-23140550805627792552011-04-12T19:47:00.000-07:002011-06-27T21:42:19.138-07:00Towards a Simpler WinCairo Build<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRehjBF_nrnrFTp7GI_NxvEnhhcx1mTYK1lz6xiMTHTz97rC_-mHfQrGVJuM27jqZts89LRfzUS6C2lgMm0DYwv8Irik7BZc8lCQXrzyfSKDpjW-Rb5I6hGQc2owcHD8XgGskp/s1600/Screen+shot+2011-04-12+at+8.29.56+PM.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 163px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRehjBF_nrnrFTp7GI_NxvEnhhcx1mTYK1lz6xiMTHTz97rC_-mHfQrGVJuM27jqZts89LRfzUS6C2lgMm0DYwv8Irik7BZc8lCQXrzyfSKDpjW-Rb5I6hGQc2owcHD8XgGskp/s320/Screen+shot+2011-04-12+at+8.29.56+PM.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5594905536619589122" /></a><br />For the past couple of years, anyone interested in trying to build the WinCairo port of <a href="http://webkit.org/">WebKit</a> had to track down a number of support libraries, place them in their development environment's include (and link search) paths, and then cross their fingers and hope everything built.<br /><br />To make things a little easier, I wrapped up the libraries and headers I use for building and posted them as a zip file on my .Mac account. This made things a little easier, but you still had to figure out where to drop the files and figure out if I had secretly updated my 'requirements.zip' file without telling anyone. Not ideal.<br /><br />A couple of days ago, while trolling through the open review queue, I ran across a <a href="https://bugs.webkit.org/show_bug.cgi?id=51790">Bug</a> filed by Carl Lobo, which automated the task of downloading the requirements file when running <strong>build-webkit --wincairo</strong>. This was a huge improvement!<br /><br />Today, I hijacked Carl's changes and railroaded the patch through the review process (making a few modifications along the way):<br /><ul><br /><li>I renamed my requirements file <a href="https://files.me.com/bfulgham/mr8nd0">WinCairoRequirements.zip</a>.</li><br /><li>I added a timestamp file, so that <strong>build-webkit --wincairo</strong> can check to see if the file changed, and download it if necessary.</li><br /><li>I propagated Carl's changes to <strong>update-webkit</strong>, so that now by adding the <strong>--wincairo</strong> argument it will update the WinCairoRequirements file.</li><br /></ul><br />I'm really excited about this update. If you've been wanting to try out the WinCairo port of WebKit, this would be a great time to try it out. I'd love to hear your experiences!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com9tag:blogger.com,1999:blog-3416807.post-34930112077609799622011-03-30T19:50:00.000-07:002011-03-30T20:03:01.908-07:00Core Builder!Several months ago I posted to report that I had built and activated a <a href="http://build.webkit.org/waterfall?show=WinCairo%20Debug%20(Build)">WebKit BuildSlave</a>. I'm pleased to report that our Build Slave is all grown up, and has been promoted to <a href="http://build.webkit.org/waterfall?category=core">Core Builder</a> status.<br /><br />Fundamentally, nothing has really changed. It's just as easy for an errant check-in to cause the build to break. But on a social level this promotion is quite meaningful. It indicates that we (alas, the "Royal We") claim that the WinCairo port is an active, viable version of WebKit. Core builder status also helps apply social pressure for external developers to keep the WinCairo build green, as it is very poor form to break the build.<br /><br />Now that we've reached this new lofty tier of project visibility, I'm hopeful that we will see fewer build failures. We will almost certainly get better feedback when the build is failing, and probably get help from parties interested in keeping the tree green.<br /><br />I'm very excited about this change, and I hope you'll keep an eye on things to see how they progress!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com1tag:blogger.com,1999:blog-3416807.post-80166247181148457162010-10-06T21:32:00.000-07:002010-10-07T09:11:51.965-07:00At Last: A BuildBot!It's taken me nearly two years to get all of the stars in alignment, but I am very excited to announce that we now have a WinCairo build bot up and running. If you look at the <a href="http://build.webkit.org/waterfall">WebKit Buildbot</a>, you can find the new entry for it (and it's even currently green!) Better look quick -- who knows how long it will last!<br /><br />I have not activated any test phases yet, since none of the pixel level tests have been generated, but this will come in time (hint, hint Mr. Martin Robinson...)<br /><br />The whole process of getting things up and running was a rather arduous process:<br /><ul><li>First you have to get your port building from the <code>build-webkit</code> command line.</li><br /><li>Next, you have to set up a <a href="http://buildbot.net/trac">Buildbot</a>. You only really need the slave portion, but to test your configuration you will need to set up a local buildbot master.</li><br /><li>Note: Here you will (perhaps) learn that the environment used by the <code>pdevenv</code> utility does not match the build environment you've been using to debug build problems.</li><br /><li>Once you confirm your build works when executed by the buildbot, you need to get a patch landed in the WebKit archive that defines your build slave.</li><br /><li>On the happy day your buildbot configuration lands, you have to start harassing <b>_wms</b> to schedule a restart of the master buildbot.</li><br /><li>Being a great guy, <b>_wms</b> will get a restart scheduled, at which point a veritable <em>avalanche</em> of source changes will be suddenly kicked loose by the <code>commit-queue</code>. The restart will take upwards of 48 hours before things settle down enough for the service to restart.</li><br /></ul>But eventually, if you persevere, your bot will be live and GREEN. And with this work, comes some wonderful benefits as it will be much easier for the other WebKit folks to avoid breaks. And I can even configure the system to send me an e-mail when my build fails. So cool!<br /><br />Let's hope that this will usher in a grand new era of clean WinCairo builds and better (and faster) code production!bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com6tag:blogger.com,1999:blog-3416807.post-13681268886925628822010-10-02T22:34:00.000-07:002010-10-02T23:16:05.751-07:00Updated WebKit SDK (@r68150)I have updated the WebKitSDK to correspond to SVN revision r59726.<br />Major changes in this revision:<br />* More HTML5/CSS3/DOM3 compliance<br />* Web inspector improvements<br />* More Accessibility updates<br />* JavaScript engine improvements<br />* General rendering improvements<br />* SVG enhancements<br />* XMLHttpRequest Changes:<br />* Plugin support<br />* Better Windows 7 support.<br />* General performance and memory use improvements<br /><br />As usual, this is a significant amount of new logic so there may be some regressions. Please let me know if you encounter any problems!<br /><br />Side note: I still work primarily on Vista. If you have interest in better testing and support for Windows 7, and happen to have a spare Windows 7 license available that you could donate, please contact me.<br /><br />I've also updated my build <a href="https://files.me.com/bfulgham/n9vnca">requirements</a> zipfile.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com3tag:blogger.com,1999:blog-3416807.post-32756973509733212010-07-09T22:42:00.000-07:002010-07-09T22:57:16.269-07:00Spelling!<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh87dhcvyUD1ngSj4Dq6s6KOZ_EGyRIeA6lrrVHYyMkEl68cxTr1C7Bfdip0eP8h-w_JkCq9SCUvmwE0oWDSqBGAVMzo9GXgTwIx-PV3wlnclr6Umv5UCjsSf7i3BfTrA5G8isM/s1600/Screen+shot+2010-07-09+at+10.46.45+PM.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px; height: 126px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh87dhcvyUD1ngSj4Dq6s6KOZ_EGyRIeA6lrrVHYyMkEl68cxTr1C7Bfdip0eP8h-w_JkCq9SCUvmwE0oWDSqBGAVMzo9GXgTwIx-PV3wlnclr6Umv5UCjsSf7i3BfTrA5G8isM/s200/Screen+shot+2010-07-09+at+10.46.45+PM.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5492151423340024018" /></a><br />At long last we can perform spell checking in WinCairo! While the plumbing has long been in place to allow a spelling engine to be called from within the WebKit code, the WinCairo port has not had a working implementation of the 'squiggle' logic needed to indicate misspelled words.<br /><br />This <strike><a href="https://bugs.webkit.org/show_bug.cgi?id=4132">functionality</a></strike> has been landed in <a href="http://trac.webkit.org/changeset/62388">r62388</a>, with a small <a href="http://trac.webkit.org/changeset/62871">correction</a> a few days later.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmiWblwY4VxHhIsE73HajqrZF9HgrZvwzTSWI5AIBFmIJnAoDmLL_z_g9jDCRYvURkblwH8_EiM43PypsZdI2HIRInPM5JbWOV4kDSDriZWcXZjPTCWDSstx2HBk8lO8DdWcvV/s1600/example_spell.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 203px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmiWblwY4VxHhIsE73HajqrZF9HgrZvwzTSWI5AIBFmIJnAoDmLL_z_g9jDCRYvURkblwH8_EiM43PypsZdI2HIRInPM5JbWOV4kDSDriZWcXZjPTCWDSstx2HBk8lO8DdWcvV/s320/example_spell.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5492152503158770194" /></a><br />With proper delegate use, you can hook up <a href="http://hunspell.sourceforge.net/">Hunspell</a> and begin checking spelling and getting real-time suggestions. What could be more fun?bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-41451879507146936162010-06-13T21:04:00.001-07:002010-06-13T21:56:26.540-07:00WWDC<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDyOPEscMDNGZIZF3CgyKZQQkvsMuuWzT10QF5frfQi6wAUvloq20MZl3DHz4SDTXZXJQXaSxu1L7p_n95CiaZJnFO7drfbqcwZkNsC6NSEH3cUyhDtKLG-zdXEK6L-MCoQMT8/s1600/IMG_0688.JPG"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 240px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDyOPEscMDNGZIZF3CgyKZQQkvsMuuWzT10QF5frfQi6wAUvloq20MZl3DHz4SDTXZXJQXaSxu1L7p_n95CiaZJnFO7drfbqcwZkNsC6NSEH3cUyhDtKLG-zdXEK6L-MCoQMT8/s320/IMG_0688.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5482478196166262066" /></a>I spent the past week at Apple's amazing WWDC conference. I was primarily attending to learn about iPhone and iPad development, but it was also an opportunity to meet with the core Apple WebKit team. It was great putting faces to the various IRC nicks and e-mail addresses that I've been interacting with over the past couple of years. I learned some important facts, such as that Darin Adler is renovating his house, that mitzpettel is a baked goods aficionado, and that bdash is a really nice guy in person (despite his gruff online persona). Only Maciej managed to elude my stalking skills.<br /><br />The guys were very accommodating, humoring me by sitting politely through a demonstration of my incomplete application so I could show off its multiple web view. Unfortunately, some nuance of the WWDC network preventing me from accessing my company's VPN, so I couldn't retrieve the current beta build to show off the current artwork and CSS. When we get closer to release I hope to post some videos of it. <br /><br />The only disappointment (for me) was having to miss the annual WebKit party, attending instead a mandatory Oakland A's game with my Father-in-law. From all reports, it was a great evening (the party, not the A's game). Oh well -- next year!<br /><br />If you haven't been to WWDC, I highly recommend it. It's a great way to get excited by the possibilities provided by the various Apple platforms, as well as an opportunity to be inspired by the great work being done by others in the industry. Arguably, the most valuable aspect of the conference is getting direct one-on-one contact with the various engineering teams at Apple. You can literally drop in with you buggy program, sit down with your laptop and a few engineers, and walk out of there with a solution.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-79913382219375320642010-06-03T13:16:00.001-07:002010-06-03T22:28:45.023-07:00Jake<div style="text-align: left; padding: 3px;"><a href="http://www.flickr.com/photos/27956488@N06/2606709938/" title="photo sharing"><img src="http://farm4.static.flickr.com/3212/2606709938_9fd0d1a537.jpg" style="border: solid 2px #000000;" alt="" /></a><br /><span style="font-size: 0.8em; margin-top: 0px;"><a href="http://www.flickr.com/photos/27956488@N06/2606709938/">Jake in a box</a>, originally uploaded by <a href="http://www.flickr.com/people/27956488@N06/">bfulgham</a>.</span></div><p>Years ago, when the internet was largely unknown, <a href="http://en.wikipedia.org/wiki/Usenet">USENET</a> was king, and people still used <a href="http://www.aol.com/">America Online</a> I was living in Virginia, near the headquarters of AOL. My wife and I were newlyweds, and decided to do some training for parenthood by getting a dog.<br /><br />Answering an ad in the newspaper, we visited the cluttered basement of a home in nearby Vienna, VA. The room was filled with <a href="http://www.cockatiel.com/">Cockatiel</a> cages, and carpeted in old newspaper. The air was thick with dust, down, and the scent of air freshener that nearly masked the smell of wet dogs. This is where we first met Jake, who was to be our loyal companion for the next 15 and a half years.<br /><br />Even then, Jake was his own person. He could have cared less about the two goofy visitors clamoring for his attention. He was focused on the lid from an air freshener spray, rolling it around the room and pouncing on it. I didn't think he was going to be people-focused enough, but my wife liked that he was tiny and I liked the fact that he was only $125 (a $25 savings!) because he was a runt. At six weeks of age he weighed only a pound and a half.<br /><br />It turned out that he also came with a free case of <a href="http://en.wikipedia.org/wiki/Coccidia">Coccidia</a>. Our new vet (Dr. Stork) prescribed a banana flavored medicine, which I would give to Jake each morning. I kept the fact that Jake loved the medicine a secret from my wife, hoping to get Jake to like me better (a plan which seemed to have largely worked.)<br /><br />When he was very small, I could put him in the pocket of my coat, cinch the pocket loosely around his neck, and go to the grocery store. He greatly enjoyed visiting the deli department, as I recall. <br /><br />Jake was wildly energetic, full of great humor, and always had a smile on his face. I remember when we got a second dog to be his playmate, Jake would climb on the couch and kick the throw pillows onto Dylan, who was too uncoordinated to climb up. I caught him doing this once, and I swear he winked at me while doing it.<br/><br />Even in the most adverse conditions he maintained a positive attitude, and only ever presented signs of depression once when we lived with my parents for a number of months. Apparently he was fed up, and wanted his own house!<br /><br />He was very friendly, and loved kids. When we finally brought a few home of our own, a new world was opened to him. He became adept at stealing food from the kids' high chairs, and soon grew fat (topping in at nearly 22 pounds at the high point.) He loved the chaos that two toddlers brings to a home.<br /><br />As the kids and Jake grew older, he began to slow down. This was a great time for my wife and me, since he had never been capable of sitting still. At last we could hold him while watching TV or reading, and I soon learned that he had an almost magical power to put me to sleep if he sat in my lap.<br /><br />Eventually his hearing faded, and then his eyes clouded over with cataracts. He stayed remarkably upbeat, memorizing the layout of the house, and never complaining about the fairly frequent knocks he took to the head from walking into furniture or walls. I took to carrying him outside to a safe spot in the yard, and switched him to a canned dog food when his normal dog food seemed to hurt his teeth. Even in his declining days he stayed a regal presence, barking to announce he was ready to be set on the couch, or ready to be put onto the bed, or ready to go outside. <br /><br />Eventually he began to lose weight and became lethargic. He had a harder time finding his water, and seemed to frequently get lost in the house. The Vet was not sure what the problem was, aside from advanced age, and we did not wish to subject him to invasive testing that would likely be unhelpful, but would certainly cause pain.<br /><br />This memorial weekend, we had to say farewell to Jake. He passed into the next life surrounded by his family (and Grandparents). He will be sorely missed.</p>bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-39954001227571797092010-05-20T09:11:00.000-07:002010-05-20T10:33:08.813-07:00Updated WebKit SDK (@r59726)I have updated the <a href="http://files.me.com/bfulgham/8kvx9r">WebKitSDK</a> to correspond to SVN revision <a href="http://trac.webkit.org/browser/trunk?rev=59726">r59726</a>.<br />Major changes in this revision:<br />* More HTML5/CSS3/DOM3 compliance<br /> - Updates to match current specification properties and naming.<br /> - DOM3 XMLHttpRequest improvements<br /> - HTML5 Database support improvements<br /> //- Fill modes for CSS Animations<br />* Better multicolumn layout support<br />* Web inspector improvements<br />* More Accessibility updates<br />* JavaScript engine improvements (math, string optimizations)<br />* SVG enhancements<br /> - feDiffuseLighting<br /> - SVGFont vkern/hkern support<br /> - More efficient drawing<br />* Better Windows 7 support.<br />* General performance and memory use improvements<br /><br />As usual, this is a significant amount of new logic so there may be some regressions. Please let me know if you encounter any problems!<br /><br />Side note: I still work primarily on Vista. If you have interest in better testing and support for Windows 7, and happen to have a spare Windows 7 license available that you could donate, please contact me.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com3tag:blogger.com,1999:blog-3416807.post-39297488536765160632010-05-18T17:15:00.000-07:002010-05-20T12:24:20.211-07:00Successful Print Preview<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXCj7_DlBashKXnuL3YnCPRq3mco4SHzXBQ8n1hi2gvr5UTRYehxF__3WeUAkBHeb68jB9fzLhZ8ciZnl3Q5CviXSW46Bj5eNfjmGW272mQ7b4NH-i9mhJGQJ_B6v8ZL7CC61o/s1600/Scaled_Contexts.PNG"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 292px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXCj7_DlBashKXnuL3YnCPRq3mco4SHzXBQ8n1hi2gvr5UTRYehxF__3WeUAkBHeb68jB9fzLhZ8ciZnl3Q5CviXSW46Bj5eNfjmGW272mQ7b4NH-i9mhJGQJ_B6v8ZL7CC61o/s320/Scaled_Contexts.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5472770670181553074" /></a><br />I have been wrestling with <a href="http://webkit.org">WebKit</a> for some time trying to get a proper 'Print Preview' thumbnail. Unfortunately, my various attempts generally resulted in good looking text, but offset and strangely scaled graphical elements, or vice versa.<br /><br />During this process I learned that Windows (or specifically, MFC) implements a print preview by generating a device context for the selected printer, and a 'sister' display context that is configured to mimic the printed surface such that drawing commands intended for the full-sized printer surface are rendered into a small preview display.<br /><br />This is accomplished by setting the mapping mode of the display context to <code>MM_ANISOTROPIC</code>, and setting a Window Extent (for the full size of the printed page) and a View Extent for the size of the display.<br /><br />Unfortunately, if you pass a context created with these kinds of settings to <a href="http://www.cairographics.org">Cairo</a>, it <a href="https://bugs.freedesktop.org/show_bug.cgi?id=28161">improperly scales textual elements</a>. In the attached image you can see that text written with <code>cairo_show_text</code> and <code>cairo_show_glyphs</code> get drawn at the same size no matter how the context is scaled. Text written with <code>cairo_text_path</code> and other graphical elements (e.g., the arc in the example) are scaled properly.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrrZl2tOgsj75M-LaCv9ybdDVwE9Jz2-qDM1TmLtYi6lKv7G6yytrod3FAMJYxeGKMTow-u7blXz6N0WEqKKekA3cdgFESH-9ir45O4XUrhnKYGqGvU52SPMA2GQy6p15PzCpP/s1600/Proper_Scaling.PNG"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 247px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrrZl2tOgsj75M-LaCv9ybdDVwE9Jz2-qDM1TmLtYi6lKv7G6yytrod3FAMJYxeGKMTow-u7blXz6N0WEqKKekA3cdgFESH-9ir45O4XUrhnKYGqGvU52SPMA2GQy6p15PzCpP/s320/Proper_Scaling.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5472772938063995602" /></a>Thankfully, there is a workaround. After writing a test program to illustrate the issue, I discovered through some trial and error that everything works fine if I reset the preview window mapping mode to <code>MM_TEXT</code>, reset the HDC's WorldTransform to unity, and set the Cairo context's CTM to be scaled to match the ratio of the Viewport Extents to the Window Extents.<br /><br />Voila! Properly scaled previews.<br /><br />This change is implemented in <strike><a href="https://bugs.webkit.org/show_bug.cgi?id=39329">Bug 39329</a></strike>, which will hopefully be committed to the archive soon.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-44069327124569539332010-04-07T20:59:00.000-07:002010-04-07T22:13:36.041-07:00WinLauncher SourcesA few people have contacted me asking about the WinLauncher program I use for testing. I didn't create this useful application; it's actually <a href="http://trac.webkit.org/browser/trunk/WebKitTools/WinLauncher">part</a> of the standard <a href="http://trac.webkit.org/browser/trunk/">WebKit</a> source tree.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw5mfEGDkIBr5frQl-YEApnN9jPEvmpL-aDw-3NbyGITymKdnh0U1hJULKDIgcy8wiXmFbMJ6Zvs9bnNvBbPMm2NysasJ8OCdYbcv6E2N77VSPIYpa-O_mvmgxeakyffyUjkCS/s1600/Screen+shot+2010-04-07+at+10.07.20+PM.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 284px; height: 232px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw5mfEGDkIBr5frQl-YEApnN9jPEvmpL-aDw-3NbyGITymKdnh0U1hJULKDIgcy8wiXmFbMJ6Zvs9bnNvBbPMm2NysasJ8OCdYbcv6E2N77VSPIYpa-O_mvmgxeakyffyUjkCS/s320/Screen+shot+2010-04-07+at+10.07.20+PM.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5457628982942248226" /></a><br />In fact, if you use the Visual Studio project to build WebKit (either the official Apple port, or my WinCairo variant), you can just set the WinLauncher project as the "Set as StartUp Project". Now, when you press the 'Run' button, WinLauncher will build and launch.<br /><br />This can be extremely useful for testing various aspects of the framework, as well as playing with the official Apple build to see what it does under different conditions. It's also a lot easier to start and debug than the full-blown Safari process.<br /><br />Over the last year or so I've worked to add a few new features, mainly related to stuff I was trying to get working under WinCairo. Most recently, that means that printing is partially supported.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-30091414657528010832010-04-06T13:48:00.000-07:002010-04-06T14:05:38.882-07:00Updated WebKit SDK (@r57152)I have updated the <a href="http://files.me.com/bfulgham/qc09yw">WebKitSDK</a> to correspond to SVN revision r57152.<br />Major changes in this revision:<br />* More HTML5/CSS3/DOM3 compliance<br /> - DOM3 custom events<br /> - DOM3 XMLHttpRequest improvements<br /> - <hgroup> element<br /> - lang attribute added to <option> elements<br /> - Fill modes for CSS Animations<br />* DOM access to FormData (XMLHttpRequest 2 spec)<br />* Add create/dispatch WheelEvent in JavaScript<br />* Add mechanism to get an IFrame's content frame<br />* Web inspector improvements<br />* Accessibility updates<br />* JavaScript engine improvements<br />* SVG stability and bug fixes<br />* General performance and memory use improvements<br /><br />Clearly this is a significant amount of new logic, so there may be some regressions. Please let me know if you encounter any problems with this new version.<br /><br /><ruby>Unfortunately I have not been able to complete work on 3D CSS or WebGL, but stay tuned!<rp>(</rp><rt>Obviously I cribbed this from an older entry as this is unchanged in the last several months!</rt><rp>)</rp></ruby>bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-50703898158563417282010-01-11T20:19:00.000-08:002010-01-12T17:00:09.665-08:00Printing!I've spent the better part of a week trying to understand why plugins were not printing properly from within WebKit. While this is probably not a critical topic for most WebKit users, I am using the plugin infrastructure to allow WebKit to host a UI widget from my main application. The really cool thing about this design is that I can call up a WebKit view in my main program, display some custom UI elements hosted by my main program inside the WebView, and even have the plugin (launched by WebKit) access internal objects in my running application!<br /><br />Unfortunately, the whole grand vision teetered on the brink of failure, because I could not get the hosted widgets to appear in a printed copy of my WebKit instance. This was a real annoyance, after I'd *already* spent the better part of a week getting the main printing infrastructure working under WinCairo in the first place.<br /><br />The plugins, which displayed so nicely on-screen, didn't show up at all in hard copy -- even when there was nothing else being displayed on the screen. Fearing some kind of strange interaction between the third-part binary I was embedding in my plugin, I wrote an extremely simple example NPAPI plugin (http://files.me.com/bfulgham/o7vlik), which renders a box in the region supplied by the calling web page. But again, the plugin rendered perfectly on-screen, but did not display in the printout.<br /><br />It wasn't until I monkeyed with the margin, header, and footer that I saw tiny little rectangles being drawn in the upper-left-hand corner of the page. The plugins were getting drawn, but they were extremely tiny, and they were in the wrong location.<br /><br />Searching through the code, I found the following in PluginViewWin:<br /><code><br /> // The plugin expects the DC to be in client coordinates, so we translate<br /> // the DC to make that so.<br /> XFORM transform;<br /> transform.eDx = locationInWindow.x();<br /> transform.eDy = locationInWindow.y();<br /></code><br /><br />Of course! This was ignoring the scaling effects of printing to a page (~1600 dpi) versus on-screen (~96 dpi). I also discovered that header and footer extents were being ignored, which was why my tiny rectangles were getting drawn in the upper-left-hand corner of the page -- and only if I made the header big enough that the web page did not cover the region.<br /><br />So, I happily filed <strike><a href="https://bugs.webkit.org/show_bug.cgi?id=32909">Bug 32909</a></strike> and figured that would be the end of it.<br /><br />Only, it wasn't. Once I corrected the scaling and translation issues, I found that although my on-screen display was correct, my print output continued to omit the plugin. Even worse, I could sometimes see the edges of rectangles peeking from around rendered portions of the page (when margin or header/footer sizes were manipulated). In at least one case, I was able to click on the edge of the rectangle in PDF Viewer, copy the object (hidden behind a blank area), and paste the *full* rectangle into another document. WTF?<br /><br />After more trial and error, I discovered that changing the rendering type used for the page from <code>cairo_win32_printing_surface_t</code> to <code>cairo_win32_surface_t</code> my plugins *did* display properly! The only problem, was that my printing operations went from using very little memory, to using over 100 MB of RAM to print.<br /><br />A bit of correspondence with the <a href="http://www.cairographics.org">Cairo</a> team helped me see that the problem was due to the dual nature of the drawing operations. The plugin is handed a Windows device context handle to the printing surface. But the majority of the drawing events in WinCairo are done against a <code>cairo_t</code> context. When this context is backed by a <code>cairo_win32_printing_surface_t</code>, drawing operations become slightly order-dependent. Drawing directly to the printer context (as my plugin was doing) would get drawn to the printer device context immediately. Later, the entire Cairo surface was shipped to the printer, overwriting (actually *overlaying*) the previous drawing operations.<br /><br />And that explained it: when this multiple layered printing context was played back as a PDF file, the plugin contents were at the lowest Z-level, but the main page rendering was sitting on top of them making it appear as though the plugin was not rendering at all.<br /><br />At last, a workable solution was found. Prior to the plugin drawing, I had to add the following logic:<br /><code><br />#if PLATFORM(CAIRO)<br /> // Must flush drawings up to this point to the backing metafile, otherwise the<br /> // plugin region will be overwritten with any clear regions specified in the<br /> // cairo-controlled portions of the rendering.<br /> PlatformGraphicsContext* ctx = context->platformContext();<br /> cairo_show_page(ctx);<br />#endif<br /></code><br /><br />Now, each time I go to print a plugin, the Cairo context is flushed to the printing surface. Then the plugin is drawn (on *top* of this existing rendering), then control returns to WebKit for more Cairo rendering, followed by more flushes (if more plugins are being drawn), and so forth.<br /><br />In this way, I was finally able to get a correct print version of my plugin-containing page. See <strike><a href="https://bugs.webkit.org/show_bug.cgi?id=33022">Bug 33022</a></strike>.<br /><br />I also pushed some general printing adjustments to the WInLauncher program to help other see the correct steps to take to execute printing. <strike><a href="https://bugs.webkit.org/show_bug.cgi?id=33537">Bug 33537</a></strike>.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0tag:blogger.com,1999:blog-3416807.post-49713059180473806512009-12-28T19:50:00.000-08:002009-12-28T19:54:11.228-08:00ClearType Italics<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinoQ_BNkdkZTUZmyQY4_hqWPq9qWwh1h3a30YJny0CaPHR4gYypEhKfKe_koLtfYxDE762pq9kr-Ev5rdBnvyIABiRLoXtQbqQZfyGG_7m5YVA3gdLbVZ34UdVHll3KH4Fw50m/s1600-h/Screen+shot+2009-12-28+at+7.49.16+PM.png"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 275px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinoQ_BNkdkZTUZmyQY4_hqWPq9qWwh1h3a30YJny0CaPHR4gYypEhKfKe_koLtfYxDE762pq9kr-Ev5rdBnvyIABiRLoXtQbqQZfyGG_7m5YVA3gdLbVZ34UdVHll3KH4Fw50m/s320/Screen+shot+2009-12-28+at+7.49.16+PM.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5420501391447962786" /></a><br />A commenter recommended that we double-check that italic characters render properly, as these are frequently clipped. You can see from this attached image that italic characters are rendered properly.bfulghamhttp://www.blogger.com/profile/13730716161685154449noreply@blogger.com0