<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://taken.s101.xrea.com/blog/rss/style.css" type="text/css"?>
<rdf:RDF xmlns="http://purl.org/rss/1.0/"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:content="http://purl.org/rss/1.0/modules/content/"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xml:lang="ja">
<channel rdf:about="http://taken.s101.xrea.com/blog/rss/recent.php">
<title>Taken SPC</title>
<link>http://taken.s101.xrea.com/blog/index.php</link>
<dc:date>2009-06-29T13:32:58+0900</dc:date>
<description>
Taken SPC - RSS (RDF Site Summary) Feed.
</description>
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=844" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=843" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=842" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=841" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=840" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=839" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=838" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=837" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=836" />
<rdf:li rdf:resource="http://taken.s101.xrea.com/blog/article.php?id=834" />
</rdf:Seq>
</items>
</channel>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=844">
<title>HTML 5 Parser</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=844</link>
<dc:date>2009-06-29T13:32:58+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>mozilla-central に HTML5 Parser が入った。このパーサは Validator.nu で使われており、HTML 5 のパーシングアルゴリズムを実装している。もともと Java で書かれているが、機械的に C++ の...</description>
<content:encoded>
<![CDATA[
<p>mozilla-central に HTML5 Parser が入った。このパーサは <a href="http://validator.nu/">Validator.nu</a> で使われており、HTML 5 のパーシングアルゴリズムを実装している。もともと Java で書かれているが、機械的に C++ のコードに変換することができ、Gecko では C++ のコードを利用している。</p>
<p>今のところ、このパーサはデフォルトでは無効で、これまでのパーサが利用されている。新しいパーサを利用するには about:config で <code>html5.enable</code> を <code>true</code> にする。</p>
<p>新しいパーサでは、XHTML 構文で書かれた文書だけではなく、HTML 構文で書かれた文書に埋め込まれた SVG や MathML も処理できる :-)。</p>
<h4>関連</h4>
<ul>
<li>
<a href="http://about.validator.nu/htmlparser/">The Validator.nu HTML Parser</a>
</li>
<li>
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#parsing">9.2 Parsing HTML documents &mdash; HTML 5 </a>
</li>
<li>
<a href="https://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&amp;short_desc_type=casesubstring&amp;short_desc=[HTML5]+&amp;cmdtype=doit">HTML5 Parser 関連のバグ一覧</a>
<ul>
<li>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=487949">Bug 487949 &#8211; [HTML5] Land HTML5 parser on m-c preffed off</a>
</li>
</ul>
</li>
<li>
<a href="http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4851a9d9a60c&amp;tochange=168dd0eb7283">mozilla-central: rev:168dd0eb7283</a>
</li>
</ul>
<h4>mozilla-central でのソースコード</h4>
<ul>
<li>
<a href="http://mxr.mozilla.org/mozilla-central/source/content/html/parser/javasrc/">content/html/parser/javasrc/</a> (Java)</li>
<li>
<a href="http://mxr.mozilla.org/mozilla-central/source/parser/html/">parser/html/</a> (C++)</li>
</ul>

]]>
</content:encoded>
<dc:subject>mozilla</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=843">
<title>Gecko で JavaScript が無効なときに &amp;lt;canvas&amp;gt; の代替コンテントを表示するためのプチハック</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=843</link>
<dc:date>2009-06-24T16:44:22+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>&amp;lt;canvas&amp;gt; 要素はスクリプトによってグラフィックスを描くための要素ですが、それゆえに、スクリプトと視覚メディアが利用できなければ、直接情報を提供することができません。そのため HTML 5 仕様では &amp;lt;canvas&amp;...</description>
<content:encoded>
<![CDATA[
<p>&lt;canvas&gt; 要素はスクリプトによってグラフィックスを描くための要素ですが、それゆえに、スクリプトと視覚メディアが利用できなければ、直接情報を提供することができません。そのため HTML 5 仕様では &lt;canvas&gt; はその要素のコンテンツとして代替コンテントを持てるとしています。この代替コンテントは (インタラクティヴな視覚的メディアで) スクリプトが無効な場合や視覚的でないメディアに対して提供されることになっています。</p>
<p>とはいえ、今のところ Gecko はそのどちらの場合にも代替コンテントを提供していません。この記事では JavaScript が無効なときに &lt;canvas&gt; の代替コンテントを表示するハックを紹介します。</p>
<h4>手順</h4>
<ol>
<li>mozilla-central レポジトリからソースコードをとってくる</li>
<li>以下のパッチをあてる</li>
<li>ビルドする</li>
</ol>
<h4>スクリーンショット</h4>
<p>
<img src="http://taken.s101.xrea.com/blog/resources/firefox_canvas_fallback.png" width="524" height="683" alt="スクリーンショット" />
</p>
<h4>パッチ</h4>
<pre class="code">diff -r 1aa35fa65790 layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp Tue Jun 23 22:11:43 2009 -0400
+++ b/layout/base/nsCSSFrameConstructor.cpp Wed Jun 24 16:50:56 2009 +0900
@@ -3739,7 +3739,7 @@ nsCSSFrameConstructor::FindHTMLData(nsIC
     SIMPLE_TAG_CREATE(iframe, NS_NewSubDocumentFrame),
     SIMPLE_TAG_CREATE(spacer, NS_NewSpacerFrame),
     COMPLEX_TAG_CREATE(button, &amp;nsCSSFrameConstructor::ConstructButtonFrame),
-    SIMPLE_TAG_CREATE(canvas, NS_NewHTMLCanvasFrame),
+    SIMPLE_TAG_CHAIN(canvas, nsCSSFrameConstructor::FindCanvasData),
 #if defined(MOZ_MEDIA)
     SIMPLE_TAG_CREATE(video, NS_NewHTMLVideoFrame),
     SIMPLE_TAG_CREATE(audio, NS_NewHTMLVideoFrame),
@@ -3846,6 +3846,18 @@ nsCSSFrameConstructor::FindObjectData(ns
                        sObjectData, NS_ARRAY_LENGTH(sObjectData));
 }
 
+/* static */
+const nsCSSFrameConstructor::FrameConstructionData*
+nsCSSFrameConstructor::FindCanvasData(nsIContent *aContent,
+                                      nsStyleContext *aStyleContext) {
+  if (!aContent-&gt;GetOwnerDoc()-&gt;IsScriptEnabled())
+    return nsnull;
+
+  static const FrameConstructionData sCanvasData =
+    SIMPLE_FCDATA(NS_NewHTMLCanvasFrame);
+  return &amp;sCanvasData;
+}
+
 nsresult
 nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem&amp; aItem,
                                                       nsFrameConstructorState&amp; aState,
diff -r 1aa35fa65790 layout/base/nsCSSFrameConstructor.h
--- a/layout/base/nsCSSFrameConstructor.h   Tue Jun 23 22:11:43 2009 -0400
+++ b/layout/base/nsCSSFrameConstructor.h   Wed Jun 24 16:50:56 2009 +0900
@@ -1057,6 +1057,8 @@ private:
     FindInputData(nsIContent* aContent, nsStyleContext* aStyleContext);
   static const FrameConstructionData*
     FindObjectData(nsIContent* aContent, nsStyleContext* aStyleContext);
+  static const FrameConstructionData*
+    FindCanvasData(nsIContent *aContent, nsStyleContext* aStyleContext);
 
   /* Construct a frame from the given FrameConstructionItem.  This function
      will handle adding the frame to frame lists, processing children, adding</pre>
<h4>参考</h4>
<ul>
<li>
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-canvas-element">4.8.11 The canvas element &mdash; HTML 5</a>
</li>
<li>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=302566">Bug 302566 &ndash; when JavaScript is disabled, alternate content provided within the canvas element is not rendered and the canvas element still is rendered</a>
</li>
<li>
<a href="http://www.chaoticshore.org/blog/2009/06/23-204951.html">Discover Shiretoko - 徒然なる記録 - Chaotic Shore</a>
</li>
</ul>

]]>
</content:encoded>
<dc:subject>mozilla</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=842">
<title>Mozilla ソースツリーの IDL の位置が変更</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=842</link>
<dc:date>2009-03-06T15:17:12+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>Mozilla では XPCOM のインタフェースを IDL を使って記述している。
もちろん DOM オブジェクトのインタフェースも IDL で記述されており、ビルド時に IDL から自動的に C++ 用ヘッダファイル (nsIFooBa...</description>
<content:encoded>
<![CDATA[
<p>Mozilla では XPCOM のインタフェースを <abbr title="Interface Definition Language">IDL</abbr> を使って記述している。
もちろん DOM オブジェクトのインタフェースも IDL で記述されており、ビルド時に IDL から自動的に C++ 用ヘッダファイル (ns<strong>I</strong>FooBar.h のような) などが生成されていたりする。</p>
<p>さて <a href="http://hg.mozilla.org/mozilla-central/">mozilla-central</a> では、先日これら IDL の位置が変更された。例えば、&lt;canvas&gt; 要素 の 2d コンテクスト (CanvasRenderingContext2D) の IDL は以下のように動かされた。</p>
<table>
<tbody>
<tr>
<th>変更前</th>
<td>mozilla/dom/public/idl/canvas/nsIDOMCanvasRenderingContext2D.idl</td>
</tr>
<tr>
<th>変更後 (現在)</th>
<td>
<a href="http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl">mozilla/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl</a>
</td>
</tr>
</tbody>
</table>
<p>dom/public/idl/ が dom/interfaces/ に変っただけである。</p>
<p>しかし話はこれで終りではなく、今後もソースツリーの構成は変るようだ。</p>
<p>DOM について言えば、実装 (nsFooBar.(h|cpp) など) も現在の位置から動かされるようだ。現在は content/ と dom/src/ に別れているファルを dom/ 以下にまとめられる。
一貫性が増してわかりやすくなる反面、リンク切れが頻発すると思われるので、これらのファイルを参照するときは注意が必要だろう。</p>
<p>もっとも <a href="http://mxr.mozilla.org/">mxr</a> では、あるファイルが違うディレクトリに移動していても簡単に見つけることができる。</p>
<ul>
<li>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=481027">Bug 481027  Move dom/public/idl to dom/interfaces</a>
</li>
<li>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=481026">Bug 481026  Reorganize dom/content source tree</a>
</li>
<li>
<a href="http://groups.google.co.jp/group/mozilla.dev.tech.dom/browse_thread/thread/06b335badbe053b3">
dom/ and content/ source reorganization </a>
</li>
</ul>

]]>
</content:encoded>
<dc:subject>mozilla</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=841">
<title>もじら組Wiki 向けユーザスタイルシート</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=841</link>
<dc:date>2008-08-30T21:34:33+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>
もじら組Wiki が少し見づらいなと思ったので、とりあえず、見出しに応じて内容をインデントさせてみることに。以下はそのユーザスタイルシート。
@namespace url(http://www.w3.org/1999/xhtml);
@-...</description>
<content:encoded>
<![CDATA[
<p>
<a href="http://wiki.mozilla.gr.jp/">もじら組Wiki</a> が少し見づらいなと思ったので、とりあえず、見出しに応じて内容をインデントさせてみることに。以下はそのユーザスタイルシート。</p>
<pre class="code css">@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain(wiki.mozilla.gr.jp),
               domain(wiki2.mozilla.gr.jp) {
    div.wiki_body > h4 ~ *:not(h4):not(h3):not(h2):not(form) {
        margin-left : 1.5em !important;
    }

    div.wiki_body > h3 ~ *:not(h3):not(h2):not(form) {
        margin-left : 1em !important;
    }

    div.wiki_body > h2 ~ *:not(h2):not(form) {
        margin-left : 0.5em !important;
    }
}</pre>

]]>
</content:encoded>
<dc:subject>firefox</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=840">
<title>mozilla-qt</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=840</link>
<dc:date>2008-08-04T22:36:21+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>現在 Firefox の Linux 版ではツールキットに GTK2 が使われていますが、しばらく前から Qt 版の開発も行われています。そして、今日 Qt 版に大量の変更がチェックインされたので、ビルドしてみることにしました。
これ以前に...</description>
<content:encoded>
<![CDATA[
<p>現在 Firefox の Linux 版ではツールキットに GTK2 が使われていますが、しばらく前から Qt 版の開発も行われています。そして、今日 Qt 版に大量の変更がチェックインされたので、ビルドしてみることにしました。</p>
<p class="note">これ以前にも Qt 版の開発はありましたが、現在メインのソースツリーには含まれていません。参考: <a href="http://slashdot.jp/developers/article.pl?sid=04/10/11/1233250" title="MozillaのQt版が登場">2004 年のスラッシュドットの記事</a>
</p>
<p>まずはソースコードをとってきます。</p>
<pre class="code">$ hg clone http://hg.mozilla.org/users/vladimir_mozilla.com/index.cgi/mozilla-qt/ mozilla-qt</pre>
<p>Ubuntu 8.04 (Hardy) の Qt 4 パッケージのバージョン 4.3.4 ですが、Qt 4.4.0 を自分で入れていたのでそちらを使うことにします。</p>
<p class="note">すでに Qt 4.4.1 がリリースされていますが…。</p>
<pre class="code">$ export LD_LIBRARY_PATH=/usr/local/Trolltech/Qt-4.4.0/lib:$LD_LIBRARY_PATH
$ export PKG_CONFIG_PATH=/usr/local/Trolltech/Qt-4.4.0/lib/pkgconfig:$PKG_CONFIG_PATH</pre>
<p class="note">
<code class="filename">/usr/local/Trolltech/Qt-4.4.0/</code> が Qt のインストール先ディレクトリです。</p>
<p>用意した <code class="filename">.mozconfig</code> は以下のとおりです。</p>
<pre class="code">mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --enable-application=browser
ac_add_options --disable-debug
ac_add_options --disable-tests
ac_add_options --enable-libxul
ac_add_options --enable-default-toolkit=cairo-qt
ac_add_options --enable-canvas
ac_add_options --enable-svg
ac_add_options --disable-printing
ac_add_options --disable-crashreporter
mk_add_options --with-qtdir=/usr/local/Trolltech/Qt-4.4.0</pre>
<p>
<code>--enable-default-toolkit</code> に <code>cairo-qt</code> を設定するのがミソです。で、あとは普通にビルドするだけです。</p>
<pre class="code">$ make -f client.mk build</pre>
<p>するとあっさりビルドできました。動かしてみたスクリーンショットが以下。</p>
<p>
<a href="http://taken.s101.xrea.com/blog/resources/mozilla-qt2.png">
<img src="http://taken.s101.xrea.com/blog/resources/mozilla-qt2.thumbnail.png" alt="スクリーンショット"/>
</a>
</p>
<p>ツールバーの描画がおかしかったり、「View」→「Character Encoding」を開こうとすると固まったりと、まだまだバギーでした。ページの描画は割とまともでしたが、テキストまわりの処理はまだまだのようで、手元の環境では日本語などをうまく表示できない場合もありました。</p>
<p>まだ常用できるような域には達してしませんが、ということは、これからが楽しみということでもあります。</p>
<h4>参考</h4>
<ul>
<li>
<a href="http://hg.mozilla.org/users/vladimir_mozilla.com/index.cgi/mozilla-qt/">Mozilla Qt 移植版ソースコードレポジトリ</a>
</li>
<li>
<a href="http://blog.vlad1.com/2008/05/06/well-isnt-that-qt/">Well Isn’t That Qt at Vladimir Vukićević</a>
</li>
</ul>

]]>
</content:encoded>
<dc:subject>mozilla</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=839">
<title>SVG で波紋</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=839</link>
<dc:date>2008-06-16T03:19:04+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>SVG のフィルタとアニメーション (と JavaScript) で、波紋っぽい効果を出してみました。クリックした場所から波が伝わるような効果がでます (色々と手抜きですが)。







SVG で波紋 (フィルタ版)


SVG で波...</description>
<content:encoded>
<![CDATA[
<p>SVG のフィルタとアニメーション (と JavaScript) で、波紋っぽい効果を出してみました。クリックした場所から波が伝わるような効果がでます (色々と手抜きですが)。</p>
<p>
<a href="http://taken.s101.xrea.com/blog/resources/ripple_svg_opera.png">
<img src="http://taken.s101.xrea.com/blog/resources/ripple_svg_opera.thumbnail.png" width="321" height="320"/>
</a>
</p>
<ul>
<li>
<a href="./var/svg/ripple/ripple.svg">SVG で波紋 (フィルタ版)</a>
</li>
<li>
<a href="./var/svg/ripple/ripple_simple.svg">SVG で波紋 (グラデーションのみ)</a>
</li>
</ul>
<p>Opera 位でしか動きません (Opera 9.5 で動作確認)。あと、もの凄く重たいので注意。手元では時おり Opera がクラッシュしました。</p>

]]>
</content:encoded>
<dc:subject>opera</dc:subject>
<dc:subject>svg</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=838">
<title>Re: canvas で文字を表示してみる</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=838</link>
<dc:date>2008-06-15T11:38:21+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>Firefox 3 から canvas 要素で文字を描けるようになりました。で、その例を色々みてみると、描画内容を初期化するために canvas 要素の width と height プロパティを弄っている例が多いです。しかし 
ctx.c...</description>
<content:encoded>
<![CDATA[
<p>Firefox 3 から <code>canvas</code> 要素で文字を描けるようになりました。で、その例を色々みてみると、描画内容を初期化するために <code>canvas</code> 要素の <code>width</code> と <code>height</code> プロパティを弄っている例が多いです。しかし <code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.clearRect()</code> で十分です。</p>
<p class="note">ただし <code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.clearRect()</code> は <code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.translate()</code> 等の変形の影響を受けるので、<code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.save()</code> と <code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.restore()</code> をお忘れなく (あるいは <code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.setTransform(1, 0, 0, 1, 0, 0)</code>)。</p>
<p>ということで、<a href="http://d.hatena.ne.jp/higeorange/20080609/1212997471" title="canvas で文字を表示してみる - new Error(”exeception throw”)">higeorange さんの例</a>を勝手に弄ってみます。higeorange さんのコードを以下に示します。</p>
<blockquote cite="http://labo.higeorange.com/canvas/js/canvasText.js">
<pre class="code javascript">var canvas = $('cnvs');
    canvas.width = 300;
    canvas.height = 100;
var ctx = canvas.getContext('2d');
    ctx.clearRect(0, 0, 300, 100);
    ctx.translate(10, 50);
    ctx.fillStyle = "Red";
    ctx.mozTextStyle = "30pt sans-serf";
    ctx.mozDrawText(txt);</pre>
</blockquote>
<p>
<code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.clearRect()</code> を使っておられるわけですが、たとえば以下のように書けます。</p>
<pre class="code javascript">var canvas = $('cnvs');
var ctx = canvas.getContext('2d');
    ctx.clearRect(0, 0, 300, 100);
    <em>ctx.save();</em> // コンテクストの状態を保存
    ctx.translate(10, 50);
    ctx.fillStyle = "Red";
    ctx.mozTextStyle = "30pt sans-serf";
    ctx.mozDrawText(txt);
    <em>ctx.restore();</em> // コンテクストの状態を save() した時の状態に復帰</pre>
<p>あるいは以下のようにも書けます。</p>
<pre class="code javascript">var canvas = $('cnvs');
var ctx = canvas.getContext('2d');
    ctx.clearRect(0, 0, 300, 100);
    ctx.translate(10, 50);
    ctx.fillStyle = "Red";
    ctx.mozTextStyle = "30pt sans-serf";
    ctx.mozDrawText(txt);
    <em>ctx.setTransform(1, 0, 0, 1, 0, 0);</em> // 変形行列を単位行列に</pre>
<ul>
<li>
<a href="http://developer.mozilla.org/ja/docs/Drawing_text_using_a_canvas">Drawing text using a canvas - MDC</a>
</li>
<li>
<a href="http://developer.mozilla.org/ja/docs/Canvas_tutorial:Transformations">Canvas tutorial:Transformations - MDC</a>
</li>
</ul>
<h4>蛇足 1</h4>
<div class="section">
<p>Firefox 3 でのテキスト API は独自のものですが、mozilla-central では既に HTML 5 草案の API に対応しています。</p>
<ul class="ref">
<li>
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas.html#text">HTML 5 - 3.11.11.1.9. Text</a>
</li>
<li>
<a href="http://hg.mozilla.org/index.cgi/mozilla-central/rev/963ced95e2d1">mozilla-central - changeset - 15295:963ced95e2d1</a>
</li>
<li>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=436904">Bug 436904 &#8211; implementing Canvas text spec</a>
</li>
<li>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=438702">Bug 438702 &#8211; Canvas text baselines not fully implemented</a>
</li>
</ul>
</div>
<h4>蛇足 2</h4>
<div class="section">
<p>
<code>canvas</code> 要素の <code>width</code> と <code>height</code> を設定すると、Gecko は描画対象 (<code>gfxASurface</code>) と描画コンテクスト (<code>gfxContext</code>) を一度破棄してから再度作成・初期化します。</p>
<ul>
<li>
<a href="http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLCanvasElement.cpp#207"> nsHTMLCanvasElement::SetAttr()</a>
</li>
<li>
<a href="http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsHTMLCanvasElement.cpp#498">nsHTMLCanvasElement::UpdateContext()</a>
</li>
<li>
<a href="http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/nsCanvasRenderingContext2D.cpp#762">nsCanvasRenderingContext2D::SetDimensions()</a>
</li>
</ul>
<p>一方、<code>
<abbr title="CanvasRenderingContext2D">ctx</abbr>.clearRect()</code> は描かれている領域の一部をクリアするだけで、 surface を破棄したり再作成したりということはありません。</p>
<ul>
<li>
<a href="http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/nsCanvasRenderingContext2D.cpp#1301">nsCanvasRenderingContext2D::ClearRect()</a>
</li>
</ul>
</div>

]]>
</content:encoded>
<dc:subject>canvas</dc:subject>
<dc:subject>mozilla</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=837">
<title>まっすぐなバー</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=837</link>
<dc:date>2008-04-29T11:59:53+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>未だにテーマの変更が Firefox trunk へチェックインされている今日この頃、皆様はいかがお過ごしでしょうか。Piro さんは 大変な目にあっているようですが。
さてそんな中、Windows のデフォルトテーマ以外ではロケーションバ...</description>
<content:encoded>
<![CDATA[
<p>未だにテーマの変更が Firefox trunk へチェックインされている今日この頃、皆様はいかがお過ごしでしょうか。Piro さんは <a href="http://piro.sakura.ne.jp/latest/blosxom/mozilla/extension/rewindforward/2008-04-29_fx3.htm">大変な目にあっている</a>ようですが。</p>
<p>さてそんな中、Windows のデフォルトテーマ以外ではロケーションバーの左端がカーブせず、真っ直ぐになるよう変更されました (Linux/GTK2 では以前から真っ直ぐ)。</p>
<p>
<img src="http://taken.s101.xrea.com/blog/resources/fx2008042806.smaill.png" width="320" height="120" alt="スクリーンショット" />
</p>
<ul>
<li>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=428878">Bug 428878 - Use a square site button for the windows classic os theme</a>
<ul>
<li>
<a href="https://bugzilla.mozilla.org/attachment.cgi?id=317647&amp;action=diff">パッチ (差分表示)</a>
</li>
</ul>
</li>
</ul>
<p>CSS でどうやって判断しているのか見たところ、<code>:-moz-system-metric(windows-default-theme)</code> 疑似クラスを使っていました。</p>
<ul>
<li>
<a href="http://developer.mozilla.org/en/docs/CSS::-moz-system-metric(windows-default-theme)">MDC のドキュメント</a>
</li>
</ul>
<p>
<code>:-moz-system-metric(windows-default-theme)</code> を使うと、Windows でデフォルトテーマ (Luna, Royale, Zune, Aero) を使っているか否かに基づいてスタイルを制御できます。例えば、Windows のテーマによって文字の色を変更するには以下のように書くことができます。</p>
<pre class="code css">*:-moz-system-metric(windows-default-theme) {
  /* Windows のデフォルトテーマなら */
  color: red;
}
*:not(:-moz-system-metric(windows-default-theme)) {
  /* Windows のデフォルトテーマ以外、
     あるいは Windows 以外なら */
  color: blue;
}</pre>
<p>既に Firefox 3 のテーマ (Windows 版) は Vista 向けとそれ以前向けに別れています。その上にさらにその中で OS のデフォルトテーマ云々というのは やり過ぎじゃないのかな、という気がします。</p>
<ul>
<li>
<a href="http://mxr.mozilla.org/mozilla/search?string=%3A-moz-system-metric&amp;find=\.css&amp;findi=\.css">ソースコード内の「:-moz-system-metric」検索結果</a>
</li>
</ul>

]]>
</content:encoded>
<dc:subject>mozilla</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=836">
<title>「Acid3 は基本的に価値なし」</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=836</link>
<dc:date>2008-03-27T11:51:03+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>
MoCo の Rob Sayre さんが Acid3 is basically worthless という記事を書いています。Acid3 テスト対応の一連の動きを受けての事だと思いますが、ちょっと穏やかではないですね。Firefox 3 ...</description>
<content:encoded>
<![CDATA[
<p>
<abbr title="Mozilla Corporation">MoCo</abbr> の Rob Sayre さんが <a href="http://blog.mozilla.com/rob-sayre/2008/03/26/acid3-is-basically-worthless/">Acid3 is basically worthless</a> という記事を書いています。Acid3 テスト対応の一連の動きを受けての事だと思いますが、ちょっと穏やかではないですね。Firefox 3 は Acid3 をパスしないという事ですから他所の動きに気を取られ<strong>過ぎる</strong>事もないのではないかと思うのですが。</p>
<p>一応、以下に訳してみました (かなり意訳していますので悪しからず) 。<ins datetime="2008-03-27T18:13:20+09:00">追記: 原文が追記されていたので、訳文も更新。</ins>
</p>
<div class="section">
<h4>Acid3 は基本的に価値なし</h4>
<p>私は Mozilla の Acid3 で落っこちた箇所を対象とした<a href="http://spreadsheets.google.com/pub?key=pNgBCwWdyRTT2JeiZn4B2Yw">スプレッドシート</a>に目を通してみて、その修正の内ほんの一握りしか Web あるいはブラウザを実質的に改善しないだろうという印象を受けました。そいつらはバグで、修正されるでしょう (たぶん <abbr title="Synchronized Multimedia Integration Language">SMIL</abbr> 以外は…一体なんで?) が、Web 製作者ないしユーザに少しの影響もないものです。ほとんど「標準への関与」 ("commitment to standards") に対してスタンドプレーする機会のようなものにしか見えません。<a href="http://blog.mozilla.com/rob-sayre/2008/03/06/web-regression-test-for-03062008/">テキストノードが相互運用性をもたない</a>のに <code>createNodeIterator</code> をテストするのは心得違いでしかも偽善的だと私は思います。</p>
<p>加えて、標準への関与は Mozilla において強い力をもっており、そしてそこに我々は自分達の実装に機械的に合格印を押す人を絶えず探したりはしません。</p>
<p>追記 &#8212; 私は <a href="http://my.opera.com/desktopteam/blog/2008/03/26/opera-and-the-acid3-test">Opera が最初に 100/100 を叩き出した</a>というのを知りませんでした。おめでとう、貧相な発想の標準とすべてに。 ;-)</p>
<p>再追記 &#8212; <a href="http://trac.webkit.org/projects/webkit/changeset/31322">恥を知れ!</a>
</p>
</div>

]]>
</content:encoded>
<dc:subject>mozilla</dc:subject>

