<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cameron McCormack&#039;s blog</title>
	<atom:link href="http://mcc.id.au/feed" rel="self" type="application/rss+xml" />
	<link>http://mcc.id.au</link>
	<description>mcc.id.au</description>
	<lastBuildDate>Mon, 01 Apr 2013 23:09:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>@supports enabled by default for Firefox 22</title>
		<link>http://mcc.id.au/blog/2013/04/supports-enabled-by-default</link>
		<comments>http://mcc.id.au/blog/2013/04/supports-enabled-by-default#comments</comments>
		<pubDate>Mon, 01 Apr 2013 23:09:57 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=226</guid>
		<description><![CDATA[The CSS Working Group is planning to publish the CSS Conditional Rules Module as a Candidate Recommendation soon. As a result, David Baron has landed a patch that enables the @supports rule and the CSS.supports() API by default for Firefox 22, which is scheduled to hit Release some time in May.]]></description>
			<content:encoded><![CDATA[<p>The CSS Working Group is planning to publish the <a href="http://dev.w3.org/csswg/css-conditional/">CSS Conditional Rules Module</a> as a Candidate Recommendation soon.  As a result, David Baron has <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=855455">landed a patch</a> that enables the <a href="http://mcc.id.au/blog/2012/08/supports"><code>@supports</code> rule</a> and the <a href="http://mcc.id.au/blog/2012/12/css-supports-api"><code>CSS.supports()</code> API</a> by default for Firefox 22, which is scheduled to hit Release some time in May.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2013/04/supports-enabled-by-default/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Scoped style sheets</title>
		<link>http://mcc.id.au/blog/2013/01/scoped-style-sheets</link>
		<comments>http://mcc.id.au/blog/2013/01/scoped-style-sheets#comments</comments>
		<pubDate>Tue, 15 Jan 2013 23:43:55 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=175</guid>
		<description><![CDATA[Scoped style sheets are a feature from HTML 5 (or the HTML Standard, if you prefer) that allows the effect of a style sheet to be limited to a subtree of the document. By placing a scoped attribute on a &#60;style&#62; element, the style sheet applies only to elements within the subtree rooted by the [...]]]></description>
			<content:encoded><![CDATA[<p>Scoped style sheets are a feature <a href="http://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#attr-style-scoped">from HTML 5</a> (or <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#attr-style-scoped">the HTML Standard</a>, if you prefer) that allows the effect of a style sheet to be limited to a subtree of the document.  By placing a <code>scoped</code> attribute on a <code>&lt;style&gt;</code> element, the style sheet applies only to elements within the subtree rooted by the parent of the <code>&lt;style&gt;</code> element.</p>
<p>For example, consider this document:</p>
<pre style="margin-left: 32px">&lt;!DOCTYPE html&gt;
&lt;title&gt;Scoped style example&lt;/title&gt;
&lt;body&gt;
  &lt;style&gt;
    p { font-style: italic; }
  &lt;/style&gt;
  &lt;p&gt;The first paragraph.&lt;/p&gt;
  &lt;p&gt;
    &lt;style <em>scoped</em>&gt;
      p { color: crimson; }
    &lt;/style&gt;
    The second paragraph.
  &lt;/p&gt;
&lt;/body&gt;</pre>
<p>It would be rendered as follows:</p>
<div style="font-style: italic; border: 1px solid #ddd; background-color: #f8f8f8; margin-left: 32px">
<p>The first paragraph.</p>
<p style="color: crimson">The second paragraph.</p>
</div>
<p>Rules in the style sheet only match an element if all of the elements matched by a selector are within the style scope.  Thus, if the rule were instead <code>body > p { color: crimson; }</code>, it would not match that second paragraph.</p>
<p>The <a href="http://dev.w3.org/csswg/css3-cascade/#cascade">CSS Cascading and Inheritance Level 3</a> specification defines that when there are nested style scopes, rules on inner scopes override those from outer scopes, regardless of the specificity of the rules.  Using <code>!important</code> reverses this, and allows outer scopes to win over inner scopes.  Global style sheets, including <code>&lt;style&gt;</code> elements without a <code>scoped=""</code> attribute or those loaded using a <code>&lt;link&gt;</code> element, are treated as if they are scoped to the root element.</p>
<p>One use case for scoped style sheets is to isolate a set of style rules that apply to a single article or comment within a page to ensure that they cannot affect the style of other elements on the page.  On a web site that aggregates articles from different authors, this could allow the designer of the overall site to know that the elements of the page outside the article itself will not be affected by the article&#8217;s styles.</p>
<p>Another is to be able to specify style for a given element&#8217;s pseudo-element, or only when it matches a pseudo-class, which is not possible just by using the <code>style=""</code> on the element or without giving the element an ID and defining the style in a global style sheet.  For example if you have an element styled like this:</p>
<pre>&lt;p>
  ...
  &lt;span style="text-decoration: underline;">looks like a link&lt;/span>
  ...
&lt;/p></pre>
<p>and you decide you want the underline to be applied only when the element is hovered, then it&#8217;s not possible to use the <code>:hover</code> pseudo-class within the <code>style=""</code> attribute.  A scoped style sheet can be used:</p>
<pre>&lt;p>
  ...
  &lt;span>
    <em>&lt;style scoped>:hover { text-decoration: underline; }&lt;/style></em>
    looks like a link
  &lt;/span>
  ...
&lt;/p></pre>
<h2>Implementation</h2>
<p>Firefox 21, currently on the Nightly channel, supports scoped style sheets now that <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=508725">bug 508725</a> has landed.  This feature is not prefixed or behind a pref.  The <code>scoped=""</code> attribute can be placed on SVG <code>&lt;style&gt;</code> elements, too.</p>
<p>There are two aspects of the Firefox implementation that don&#8217;t match the specification yet:</p>
<ol>
<li>The <code>@global</code> at-rule, to allow all elements during selector matching except for the subject to be outside the style scope, is not implemented.  The name &#8220;global&#8221; doesn&#8217;t quite convey the meaning it has, and given there are no other at-rules that can be used as a prefix to a list of selectors, some other syntax might be better.  (Filed as <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=830058">bug 830058</a>.)</li>
<li>Other at-rules that have global effects, including <code>@font-face</code> and <code>@keyframes</code>, are not processed at all within scoped style sheets.  The HTML specification states that these should have effects limited to the style scope.  (Filed as <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=830056">bug 830056</a>.)</li>
</ol>
<p><small>[Edited 16 January 2013 – fixed the typo pointed out by Pablo]</small></p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2013/01/scoped-style-sheets/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The paint-order property</title>
		<link>http://mcc.id.au/blog/2013/01/paint-order</link>
		<comments>http://mcc.id.au/blog/2013/01/paint-order#comments</comments>
		<pubDate>Mon, 14 Jan 2013 22:29:22 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=160</guid>
		<description><![CDATA[In SVG 1.1, every shape and text element has its components painted in the same order: fill, then stroke and finally any markers. In some situations, authors want these to be painted in a different order. The usual workaround to achieve this is to duplicate the element, and have say a stroke but no fill [...]]]></description>
			<content:encoded><![CDATA[<p>In SVG 1.1, every shape and text element has its components painted in the same order: fill, then stroke and finally any markers.  In some situations, authors want these to be painted in a different order.  The usual workaround to achieve this is to duplicate the element, and have say a stroke but no fill set on the first and vice versa on the second.</p>
<p>SVG 2 adds a simple property that allows the author to control the painting order of the components of a shape or text content element: the <a href="http://www.w3.org/TR/2012/WD-SVG2-20120828/painting.html#PaintOrder">paint-order</a> property.  The initial value of the property is <code>normal</code>, which gets you the default, SVG 1.1 behaviour.  To specify a different order, a sequence of <code>fill</code>, <code>stroke</code> and <code>markers</code> keywords is used.  The keywords cannot be repeated, but some can be omitted, in which case all of the remaining unspecified components are painted in their default order, after the ones that were explicitly specified.  For example, <code>paint-order="stroke"</code> is equivalent to <code>paint-order="stroke fill markers"</code>.</p>
<p>Where I often want to place the stroke underneath the fill is when stroking text.  The problem with placing the stroke above the fill of a text element is that the stroke straddles the boundary of the fill, half lying inside the glyphs and half outside.  This results in the apparent glyph shape changing, the thicker the stroke you use.</p>
<p>The following example demonstrates the use of <code>paint-order</code> on a <code>&lt;text&gt;</code> element to produce stroked text that looks nicer:</p>
<pre>&lt;svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"&gt;
  &lt;linearGradient id="g" x1="0" y1="0" x2="0" y2="1"&gt;
    &lt;stop stop-color="#888"/&gt;
    &lt;stop stop-color="#ccc" offset="1"/&gt;
  &lt;/linearGradient&gt;
  &lt;rect width="400" height="200" fill="url(#g)"/&gt;
  &lt;g fill="crimson" stroke="white" stroke-width="6" stroke-linejoin="round"
     text-anchor="middle" font-family="sans-serif" font-size="50px" font-weight="bold"&gt;
    &lt;text x="200" y="75"&gt;stroke over&lt;/text&gt;
    &lt;text x="200" y="150" <em>paint-order="stroke"</em>&gt;stroke under&lt;/text&gt;
  &lt;/g&gt;
&lt;/svg&gt;</pre>
<p>The example would be rendered like this:</p>
<div style="text-align: center"><img src="http://mcc.id.au/2013/paint-order.png" width="400" height="200" title="Rendering of the paint-order example"></div>
<p>Perhaps this comparison is a bit unfair; the apparent thickness of the stroke on the element with <code>paint-order="stroke"</code> is half that of the text with the default <code>paint-order</code> since half of it is occluded by the fill.  Here is what it would look like if the first text element had <code>stroke-width="3"</code>:</p>
<div style="text-align: center"><img src="http://mcc.id.au/2013/paint-order-2.png" width="400" height="200" title="Rendering of the paint-order example, but with the first text element with stroke-width set to 3"></div>
<p>It&#8217;s clearer to see here that due to the stroke paint intruding on the fill of the first text element, the red glyphs end up looking eroded, while those in the second element appear normal.</p>
<h2>Implementation</h2>
<p>Since <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=828805">bug 828805</a> landed yesterday, support for the <code>paint-order</code> property is now available in Firefox Nightly.  It currently is enabled only when the <code>svg.paint-order.enabled</code> property is set to <code>true</code>, which is the default on the Firefox Nightly and Aurora channels.  Once the SVG 2 specification matures further, support will be enabled across all channels.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2013/01/paint-order/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The mask-type property</title>
		<link>http://mcc.id.au/blog/2012/12/mask-type</link>
		<comments>http://mcc.id.au/blog/2012/12/mask-type#comments</comments>
		<pubDate>Sat, 29 Dec 2012 02:49:08 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=102</guid>
		<description><![CDATA[TL;DR: The mask-type property is now available in Firefox Nightly. Here is a simple use of an SVG mask: &#60;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 341" width="512" height="341"&#62; &#60;defs&#62; &#60;mask id="m"&#62; &#60;circle cx="256" cy="200" r="150"/&#62; &#60;/mask&#62; &#60;/defs&#62; &#60;g mask="url(#m)"&#62; &#60;image width="512" height="341.5" xlink:href="http://farm8.staticflickr.com/7063/6860283873_b9f2e6d511_b.jpg"/&#62; &#60;!-- original: http://www.flickr.com/photos/yewenyi/6860283873/ http://creativecommons.org/licenses/by-nc/2.0/ --&#62; &#60;/g&#62; &#60;/svg&#62; And here is how it [...]]]></description>
			<content:encoded><![CDATA[<p><i>TL;DR: The <code>mask-type</code> property is now available in Firefox Nightly.</i></p>
<p>Here is a simple use of an <a href="http://www.w3.org/TR/SVG11/masking.html#Masking">SVG mask</a>:</p>
<pre>&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
     viewBox="0 0 512 341" width="512" height="341"&gt;
  &lt;defs&gt;
    &lt;mask id="m"&gt;
      &lt;circle cx="256" cy="200" r="150"/&gt;
    &lt;/mask&gt;
  &lt;/defs&gt;
  &lt;g mask="url(#m)"&gt;
    &lt;image width="512" height="341.5" xlink:href="http://farm8.staticflickr.com/7063/6860283873_b9f2e6d511_b.jpg"/&gt;
    &lt;!-- original: http://www.flickr.com/photos/yewenyi/6860283873/
         http://creativecommons.org/licenses/by-nc/2.0/ --&gt;
  &lt;/g&gt;
&lt;/svg&gt;</pre>
<p>And here is how it renders:</p>
<p><iframe width=512 height=341 src="http://mcc.id.au/2012/mask-wrong.svg" style="border: 1px solid rgb(221,221,221); margin-left: 24px; background-color: rgba(255,255,255,0.5)"></iframe></p>
<p>Er, what?  This should be a simple raster image masked by a circle.  What went wrong?</p>
<p>If you&#8217;re like me, you would have made this mistake a thousand times.  The problem is that the <code>mask</code> element looks at the <em>luminance</em> of the mask child content to determine how much of the masked graphics to let show through.  Luminance is a measure of brightness – black has luminance of 0 and white has a luminance of 1.  The different red, green and blue component values contribute with different weights, and the luminance value is then multiplied with the alpha of the mask content pixel to determine the final mask value.  For each pixel, the mask value is multiplied by the RGBA pixel in the masked content.  Since our mask consists only of a black circle (black is the initial value of the <code>fill</code> property), the mask value over the entire mask is 0, letting nothing of the masked content through!  What we should have done is specified <code>fill="white"</code> on the circle.</p>
<p>It is a very common misconception that SVG masks look just at the alpha of the mask content, and this is also a common way that masks are used in authoring tools.  To accommodate this, <a href="http://svgwg.org/svg2-draft/">SVG 2</a> uses the new <a href="http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html">CSS Masking</a> specification, which, among other things, allows an author to specify that the alpha of a mask&#8217;s content, and not the luminance, is used to determine mask values.  This is done by the use of the <code>mask-type</code> property.  We can use it in our example as follows:</p>
<pre>&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
     viewBox="0 0 512 341" width="512" height="341"&gt;
  &lt;defs&gt;
    &lt;mask id="m" <em>mask-type="alpha"</em>&gt;
      &lt;circle cx="256" cy="200" r="150"/&gt;
    &lt;/mask&gt;
  &lt;/defs&gt;
  &lt;g mask="url(#m)"&gt;
    &lt;image width="512" height="341.5" xlink:href="http://farm8.staticflickr.com/7063/6860283873_b9f2e6d511_b.jpg"/&gt;
    &lt;!-- original: http://www.flickr.com/photos/yewenyi/6860283873/
         http://creativecommons.org/licenses/by-nc/2.0/ --&gt;
  &lt;/g&gt;
&lt;/svg&gt;</pre>
<p>and the resulting image would look like this:</p>
<p><iframe width=512 height=341 src="http://mcc.id.au/2012/mask-right.svg" style="border: 1px solid rgb(221,221,221); margin-left: 24px; background-color: rgba(255,255,255,0.5)"></iframe></p>
<p>Now, obviously this example is simple enough that if you could remember that you needed to change something to make the mask work, you would probably remember that <code>fill="white"</code> would work just as well as <code>mask-type="alpha"</code>.  The <code>mask-type</code> property could become more useful if you already have some graphics (either SVG content, perhaps referencing some raster images too) that has alpha.  Although it would be possible to use an SVG filter to convert the alpha channel into an opaque image with just the right shade of white, this seems unnecessary work for the author.</p>
<p>Since <code>mask-type</code> is a CSS property, it means you can also set it once for all masks in a document with a single style rule, <code>mask { mask-type: alpha }</code>.</p>
<h2>Implementation</h2>
<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793617">Bug 793617</a> has just landed, which means that the <code>mask-type</code> property is now available in Firefox.  As with other new features we have been implementing recently, this property is not prefixed.  Instead, it lives behind a pref – <code>layout.css.masking.enabled</code> in this case.  The pref will default to being <code>true</code> for Nightly and Aurora builds, and <code>false</code> for Beta and Release.  Once the CSS Masking specification has matured further, the feature will be enabled by default on all builds.  This means that you can begin experimenting with the property, but don&#8217;t write productions web sites that rely on it just yet!</p>
<p>In WebKit land, <a href="https://bugs.webkit.org/show_bug.cgi?id=97011">Dirk Schulze has implemented the property</a>, also without a prefix.</p>
<p><small>[Edited 29 December 2012 – fix the examples to not use <code>fill="white"</code> as pointed out by <i>roc</i>]</small></p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2012/12/mask-type/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS.supports() API in Firefox Nightly</title>
		<link>http://mcc.id.au/blog/2012/12/css-supports-api</link>
		<comments>http://mcc.id.au/blog/2012/12/css-supports-api#comments</comments>
		<pubDate>Wed, 26 Dec 2012 23:33:29 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=133</guid>
		<description><![CDATA[As a followup to this post announcing the @supports at-rule implementation, Firefox Nightly now (as of bug 779917) has support for the DOM API part of the CSS Conditional Rules Level 3 specification. The new CSS.supports function can be called in two different ways. The first is with a property name and value pair: if [...]]]></description>
			<content:encoded><![CDATA[<p>As a followup to <a href="http://mcc.id.au/blog/2012/08/supports">this post</a> announcing the <code>@supports</code> at-rule implementation, Firefox Nightly now (as of <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=779917">bug 779917</a>) has support for the <a href="http://dev.w3.org/csswg/css3-conditional/#the-css-interface">DOM API part</a> of the <a href="http://dev.w3.org/csswg/css3-conditional/">CSS Conditional Rules Level 3</a> specification.  The new <code>CSS.supports</code> function can be called in two different ways.  The first is with a property name and value pair:</p>
<pre class="code">if (CSS.supports("display", "flex")) {
  // do something relying on flexbox
}</pre>
<p>The second is with an entire expression that can appear just after <code>@supports</code>:</p>
<pre class="code">if (CSS.supports("(display: flex) and (display: grid)")) {
  // do something relying on flexbox and grid layout
}</pre>
<p>As with the <code>@supports</code> rule itself, the <code>CSS.supports()</code> API lives behind the <code>layout.css.supports-rule.enabled</code> pref, which is enabled by default in Nightly and Aurora builds of Firefox.</p>
<p><small>[Edited 28 December 2012 – fixed <code>display: flexbox</code> to <code>display: flex</code> as pointed out by <i>fantasai</i>]</small></p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2012/12/css-supports-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two new reftest features</title>
		<link>http://mcc.id.au/blog/2012/11/two-new-reftest-features</link>
		<comments>http://mcc.id.au/blog/2012/11/two-new-reftest-features#comments</comments>
		<pubDate>Thu, 29 Nov 2012 01:29:17 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=89</guid>
		<description><![CDATA[Running a subset of reftests One aspect of running reftests that periodically annoyed me was that I would often want to run a subset of all the reftests within a particular directory. Sometimes it would be a single test that I wanted to run, other times a particular set of tests. With the mochitest harness, [...]]]></description>
			<content:encoded><![CDATA[<h2>Running a subset of reftests</h2>
<p>One aspect of running reftests that periodically annoyed me was that I would often want to run a subset of all the reftests within a particular directory.  Sometimes it would be a single test that I wanted to run, other times a particular set of tests.  With the mochitest harness, it&#8217;s easy to run an individual test:</p>
<pre>$ TEST_PATH=path/to/the/test.html make -C $(OBJDIR) mochitest-plain</pre>
<p>or just:</p>
<pre>$ ./mach mochitest path/to/the/test.html</pre>
<p>if you&#8217;re using <a href="https://developer.mozilla.org/en-US/docs/Developer_Guide/mach">mach</a>.  This wasn&#8217;t possible with the reftest harness, since you need to give a manifest file that has information about what the document that provides the reference image is, whether it&#8217;s a test for equality or inequality, and so on.</p>
<p>Usually I would deal with this by either writing up a new manifest file, copying the relevant entries from the real <code>reftest.list</code> manifest, or by temporarily commenting out all the entries but the ones I was interested in.  This was a bit of pain, so now with <a title="Bug 809312 - add ability to run a subset of reftests from a manifest" href="https://bugzilla.mozilla.org/show_bug.cgi?id=809312">bug 809312</a> landed, you can pass a <code>--filter</code> command line option to runreftest.py to select which tests to run.</p>
<p><code>--filter</code> takes a regular expression against which to test the first (test) URL of each test entry in the manifest file you are using.  It uses JS regular expression syntax.  So if you are still using the make targets to run reftests, you could do this:</p>
<pre>$ EXTRA_TEST_ARGS=--filter=mask TEST_PATH=layout/reftests/svg/ \
    make -C $(OBJDIR) reftest</pre>
<p>and it will run only the reftests whose test URL matches <code>/mask/</code>.  And with mach it&#8217;s simpler:</p>
<pre>$ ./mach reftest layout/reftest/svg/ --filter=mask</pre>
<p>If you just want to run a single reftest, you can write the whole filename there:</p>
<pre>$ ./mach reftest layout/reftest/svg/ --filter=mask-basic-01.svg</pre>
<p>It&#8217;s still a regular expression, so the dot will match any character, but it&#8217;s unlikely to matter given the simple filenames we use.</p>
<p>Note that the regular expression is matched against the absolute URL of the test document, which is going to be something like <code>file:/path/to/your/repo/layout/reftests/...</code>.  So if you specify <code>--filter=file</code> don&#8217;t be surprised if all tests run!</p>
<h2>Specifying default preferences in a reftest manifest</h2>
<p>Recent features I have been working on, such as <code>@supports</code>, live behind a pref until we decide that their relevant specification is stable enough.  We default the pref to true for Firefox Nightly and Aurora builds, and false for Beta and Release.  Initially, I had a number of reftests for <code>@supports</code> that were skipped when the feature was not enabled, but it was pointed out that it would be better to force the pref on while running the tests so that we didn&#8217;t lose test coverage on the Beta and Release branches.  My reftest manifest then looked like this:</p>
<pre>pref(layout.css.supports-rule.enabled,true) == css-supports-001.xht support/pass.xht
pref(layout.css.supports-rule.enabled,true) == css-supports-002.xht support/pass.xht
pref(layout.css.supports-rule.enabled,true) == css-supports-003.xht support/pass.xht
pref(layout.css.supports-rule.enabled,true) == css-supports-004.xht support/pass.xht
pref(layout.css.supports-rule.enabled,true) == css-supports-005.xht support/pass.xht
...</pre>
<p>It seemed a bit silly to have to repeat this <code>pref()</code> setting for each test, so with <a title="Bug 788967 - add ability to run a subset of reftests from a manifest" href="https://bugzilla.mozilla.org/show_bug.cgi?id=788967">bug 788967</a> landed, you can now use a <code>default-preferences</code> statement in a reftest manifest to specify preferences to use for the remaining tests in the manifest:</p>
<pre>default-preferences pref(layout.css.supports-rule.enabled,true)
== css-supports-001.xht support/pass.xht
== css-supports-002.xht support/pass.xht
== css-supports-003.xht support/pass.xht
== css-supports-004.xht support/pass.xht
== css-supports-005.xht support/pass.xht
...</pre>
<p><code>pref()</code>, <code>test-pref()</code> and <code>ref-pref()</code> can all be used in a <code>default-preferences</code> statement.</p>
<p>See the <a href="http://hg.mozilla.org/mozilla-central/file/c63d5cff18ba/layout/tools/reftest/README.txt#l293">reftest documentation</a> for very slightly more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2012/11/two-new-reftest-features/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Support for @supports in Firefox Nightly</title>
		<link>http://mcc.id.au/blog/2012/08/supports</link>
		<comments>http://mcc.id.au/blog/2012/08/supports#comments</comments>
		<pubDate>Fri, 03 Aug 2012 01:25:56 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=73</guid>
		<description><![CDATA[Yesterday I landed support for the CSS @supports at-rule for Gecko (based in part on some earlier work done by former intern Vitor Menezes), and it should now be in Firefox Nightly builds. @supports is part of CSS Conditional Rules Module Level 3, and allows authors to condition rules based on whether particular property declarations [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I landed support for the CSS <code>@supports</code> at-rule for Gecko (based in part on some earlier work done by former intern Vitor Menezes), and it should now be in Firefox Nightly builds.  <code>@supports</code> is part of <a href="http://dev.w3.org/csswg/css3-conditional/">CSS Conditional Rules Module Level 3</a>, and allows authors to condition rules based on whether particular property declarations are supported.</p>
<p>For example, let&#8217;s say you want to use a WOFF font but only if you are able to turn on its use of tabular numerals through the ‘<a href="http://dev.w3.org/csswg/css3-fonts/#font-variant-numeric-prop">font-variant-numeric</a>’ property from <a href="http://dev.w3.org/csswg/css3-fonts">css3-fonts</a>.  You could write that as follows:</p>
<pre>@font-face { font-family: MyFontWithTabularNumerals; src: url(some.woff); }

.price { font-family: monospace }

@supports (font-variant-numeric: lining-nums) {
  .price { font-family: MyFontWithTabularNumerals;
           font-variant-numeric: lining-num; }
}</pre>
<p>The text between the <code>@supports</code> and the open brace is the supports condition, and the rules within the braces are only applied if the condition evaluates to true.  In a user agent that supports <code>@supports</code> but not ‘font-variant-numeric’, elements with class “price” will be rendered with the standard monospace font, but for those that do implement the property, MyFontWithTabularNumerals will be used.</p>
<p>The supports condition can use conjunctions, disjunctions and negations to form an expression:</p>
<pre>@supports (width: 75vw) and (height: 50vh) {
  #main { position: absolute; top: 32px; left: 32px;
          width: 75vw; height: 50vh; }
}

@supports not (font-size: calc(1rem + 8px)) {
  body { font-size: 16px }
  body > h1 { font-size: 24px }
}</pre>
<p>Note that a supports condition that includes a mix of conjunctions and disjunctions must always use parentheses to explicitly indicate their precedence.  For example, instead of</p>
<pre>@supports (color: green) and
          (background-color: yellow) or
          (background-color: eggyolk) ...</pre>
<p>you must write either:</p>
<pre>@supports (color: green) and
          ((background-color: yellow) or
           (background-color: eggyolk)) ...</pre>
<p>or:</p>
<pre>@supports ((color: green) and
           (background-color: yellow)) or
          (background-color: eggyolk) ...</pre>
<h2>Support behind a pref</h2>
<p>To avoid having to prefix <code>@supports</code>, the implementation lives behind a preference that for the moment is enabled.  If by the time Firefox 17 gets to Beta (some time in October) we feel that the specification is not yet stable enough or there aren&#8217;t any other implementations, we&#8217;ll flip the pref back to turn it off in the Beta channel so that we have some more time to tweak the implementation before the web starts to depend on it.</p>
<p>In the meantime, we encourage authors to experiment with it and provide feedback!</p>
<p><em>Update: While the changes have landed in the mozilla-central repository, they arrived after today&#8217;s Nightly was built!  So check back in 24 hours and then you&#8217;ll be able to try it out.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2012/08/supports/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Integrating the Self-Serve Build API with Tinderboxpushlog</title>
		<link>http://mcc.id.au/blog/2011/04/integrating-self-serve-with-tbpl</link>
		<comments>http://mcc.id.au/blog/2011/04/integrating-self-serve-with-tbpl#comments</comments>
		<pubDate>Wed, 27 Apr 2011 04:28:45 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=46</guid>
		<description><![CDATA[A couple of months ago, Chris AtLee announced the Self-Serve Build API, a RESTful HTTP interface to Mozilla&#8217;s build system that lets users kick off and cancel builds themselves. The API is exposed with a simple web interface, but more convenient would be the ability to cancel and re-run builds directly from Tinderboxpushlog. Now that [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago, Chris AtLee <a href="http://atlee.ca/blog/2011/02/17/self-serve-builds/">announced the Self-Serve Build API</a>, a RESTful HTTP interface to Mozilla&#8217;s build system that lets users kick off and cancel builds themselves.  The API is exposed with <a href="https://build.mozilla.org/buildapi/self-serve">a simple web interface</a>, but more convenient would be the ability to cancel and re-run builds directly from <a href="http://tbpl.mozilla.org/">Tinderboxpushlog</a>. Now that <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=634915">bug 634915</a> has landed, that convenience has arrived!</p>
<p>To request an additional build or test run, select an already completed job and click on the &#8220;Rebuild&#8221; icon.</p>
<p><img src="http://mcc.id.au/2011/rebuild.png" alt='The "Rebuild" icon is the blue plus symbol that appears in the bottom left build information box.' class="figure"/></p>
<p>You can request multiple runs just by clicking the icon multiple times in succession.  There&#8217;s no need to wait for one request to have completed before clicking it again, either.</p>
<p><img src="http://mcc.id.au/2011/rebuild1.png" alt='Each time the "Rebuild" icon is clicked, a status is shown at the top of the page indicating the status of the request.'  class="figure" /></p>
<p>To cancel a build, click on the &#8220;Cancel&#8221; icon that appears in the same place after clicking on a build that is pending or already running.</p>
<p><img src="http://mcc.id.au/2011/cancel.png" alt="" class="figure" /></p>
<p>Note that <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=634592">bug 634592</a> was recently fixed, so this works for cancelling test runs as well as builds themselves.</p>
<p>Be patient though, after cancelling or requesting a new build.  It can take a minute or two for the results to show up in the main TBPL view!</p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2011/04/integrating-self-serve-with-tbpl/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Across the Tasman</title>
		<link>http://mcc.id.au/blog/2010/10/across-the-tasman</link>
		<comments>http://mcc.id.au/blog/2010/10/across-the-tasman#comments</comments>
		<pubDate>Sun, 24 Oct 2010 06:32:12 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=35</guid>
		<description><![CDATA[Now that I&#8217;m getting settled in, it&#8217;s time to get blogging again. Settled in where, you say? At the start of this month, I made the cross-Tasman voyage to Auckland to start working at Mozilla! It&#8217;s an exciting change for me, and it probably wouldn&#8217;t be too much of an exaggeration to say that it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I&#8217;m getting settled in, it&#8217;s time to get blogging again.  Settled in where, you say?  At the start of this month, I made the cross-Tasman voyage to Auckland to start working at <a href='http://www.mozilla.org/'>Mozilla</a>!  It&#8217;s an exciting change for me, and it probably wouldn&#8217;t be too much of an exaggeration to say that it&#8217;s pretty much my dream job!  Who wouldn&#8217;t want to be paid for hacking on open source software?  Being able to walk to work in about five minutes isn&#8217;t half bad, either.</p>
<p>I&#8217;m three weeks in so far, and I&#8217;ve mostly been getting back into web standards groups that I was involved in before taking my <a href='http://www.w3.org/2002/02/mid/20091009041306.GD24133@wok.mcc.id.au;list=public-script-coord'>hiatus</a> to finish off my thesis.  (&#8220;How <i>is</i> that thesis going?&#8221; I hear you ask, as politely as you can when enquiring about such things. Well, I got a goodly amount done during that time – importantly, I finished work on the diagram authoring tool and ran the experiment – but the thesis itself isn&#8217;t done. Writing continues on weekends and other non-work time.)  In that time I&#8217;ve managed to finish porting <i>Web IDL</i> to ECMAScript 5, which was one of the major tasks remaining to do on it, and on Thursday a <a href='http://www.w3.org/TR/2010/WD-WebIDL-20101021/'>new Working Draft</a> was published.  Yeah!</p>
<p>Hopefully my new machine arrives next week, and I can start on <a href='https://bugzilla.mozilla.org/show_bug.cgi?id=477171'>My First Bug™</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2010/10/across-the-tasman/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moved</title>
		<link>http://mcc.id.au/blog/2009/03/moved</link>
		<comments>http://mcc.id.au/blog/2009/03/moved#comments</comments>
		<pubDate>Mon, 02 Mar 2009 00:57:48 +0000</pubDate>
		<dc:creator>Cameron McCormack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[uni]]></category>

		<guid isPermaLink="false">http://mcc.id.au/?p=28</guid>
		<description><![CDATA[I haven&#8217;t officially been a student since March last year, when my candidature lapsed; I&#8217;m a part-time research assistant now. Over the last 12 months I technically haven&#8217;t been allowed to stay in the shared postgrads office, but Kim somehow had managed to organise for me to stay in there on one of the free [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t officially been a student since March last year, when my candidature lapsed; I&#8217;m a part-time research assistant now.  Over the last 12 months I technically haven&#8217;t been allowed to stay in the shared postgrads office, but <a href=http://www.csse.monash.edu.au/~marriott/>Kim</a> somehow had managed to organise for me to stay in there on one of the free desks.  Since the beginning of this year, the calls from the admin staff for me to move out have intensified, with new PhD students starting and being allocated to desks in the office.  So today I have finally given in and moved two doors down to room 134 sharing with <a href=http://advogato.org/person/pjrm/>pjrm</a>.  My new number here is <a href=tel:+61.3.9905.8673>+61-3-9905-8673</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcc.id.au/blog/2009/03/moved/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