</item>
<item rdf:about="http://taken.s101.xrea.com/blog/article.php?id=834">
<title>SUMO</title>
<link>http://taken.s101.xrea.com/blog/article.php?id=834</link>
<dc:date>2008-03-27T10:31:45+0900</dc:date>
<dc:creator>Taken</dc:creator>
<description>Firefox trunk ではヘルプが SUMO (support.mozilla.com) になったとのことなので、さっそく F1 を押してみたら www.mozilla.org/support/ につながってしまい、以下のようなメッセ...</description>
<content:encoded>
<![CDATA[
<p>Firefox trunk ではヘルプが SUMO (<a href="http://support.mozilla.com/">support.mozilla.com</a>) になったとのことなので、さっそく <kbd>F1</kbd> を押してみたら <a href="http://www.mozilla.org/support/">www.mozilla.org/support/</a> につながってしまい、以下のようなメッセージが。</p>
<blockquote cite="http://www.mozilla.org/support/" title="mozilla - Mozilla Support">
<div>NOTE: Firefox Support Official Online Documentation and Frequently Asked Questions are currently down, due to server issues. For Firefox Help, try the other support resources linked on this page.</div>
</blockquote>
<p>さっそく落ちてしまったようです。Firefox 3 がリリースした後は大丈夫でしょうか。</p>
<ul>
<li>
<a href="http://blog.mozilla.com/sumo/2008/03/26/sumo-is-currently-down/" title="Firefox Support Blog &#187; Blog Archive &#187; SUMO is currently down">SUMO is currently down</a>
</li>
</ul>

]]>
</content:encoded>
<dc:subject>mozilla</dc:subject>

</item>

</rdf:RDF>