<?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"
	>

<channel>
	<title>Thoughts From Eric &#187; Tech</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/category/tech/rss2/full" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it's largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<pubDate>Fri, 22 May 2009 12:39:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>Digging in the Mud</title>
		<link>http://meyerweb.com/eric/thoughts/2009/04/14/digging-in-the-mud/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/04/14/digging-in-the-mud/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 13:09:03 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[Questions]]></category>

		<category><![CDATA[Tech]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1120</guid>
		<description><![CDATA[There's something about the DiggBar imbroglio (the Diggbroglio?) that has left me scratching my head:  how is it that so many people are up in arms about the DiggBar when they've had nothing to say about the framing bars of StumbleUpon, FaceBook, etc. etc.?]]></description>
			<content:encoded><![CDATA[<p>
There&#8217;s something about the Diggbroglio that has left me scratching my head:  how is it that so many people are up in arms about the DiggBar when they&#8217;ve had nothing to say about the framing bars of StumbleUpon, FaceBook, etc. etc.?
</p>
<p>
Now, please note that I&#8217;m <strong>not</strong> saying the DiggBar, or any other framing bar, is cool and we should all love it.  I&#8217;m not.  I absolutely, completely, totally get all the reasons why framing bars are bad for breaking bookmarking and navigating and search engines and copyright and hijacking content and so on.  But that&#8217;s precisely why I&#8217;m so confused, because we&#8217;ve known for years now that framing bars are bad mojo&#8212;and yet <a href="http://www.stumbleupon.com/">StumbleUpon</a>, for example, is based on bars.  There is a browser extension/plugin StumbleUpon thingy you can install, but there&#8217;s also a web-based framing bar thing (<a href="http://www.stumbleupon.com/toolbar/#topic=Science/Tech&#038;url=http%253A%252F%252Fwww2.warwick.ac.uk%252Fnewsandevents%252Fpressreleases%252Fnew_flat_flexible">see this link, for example</a>) that they offer, and I bet people use.  You don&#8217;t have to be a member to use it: I hit that link in a browser that allows cross-site frame loading and I get the bar and the page it&#8217;s framing, and I&#8217;ve never been a StumbleUpon member.  The source shows it&#8217;s using <code>iframe</code>s to make it happen.  So far as I can tell, it&#8217;s not really different from the DiggBar.
</p>
<p>
So why do we have people writing JavaScript and PHP and Ged-knows-what-else that specifically busts out of the <em>DiggBar</em> framing, instead of busting out of <em>all</em> framing?  After all, site framing is universally agreed to be objectionable; even yet-to-be-discovered life forms orbiting distant stars think it&#8217;s a bad idea.  So why is one instance of it being targeted while the rest are tolerated?  Why are we all not just using <code>if (top != self) {top.location.replace(self.location.href);}</code> and other-language equivalents?  Yes, I know, some of you do just that, but why isn&#8217;t everyone?
</p>
<p>
Perhaps because I have yet to eradicate a stubborn streak of faith in the rationality of my peers, I assume that there&#8217;s some technical difference here that I&#8217;m missing and that, once understood, would let me understand the source of the outcry.  So can someone please explain to me, or point at an explanation that states, the technical ways in which the DiggBar is worse enough than already-extant framing bars that it&#8217;s triggered this outrage?  Again, nobody has to enumerate the complete list of the DiggBar&#8217;s sins; I understand.  A list of any different and more egregious sins would be just fine, though.
</p>
<p>
Also, if anyone comes up with a way to bust out of the frames while still preserving the bar&#8212;that is, correcting the problems framing bars cause while preserving their functionality for the people who want to use them&#8212;that would be extra-cool.  After all, people who use those services like the bars.  If we could let them browse the web the way they prefer while fixing bookmark/SEO/etc. problems framing bars can cause, that would be a win all the way around.
</p>
<p>
<strong>Update 14 Apr 09:</strong> looks like <a href="http://g9g.org/" rel="friend colleague met">Porter</a>&#8217;s <a href="http://g9g.org/backblog/2009/04/14/turning-the-tables-on-the-diggbar.html">trying to keep the bar without the framing</a>.
</p>
<p>
<strong>Update 16 Apr 09:</strong> in <a href="http://daringfireball.net/linked/2009/04/15/diggbar-fix">his post about Digg changing the way the DiggBar will work</a>, <a href="http://daringfireball.net/" rel="acquaintance met">John Gruber</a> lists (by way of quoting Digg VP <a href="http://blog.digg.com/?p=664">John Quinn&#8217;s post about it</a>) the two things that made the DiggBar extra-objectionable (at least in his eyes).  Thanks, John!
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/04/14/digging-in-the-mud/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Handling an Explicit-Width Bug in Internet Explorer</title>
		<link>http://meyerweb.com/eric/thoughts/2009/04/11/handling-an-explicit-width-bug-in-internet-explorer/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/04/11/handling-an-explicit-width-bug-in-internet-explorer/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 20:53:54 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1112</guid>
		<description><![CDATA[I stumbled into a width-increasing bug in IE6 and IE7, and was helped in finding a workaround.]]></description>
			<content:encoded><![CDATA[<p>
In creating the combo-bar charts for <a href="http://aneventapart.com/alasurvey2008">the survey report</a>, I stumbled into an Explorer bug that I didn&#8217;t remember ever seeing before, and Google didn&#8217;t turn up anything that seemed to be related.  This could easily mean that I&#8217;m the only person who ever did something this insane and thus found the bug.  It could just as easily mean that my Google-fu has failed.  Either way, I&#8217;ll write it up here so it can enter the collective memory.  (And surely someone has already noted that Google is positively Jungian?)
</p>
<p>
You can see both the problem and two workarounds if you visit <a href="http://meyerweb.com/eric/css/tests/winie/table-double/testcase.html">this test page</a> using IE6 or IE7.  In brief, the problem occurred when I had a table cell containing a paragraph with an explicit width set.  I did this through the <code>style</code> attribute, though tests show that for this bug, it doesn&#8217;t matter whether you use the attribute or assign it via a style sheet.  Around these explicit-width paragraphs were <code>div</code> elements with <code>width: 200%;</code>, for bar-drawing purposes (it&#8217;s a little complicated).  Everything was fine in 99% of cases.  But as soon as the header text at the beginning of the row went to two lines of text, the explicit-width paragraphs doubled in width.  What was <code>80.1%</code> wide would be drawn as though it were <code>160.2%</code> wide.
</p>
<p>
My hopefully understandable reaction was to say, &#8220;Whuh?&#8221;.  I threw a few hasLayout triggers at the offending paragraph (relative position, <code>zoom</code>, etc.) and got nowhere.  In the end I worked around the problem by telling IE6 and IE7 to not wrap text in the row headers of combo charts.  (The bug is not present in IE8.)
</p>
<p>
I mentioned all this in <a href="http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/">my announcement post</a>, and the ever-awesome <a href="http://wilkinsonweb.com/">Dan Wilkinson</a> <a href="http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/#comment-454002">discovered</a> that the problem could be fixed by setting all of the table rows to, say, <code>height: 3em</code>.  Armed with that breakthrough, I experimented a little more and found that I could actually set the offending table row&#8217;s height to <code>2.75em</code> and still have things work as intended.  Below that and the paragraph widths doubled.
</p>
<p>
Then I lowered the <code>line-height</code> of the headers to <code>1</code> and found that I could take the overall row&#8217;s <code>height</code> as low as <code>2.33em</code> before triggering the bug.  And that&#8217;s when it dawned: the bug was triggered by the layout height of the header cell&#8217;s content being taller than the content of the cell containing the paragraph, <em>and</em> not explicitly declaring styles that would make the data cell as tall as or taller than the height needed to have the header cell contain its content.
</p>
<p>
Okay, that&#8217;s a little dense.  Let me step through the symptoms and two found workarounds to see if that clears it up:
</p>

<ol>
<li>The data cell always has a single line of text.  The bug is triggered by having the header cell go to two lines of text, whereas it is not if the header cell has a single line of text.</li>
<li>If the row&#8217;s height is explicitly set to a value equal to or greater than the header cell&#8217;s content, the bug is not triggered.</li>
<li>Alternatively, if the height of the data cell is set or forced to be equal to or greater than the height of the header cell, the bug is not triggered.  This can be done with an explicit <code>height</code> or with added top and bottom padding or by adding top and bottom margins to the paragraphs in the cell.</li>
</ol>

<p>
Some side tests I did indicate that the header cell is <em>not</em> needed to trigger the bug.  In other words, the problem could happen even if there are only data cells in the row.  Furthermore, I found that the width-scaling was directly affected by the <code>width</code> of the wrapping <code>div</code>, and thus the widths were doubling only because I had the <code>div</code>&#8217;s <code>width</code> set to <code>200%</code>.  If I set it to <code>150%</code> instead of <code>200%</code>, then the paragraphs only got half again as wide instead of doubling.  That seems to make sense until you see it in action.  When I say the paragraphs got half again as wide, I mean that instead of being 75% as wide as the <code>div</code>, they were 112.5% as wide as the <code>div</code>.  If I set the <code>div</code>&#8217;s <code>width</code> to <code>200%</code>, then they were 150% the width of the <code>div</code>.
</p>
<p>
So.  As I say, this bug does not affect IE8, so that&#8217;s good, and it can be worked around in IE6 and IE7, which is even better.  The problem would be if you didn&#8217;t know how tall your cells might get&#8212;in my case, I can be (reasonably) sure that the tallest a cell&#8217;s content will ever get is two lines of text, and by setting an explicit <code>line-height</code> on the headers I can know how tall I have to make the rows in order to avoid the bug.
</p>
<p>
Another day, another workaround!
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/04/11/handling-an-explicit-width-bug-in-internet-explorer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Findings of the A List Apart Survey 2008</title>
		<link>http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 15:50:12 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[Culture]]></category>

		<category><![CDATA[Projects]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1099</guid>
		<description><![CDATA[At last---at long, long last!---<a href="http://alistapart.com/">the results of the A List Apart Survey 2008 are available</a>, along with the anonymized raw data we collected.]]></description>
			<content:encoded><![CDATA[<p>
At last&#8212;at long, long last!&#8212;<a href="http://alistapart.com/articles/findingsfromthewebdesignsurvey2008">the results of the A List Apart Survey 2008 are available</a>, along with the anonymized raw data we collected.
</p>
<p>
There are a great many reasons why it took so long to get this out the door.  A big part is that it&#8217;s almost entirely a volunteer effort, which means it happens in our &#8220;free time&#8221; (and there the word &#8220;free&#8221; has a couple of meanings).  I say it&#8217;s almost entirely a volunteer effort because the detailed analysis is actually done by a pair of professional statisticians, who are paid for their time and expertise.  They did a great job once more, and did it in a reasonable time frame.  It just took us a while to get them the data to analyze, and then a while longer to take their report and findings and process them into report form.
</p>
<p>
The biggest change this year is that we&#8217;re publishing the results as HTML+CSS instead of a PDF.  This greatly increased the challenge, because it was important to me that the data be presented using styled tables, not images.  That&#8217;s easy like cake if all you&#8217;re doing is putting them up as visual tables, and we certainly do that for some of the figures.  In the other cases, where we have bar charts of varying kinds, things got difficult.  I managed to devise solutions that are 99.9% effective, and I&#8217;m both proud of and frustrated by those solutions.  Proud, of course, because I managed to wring three-stack bars out of table markup; frustrated because of the markup I had to construct to make them possible.  I think this report represents more than half my lifetime usage of the <code>style</code> attribute, but unfortunately there&#8217;s no way (using just CSS) to say <code>{width: content;}</code>.
</p>
<p>
So why not use JavaScript to do that, or to just replace the tables with canvas-drawn charts?  I did consider both, but decided that I would push as far as I could with plain HTML+CSS.  
</p>
<p>
A few implementation notes:
</p>

<ul>
<li>
<p>I used HTML 5 in order to step around some previously unrealized limitations of HTML 4&#8212;did you know <code>tfoot</code> has to come before <code>tbody</code> in HTML 4?  <em>I</em> didn&#8217;t.  I did not use elements like <code>header</code> and <code>footer</code> due to known problems in Firefox 2 and related browsers, which mangle pages containing those elements.  Instead, I took <a href="http://jontangerine.com/log/2008/03/preparing-for-html5-with-semantic-class-names">the same path Jon Tan recommends</a>, and classed <code>div</code>s using those names for later, easier conversion.</p>
</li>
<li>
<p>The tables which underlie the charts do not have <code>summary</code> attributes.  If a group of civic-minded individuals would like to write useful summaries, please let me know in the comments and I&#8217;ll let you know how best to submit them.  Similarly, I did my very best to make sure all the table headers had accurate <code>scope</code> values, but if I botched any, let me know.</p>
</li>
<li>
<p>I&#8217;m aware that Opera shows horizontal scrollbars on most chapters of the report.  This is due to its refusal to apply <code>overflow</code> to table boxes, which according to my recent reading of the CSS 2.1 specification is the correct thing to (not) do.  Every other browser I tested does apply <code>overflow</code> to table boxes, though, which I found most useful.  I tried applying <code>overflow: hidden</code> to a few other boxes, and that got rid of Opera&#8217;s horizontal scrollbars, but it also cut off actual content in some other browsers.  I chose a cosmetic problem in one browser over loss of content in others.  The best fix I&#8217;ve devised is to wrap the tables in <code>div</code>s and apply <code>overflow: hidden</code> to those <code>div</code>s, but I didn&#8217;t want to rush the fix and botch it, so it didn&#8217;t make it in time for first publication.  I expect to get it in shortly after publication.</p>
</li>
<li>
<p>In a like vein, there are a few combo charts where a bar goes shooting off the right side of the chart in IE7.  This appears to be due to some kind of width-doubling problem that&#8217;s only invoked on elements with a <code>style</code> attribute when the row header goes to two lines instead of being just one.  Googling for an explanation yielded no joy, and a lengthy series of attempts to hack around the problem came to nothing.  If anyone knows how to counteract that problem other than preventing the header text from going past a single line, I&#8217;d love to hear it.  (Update: I&#8217;ve implemented the &#8220;fix&#8221; of preventing line-wrapping in the report, so there aren&#8217;t any off-the-page bars right now, but you can <a href="http://meyerweb.com/eric/css/tests/winie/table-double/13.html">see an example of the problem on this test page</a>.)</p>
</li>
<li>
<p>Surprisingly, the charts mostly work in IE6.  The exception is some of the triple-stack charts, where data points overlap when the rightmost sub-bars get too small, and also the double-width bars mentioned in the previous point.  I don&#8217;t really have a fix for this short of upgrading the browser, but if somebody finds one, I&#8217;d be happy to test it out.</p>
</li>
</ul>

<p>
On that last point, if there are questions or suggestions surrounding the implementation of the report, we can certainly discuss them here.  With regard to the survey and report itself, though&#8212;that is, the questions asked and the results we&#8217;re publishing&#8212;please direct those thoughts to <a href="http://alistapart.com/comments/findingsfromthewebdesignsurvey2008/">the comments section of the ALA article announcing the report</a>.  I&#8217;m hoping that we&#8217;ll have the 2009 survey up within a few months, so comments on what we asked and how we asked it, what we didn&#8217;t ask but should have, and that sort of thing could well have a direct impact on the next survey.  But please put those on the ALA site, where more people are likely to see them.
</p>
<p>
It&#8217;s done, it&#8217;s out, it&#8217;s yours&#8212;both the report and the data, about which I&#8217;ll soon write a little bit more.  Read the report, or produce your own report using the data.  Just always know that when we publish these reports, we do not mean for them to be the final word.  No, what we always mean is for them to be the <em>first</em> words, a starting point, a place from which to grow.  What comes next is as much up to you as anyone else, and I can&#8217;t wait to see what you do.
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Selectively Disabling Downloaded-File Warnings in Leopard</title>
		<link>http://meyerweb.com/eric/thoughts/2009/03/13/disabling-downloaded-file-warnings-in-leopard/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/03/13/disabling-downloaded-file-warnings-in-leopard/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 11:57:27 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1084</guid>
		<description><![CDATA[If you've been frustrated beyond measure by the Vista-like "are you sure you want to open this file you downloaded from the internet?" dialog in OS X, here's how to disable it for one or more file types. (Update 18 Mar 09: working in 10.5.6; details in post.)]]></description>
			<content:encoded><![CDATA[<p>
One of the things that I&#8217;ve found mind-bendingly annoying about Leopard (besides its complete refusal to allow classic window management) is the &#8220;this file was downloaded from the internet, are you sure you want to open it?&#8221; dialog box.  Yes, damn it: I just downloaded the file with the express intent of opening it.  Stop bothering me.  Keep it up and I might <a href="http://www.youtube.com/watch?v=VuqZ8AqmLPY">mistake you for PC</a>.
</p>
<p>
What&#8217;s even worse is that the dialog requires mouse input to get past.  It would be just within the limits of acceptability if the dialog buttons responded to keyboard input; if I could hit command-O or something to invoke &#8220;Open&#8221;, then I&#8217;d probably keep the safeguard in place, because I could just charge past it with a quick twitch of the fingers.  Since I can&#8217;t, I want it gone.  And of course there&#8217;s no &#8220;don&#8217;t ask me again&#8221; checkbox to tick.
</p>
<p>
After <a href="http://twitter.com/meyerweb/status/1318269392">a plea on Twitter</a>, I got pointers to a couple of ways to disable this annoyance (as well as a ton of &#8220;oh God, I hate that too; let me know if you find an answer!&#8221; replies).  The first way is <a href="http://www.macosxhints.com/article.php?story=20071029151619619">done as a Folder Action</a>.  For a variety of reasons, I&#8217;m not that thrilled by folder actions, so I gave it a pass.  The other approach is to write your own preference file.  Ah, much better!  (Why is this better?  I don&#8217;t know.  It just intuitively feel like the better approach to me.)
</p>
<p>
Now, one way is to just <a href="http://pseudogreen.org/blog/yes_leopard_i_want_to_open_it_already.html">disable the warning for all <tt>public.item</tt> files</a>&#8212;which is to say, every type of file.  I was tempted, but it turns out there&#8217;s a finer grain that can be applied:  <a href="http://mymacinations.com/2008/02/06/changing-the-systems-default-settings-for-html-files-safe/">listing specific file types to be ignored</a>.  Better still!  That way I can switch this off for the file types that I download all the time, like HTML files, and keep the safeguard in place for file types I almost never download, like executable scripts.
</p>
<p>
Doing this means you need a list of OS X&#8217;s Uniform Type Identifiers, so I dug around to find <a href="http://developer.apple.com/documentation/Carbon/Conceptual/understanding_utis/utilist/UTIlist.html#//apple_ref/doc/uid/TP40001319-CH205-CHDIJFGJ">that listing</a>, which appears to have moved in the not-too-distant past.  Here&#8217;s the preference file I&#8217;ve put together with that listing as a guide.  This file lists all of the file types I <em>don&#8217;t</em> want to be nagged about.
</p>

<pre><code>
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
   "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
  &lt;dict&gt;
    &lt;key&gt;LSRiskCategoryNeutral&lt;/key&gt;
    &lt;dict&gt;
      &lt;key&gt;LSRiskCategoryContentTypes&lt;/key&gt;
      &lt;array&gt;
        &lt;string&gt;public.text&lt;/string&gt;
        &lt;string&gt;public.plain-text&lt;/string&gt;
        &lt;string&gt;public.xml&lt;/string&gt;
        &lt;string&gt;public.archive&lt;/string&gt;
        &lt;string&gt;public.image&lt;/string&gt;
        &lt;string&gt;public.audiovisual-content&lt;/string&gt;
        &lt;string&gt;public.font&lt;/string&gt;
      &lt;/array&gt;
    &lt;/dict&gt;
  &lt;/dict&gt;
&lt;/plist&gt;
</code></pre>

<p>
I led with <tt>public.text</tt> because it encompasses not just regular text files, but HTML files as well; <tt>public.xml</tt> appears to cover XHTML, though I&#8217;m not 100% sure where those files fall.  <tt>public.audiovisual-content</tt> covers all audio and video files, as you might guess.  There are probably a few other types I&#8217;ll add over time, as I encounter enough resistance on certain types of files that I don&#8217;t need to be safeguarded.  I&#8217;ll probably never add <tt>public.script</tt> or <tt>public.executable</tt> to the list; personally, I prefer to be warned about that sort of stuff.
</p>
<p>
To make the magic happen, save the above file (or your own variation) as <tt>~/Library/Preferences/com.apple.DownloadAssessment.plist</tt>.  Then log out of and back into your account.  <i>Finito</i>.
</p>
<p>
So if you&#8217;d like to get your Mac to be less of a nag about opening downloaded files, there&#8217;s how.  As the links above show, I&#8217;m standing on the shoulders of giants here, so my thanks to those who paved the way.  I hope that you will be able to benefit from both their work and my small additions thereto.
</p>

<p><strong>Update [13 Mar 09]:</strong> Potentially very bad news, folks.  I just tried this on my 10.5.6 machine and it failed utterly.  As did the Folder Action approach.  Older versions of Leopard apparently didn&#8217;t have this problem.  Anyone else seeing the same kind of thing on their machines?  If either way is still working for you under 10.5.6, can you tell us which one it is in the comments?  Thanks.</p>

<p><strong>Update [18 Mar 09]:</strong> Great news, folks.  <a href="http://benmillett.us/">Ben Millett</a> kindly sent me a copy of his working-under-10.5.6 file and I tried it out, and it worked!  The difference seems to be that the version I was using was encoded as &#8220;Unicode&trade; (UTF-8, no BOM)&#8221; whereas the encoding of the file Ben sent me is &#8220;Western (Mac OS Roman)&#8221; (both according to BBEdit).  So if your copy doesn&#8217;t work, check the file encoding.  Next I&#8217;m going to experiment with adding file extensions, and will report back if I meet with success.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/03/13/disabling-downloaded-file-warnings-in-leopard/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS3 Feedback: Graphical Thoughts</title>
		<link>http://meyerweb.com/eric/thoughts/2009/02/24/css3-feedback-graphical-thoughts/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/02/24/css3-feedback-graphical-thoughts/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 14:35:20 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Commentary]]></category>

		<category><![CDATA[Standards]]></category>

		<category><![CDATA[W3C]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1073</guid>
		<description><![CDATA[My few thoughts on the "<a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#graphical">Graphical Effects</a>" part of the feedback document.]]></description>
			<content:encoded><![CDATA[<p class="aside">(This is part of the <a href="http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/">Feedback on &#8216;WaSP Community CSS3 Feedback 2008&#8242;</a> series.)</p>

<p>
My few thoughts on the &#8220;<a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#graphical">Graphical Effects</a>&#8221; part of the feedback document.  A lot of what was mentioned by the community is already in the pipeline, so there&#8217;s not a lot to say about those except &#8220;hurry &#8216;em up, willya?&#8221;.
</p>

<p>
<strong>Gradients</strong> &#8212; like rounded corners, no surprise these came up.  (All we need is to define <code>wet-floor-reflect</code> and we&#8217;ll complete the Web 2.0 design tricks hat trick.)  I&#8217;d like to see them myself, and I don&#8217;t think defining them is quite as hard as the commentary implies:
</p>
<p>
<blockquote><p>Imagine, for example, applying a gradient to the text of a &lt;span&gt; broken across two lines. Do you apply the gradient to each part individually? Glue them together as if they were all on one line first? Draw a rectangle around both parts and apply the gradient to that? (<a href="http://www.w3.org/TR/css3-background/#the-background-break">CSS3 Backgrounds and Borders</a> has a control for this.)</p></blockquote>

</p><p>
I&#8217;d say the answer is right there, in the form of <a href="http://www.w3.org/TR/css3-background/#the-background-break"><code>background-break</code></a>, but let&#8217;s assume for a moment that said property never existed and we still had to deal with this problem.  I can think of two solutions:
</p>

<ol>
<li>Only allow gradients to be applied to non-inline boxes.  This would not be my preference, but it could be so defined.  There&#8217;s already precedence with CSS for that sort of limitation:  <code>width</code>, <code>height</code>, <code>text-align</code>, and other properties are restricted to non-inline boxes.</li>
<li>Treat gradients the way backgrounds and borders are already treated on inline boxes.  I&#8217;d be much more in favor of this.  In other words, lay out the inline box as though it is all on one line and then break it in pieces as needed to fit into the actual text flow.  (This is the behavior of <code>continuous</code>, the default value of <code>background-break</code>.)</li>
</ol>

<p>
But since <code>background-break</code> exists, you just treat gradients as you would any other background in accordance with <code>background-break</code>&#8217;s definitions.
</p>
<p>
The somewhat trickier problem is how to define the value syntax for <code>background-gradient</code> so that&#8217;s both powerful and extensible without being unusable.  I think that&#8217;s solvable, but not easily, and probably not in a way that will satisfy everyone.
</p>
<p>
(Though this would be a fabulous place for the cardinal-point values from pre-CSS1 days, which you can still find in the specification if you look hard enough, to make a roaring comeback, wouldn&#8217;t it?)
</p>
<p>
<strong>Unidirectional background repeats</strong> &#8212; I say yes.  Here, have some values: <code>repeat-up</code>, <code>repeat-right</code>, <code>repeat-down</code>, and <code>repeat-left</code>.  In each case, the image would be repeated in the indicated direction from the origin image (the one placed by <code>background-position</code>).  Ironically, really old versions of IE did half of this by not correctly supporting <code>repeat-x</code> and <code>repeat-y</code>, treating them instead as if they were <code>repeat-right</code> and <code>repeat-down</code>.
</p>
<p>
There are occasions where this would be very useful, especially if you can combine the values into something like <code>repeat-down repeat-right</code>, and <em>most</em> especially in conjunction with multiple backgrounds.  So you could put an image stripe across the top of the element background, another one down the left side, and then fill in the rest of the background with a <code>repeat-down repeat-right</code> image.  Not a particularly common case, but the only way to handle it at present is with multiple nested elements, each with its own background and possibly a lot of negative margin trickery, and nobody wants that.  (Which may also be why it isn&#8217;t a particularly common case.)
</p>
<p>
You could also put an image in the center of your page and then a single stripe that goes only downward from behind it.  Like a golf ball on a tee, say; or a tree trunk below the leafy crowm; or a stem from a flower.
</p>
<p>
<strong>Slanted corners</strong> &#8212; sure, why not?  The issues are all the same as with rounded corners; the only difference is that you have a flat corner instead of a rounded one.  It makes joins between different borders styles/colors more obvious, but that&#8217;s a good thing: any solution that works well for the slant corner should work as well for the rounded corner.  Besides, if we&#8217;re already going to the effort of rounding corners, this seems like a pretty easy add-on.
</p>
<p>
<strong>Multiple borders</strong> &#8212; I think this would be quite useful.  I occasionally fake this with a border and an outline (as in my <a href="http://meyerweb.com/eric/tools/css/diagnostics/">diagnostic styles</a>) but that only works for two; if you want three or more nested borders (or two or more in IE/Win) you have to start nesting elements.  Also, having multiple borders lets you define your own gradient borders like you were a pixel artist, and who doesn&#8217;t like pixel artists?
</p>
<p>
At the same time, though, I do feel that this should be fairly low on the implementation totem pole.  And, as pointed out in the document, if image borders get implemented then a lot of the need for multiple borders goes away.
</p>
<p>
<strong>Alpha channel image masks</strong> &#8212; the problem I have here is what happens if you, say, try to use an image to alpha-mask a non-replaced element?  How does it scale?  Or does it?  Will there be a <code>mask-stretch</code> property?  Who really wants to stretch an image over a great big <code>div</code> anyway?  (From a visual-results point of view, I mean.)
</p>
<p>
Allowing masks might help in figuring out how to do non-rectangular float areas, in that you could use the alpha image to define the area used for float exclusion.  Combine that with a stretch ability and SVG support, so you can draw scalable vector masks, and I think you&#8217;re really getting somewhere.  (As does <a href="http://mattwilcox.net/">Matt Wilcox</a>; he and I have been chewing this over in <a href="http://meyerweb.com/eric/thoughts/2009/02/19/css3-feedback-animated-shapes/#postcomment">the comments</a> on <a href="http://meyerweb.com/eric/thoughts/2009/02/19/css3-feedback-animated-shapes/">the previous post in the series</a>.)
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/02/24/css3-feedback-graphical-thoughts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS3 Feedback: Animated Shapes</title>
		<link>http://meyerweb.com/eric/thoughts/2009/02/19/css3-feedback-animated-shapes/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/02/19/css3-feedback-animated-shapes/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 17:00:24 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Commentary]]></category>

		<category><![CDATA[Standards]]></category>

		<category><![CDATA[W3C]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1055</guid>
		<description><![CDATA[The portion of the feedback <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#shapes">devoted to shapes</a> had two overarching themes, as I saw it.]]></description>
			<content:encoded><![CDATA[<p class="aside">(This is part of the <a href="http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/">Feedback on &#8216;WaSP Community CSS3 Feedback 2008&#8242;</a> series.)</p>

<p>
The portion of the feedback <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#shapes">devoted to shapes</a> had two overarching themes, as I saw it.  That makes this entry a bit short, but when I tried to combine it with my feedback on &#8220;<a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#graphical">Graphical Effects</a>&#8220;, it quickly got too long.  So, a little <i>amuse cerveau</i>, as it were.
</p>

<p>
<strong>Animations, transformations, and so on</strong> &#8212; the WebKit team have of course been having a field day in this area, and what they&#8217;ve done will likely make is way to other browsers.  Or not.  I don&#8217;t know.  I&#8217;m not entirely thrilled about the effort that&#8217;s gone into those properties when there are so many other, more basic things that need love and care, but there&#8217;s no denying the essential coolness of slowly rotating an entire page.  Which I totally need to do the next time I give a presentation.
</p>
<p>
I&#8217;m not going to get into the &#8220;these things are behavior and therefore JavaScript!&#8221; argument.  CSS already does behavior (think <code>:hover</code>) and it&#8217;s going to do more over time.  I don&#8217;t see how that historical pressure can be resisted for much longer, short of outright refusing to take on any more behaviors and thus making itself a prime candidate for replacement with something else.  We may as well do our best to make sure CSS does good behaviors well, in ways that makes the most sense to the most authors.
</p>
<p>
So that&#8217;s basically my feedback: since we&#8217;re going to do it, let&#8217;s do it right.  Apple&#8217;s made a start, and unless the syntax they&#8217;ve defined in <a href="http://dev.w3.org/csswg/css3-animations/">their CSS Animations draft</a> is completely unworkable in other browsers for technical reasons, then let&#8217;s just roll with it.  And please note I said the <em>syntax</em>, not the overall concept.  (Ditto for <a href="http://webkit.org/specs/CSSVisualEffects/CSSTransforms.html">their CSS Transforms draft</a>.)
</p>

<p>
<strong>Stuff that isn&#8217;t rectangular</strong> &#8212; including both polygonal element boxes and polygonal floats.  I&#8217;ve wanted these for at least a decade, so it&#8217;s little surprise that I&#8217;m in favor.  <a href="http://meyerweb.com/eric/css/edge/raggedfloat/demo.html">Ragged floats</a> were invented as a hack to make the latter happen, of course, and the basic idea&#8217;s been <a href="http://www.evolt.org/article/Super_Ragged_Floats/22/50410/index.html">improved upon</a> <a href="http://www.alistapart.com/articles/sandbags">more than once</a>.
</p>
<p>
The tricky part, of course, is actually defining polygons.  Regular polygons, as in hexagons and octagons and dodecagons, are not terribly difficult; but creating an irregular polygon requires defining a set of point coordinates in relation to some origin and resolving what happens when the lines cross over each other and&#8230; well, yeah.
</p>
<p>
The build-on-what-exists approach would just adopt the syntax HTML <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-AREA"><code>area</code> </a>elements use in the <code>coords</code> elements.  There would be two interesting questions there, which are what happens with negative coordinate values, and what happens if you draw a polygon that cuts through some of the element&#8217;s content.  For example, you have a <code>div</code> containing an image, and you define the polygon to be smaller (in places) than the image.  Is the browser obligated to prevent content overlap in such cases?  I would tend to say no but I can see arguments for the opposite view, particularly when it comes to floats.
</p>
<p>
Then there&#8217;s the problem that you&#8217;d have to define a separate polygon for every element that needed a non-rectangular float, as Bert Bos notes in <a href="http://www.w3.org/blog/CSS/2007/07/03/rotations_and_non_rectangular_floats">his thoughts on the topic</a> from a couple of years ago.  His <code>contour</code> idea is certainly interesting, though I&#8217;d then start to wonder how you define a contour point on, say, an irregular faded gradient.
</p>
<p>
Anyway, I thought about adapting <code>clip</code> to the purpose of defining float polygons, but then I remembered the long, tortuous hell that is the history of <code>clip</code> (and <code>offset-clip</code>) and decided that a new property is the way to go.  Clean break, start fresh, et cetera.  I don&#8217;t know what it would be called.  <code>content-shape</code>, maybe, to go with <code>element-shape</code>.  Or not.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/02/19/css3-feedback-animated-shapes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wanted: Layout System</title>
		<link>http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 15:00:14 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Rants]]></category>

		<category><![CDATA[Standards]]></category>

		<category><![CDATA[W3C]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1052</guid>
		<description><![CDATA[Not surprisingly, there was a lot of community feedback <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#layout">asking for better layout mechanisms</a>.  Actually, people were asking for any decent layout mechanism at all, which CSS has historically lacked.  It needs one.]]></description>
			<content:encoded><![CDATA[<p class="aside">(This is part of the <a href="http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/">Feedback on &#8216;WaSP Community CSS3 Feedback 2008&#8242;</a> series.)</p>
<p>
Not surprisingly, there was a lot of community feedback <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#layout">asking for better layout mechanisms</a>.  Actually, people were asking for any decent layout mechanism at all, which CSS has historically lacked.  Floats mostly work, but they&#8217;re a hack and can be annoyingly fragile even when you ignore old-browser bugs.  Positioning works in limited cases, but does not handle web-oriented layout at all well.
</p>
<p>
Why do we use floats for layout, anyway?  <code>clear</code>.  That&#8217;s pretty much the whole answer.  The unique in-flow/out-of-flow nature of floats means they interact with each other and with the normal flow, which means they can be cleared, which makes them useful.  Because with <code>clear</code>, we can float layout blocks around and then push other non-floated blocks, like footers, below the floats.
</p>
<p>
Positioning, of course, permits total layout freedom in the sense that you can put a layout block anywhere with respect to its containing block.  The downfall is that absolutely positioned elements are entirely out of the normal flow, so they can&#8217;t stay out of each others&#8217; way like floats do, and you can&#8217;t clear anything with respect to a positioned element.  If there had been a <code>position-clear</code> or its equivalent from the outset, we&#8217;d never have bothered with floats.
</p>
<p>
(And if we can just add <code>position-clear</code> to CSS, that would be completely awesome.  It&#8217;s <a href="http://www.shauninman.com/archive/2006/05/22/clearance_position_inline_absolute">been done with JavaScript</a> and it will most likely be done again and better.  It wouldn&#8217;t even be that hard to implement, at least for 99.5% of cases.)
</p>
<p>
All this is why the old &#8220;only use tables for layout&#8221; argument keeps coming up over and over: strip away the overheated rhetoric and obvious link-baiting, and you find the core of a real need.  Because as powerful as CSS can be, table cells do certain things very easily that CSS makes very, very hard.  Cells stretch vertically, keeping equal heights as a matter of their intrinsic nature.  They stay out of each others&#8217; way, while still being allowed to sit next to each other and use any sizing dimensions.  They tie their layout to their parent elements, and vice versa.
</p>
<p>
There are <em>no</em> equivalents in CSS.  There have been various very clever attempts to replicate bits and pieces of those capabilities using CSS.  What CSS does, it does very well: if you don&#8217;t need equal-height layout blocks, then no problem.  If you do, it&#8217;s a massive pain.  Clever techniques provide substitutes, but can&#8217;t replace what tables already do.
</p>
<p>
And please, let&#8217;s put the whole &#8220;<code>display: table-cell</code> will grant those abilities through CSS&#8221; to rest.  Saying that is just saying &#8220;use tables for layout&#8221; with different words.  Turning a bunch of <code>div</code>s or list items or whatever into table-role boxes is no better than just using table markup in the first place, and it&#8217;s arguably worse.  Using element names other than <code>table</code> and <code>td</code> to create layout tables, and then claiming it&#8217;s not using tables for layout, borders on self-deception.
</p>
<p>
Not to mention doing things that way means you&#8217;re doing your layout in a highly source-order-dependent fashion, which was one of the things about table layout we were trying to get away from in the first place.
</p>
<p>
So how do we get really powerful source-order-independent layout?  I wish I knew.  The <a href="http://www.w3.org/TR/css3-layout/">Advanced Layout module</a> has been sitting around for a while now, and even if you&#8217;re a fan of defining layout as ASCII art&#8212;which I find repels and appeals in equal measure, but that&#8217;s probably just me&#8212;there appears to be close to zero implementor interest.  So how do we get those abilities in a form that implementors will, y&#8217;know, <em>implement</em>?  I don&#8217;t know.  I don&#8217;t <em>care</em>.  We just need it, and have needed it for a good decade or so.  Without it, CSS is a styling language but not a layout language.  We&#8217;ve bent it into being something close to a layout language, which is nice but not really ideal.
</p>
<p>
Maybe CSS isn&#8217;t the place for this.  Maybe there needs to be a new layout language that can be defined and implemented without regard to the constraints of the existing CSS syntax rules, without worrying about backwards compatibility.  Maybe that way we can not only get strong layout but also arbitrary shapes, thus leaving behind the rectangular prison that&#8217;s defined the web for almost two decades.
</p>
<p>
I don&#8217;t have a concrete idea to propose here, because it&#8217;s not up to us any more.  A solution was worked out over the course of several years and then found wanting by the implementors.  Really, it&#8217;s up to the implementors to figure it out now.  I personally would like to just lock the browser teams from Microsoft, Mozilla, Opera, and Apple in a room and not let them out until they&#8217;ve defined something that works and they&#8217;ve all agreed to implement soonest.  I might even supply food and water.
</p>
<p>
And yes, I just advocated doing this outside the W3C process.  Why wouldn&#8217;t I?  The process has, in the last decade, not produced anything even remotely resembling an answer to this problem.  Time to try another path and see if it gets any closer to the goal.
</p>
<p>
No doubt someone&#8217;s going to spin this as &#8220;See, even noted standards zealot Eric Meyer now says CSS is flawed!&#8221;&#8212;only they&#8217;ll be wrong because this isn&#8217;t a <em>now</em> thing.  I&#8217;ve been saying this for years in interviews, in person, and in general.  Any time someone asks me what CSS is missing or should do better, the answer has always been a variant on &#8220;a strong layout system&#8221;.  I&#8217;ve been saying it for at least a decade.  So I&#8217;m not saying it <em>now</em>.  I&#8217;m saying it <em>again</em>.  And again and again and again and&#8230;
</p>
<p>
If I sound frustrated, it&#8217;s because I am, and have been for a good long while.  I&#8217;m not the only one.  It rankles to have CSS be, as Winston Churchill would have put it, the worst form of layout except for all the others that have been tried.
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS3 Feedback: Layout</title>
		<link>http://meyerweb.com/eric/thoughts/2009/02/16/css3-feedback-layout/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/02/16/css3-feedback-layout/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 17:01:42 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Commentary]]></category>

		<category><![CDATA[Standards]]></category>

		<category><![CDATA[W3C]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1043</guid>
		<description><![CDATA[In this round, layout.  Not all of it, but the bits that struck me as either really useful or really, really way too long overdue.]]></description>
			<content:encoded><![CDATA[<p class="aside">(This is part of the <a href="http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/">Feedback on &#8216;WaSP Community CSS3 Feedback 2008&#8242;</a> series.)</p>
<p>
In this round, <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#layout">layout</a>.  Not all of it, but the bits that struck me as either really useful or really, really way too long overdue.
</p>
<p>
<strong><a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#contain-floats">Float containment</a> &#8211;</strong> yes, we need a property that does just that.  As long as we&#8217;re tied to floats for layout&#8212;and I plan to rant about that soon&#8212;there should be a clear, unambiguous, intentionally defined property that tells elements to wrap themselves around floated descendant elements.  <code>overflow</code> works in most cases but can fall down in unusual circumstances (I&#8217;ve seen scrollbars appear where none were actually needed) and anyway, it wasn&#8217;t intended to provide the wrapping effect in the first place.  That it does so is a happy side effect, but it&#8217;s still a side effect.  The rest of the float-wrapping techniques are even more convoluted.  &#8220;There are already ways to do that so we don&#8217;t need a property&#8221; is rather like saying &#8220;we can already do layout with tables so why do we need CSS layout?&#8221;.
</p>
<p>
<strong><a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#center-positioning">Positioning by center</a> &#8211;</strong> yes, please.  The way to center an absolutely positioned element within its containing block is to set the <code>top</code> and <code>left</code> to <code>50%</code> each and then define negative top and left margins that are half the positioned element&#8217;s height and width.  That&#8217;s just awful, and requires at least an explicit width, if not an explicit height.  When I did the structured timeline, here&#8217;s how I got the version numbers to center below the dots:
</p>

<pre>#timeline tbody td p {
	position: absolute;
	top: 50%;
	width: 2.1em;
	margin: -5px 0 0 -1em;
}
</pre>

<p>
See that <code>-1em</code> left margin, and the <code>2.1em</code> width?  Just to get the center of positioned elements&#8217; boxes sit on top of a certain left offset (defined elsewhere in the CSS).  Ditto the negative top margin, to pull it upward just enough so that the elements&#8217; boxes would have the point five pixels down from their tops line up with the vertical midpoint of their containing blocks.
</p>
<p>
I wanted to do something like this:
</p>

<pre>#timeline tbody td p {
	position: absolute;
	top: 50%;
	position-anchor: 50% 5px;
}
</pre>

<p>
That would have said that the point in the center of the absolutely positioned element should be placed at the point in the containing block 21.7% down from the top and 44% of the way across from the left.  That would hang the positioned element&#8217;s center on that point, <em>regardless of the size of the positioned element</em>&#8212;note that I took out the <code>width</code>.  I could stop defining explicit sizes and just let the elements be the size they want to be to show their content.
</p>
<p>
The problem is that approach doesn&#8217;t fit at all well with the way positioning layout is defined.  Suppose I said this:
</p>

<pre>#timeline tbody td p {
	position: absolute;
	top: 50%; bottom: 0;
	left: 50%; right: 25%;
	position-anchor: 50% 5px;
}
</pre>

<p>
Now what?  I&#8217;m not even sure myself.  Maybe define rename it to <code>position-offset</code> and define percentages to be relative to the height and width of the positioned element (not its containing block), so that it doesn&#8217;t interact directly with the offset properties like <code>top</code> and <code>right</code>?
</p>
<p>
All I want is a way to hang elements off of offset points, and not be restricted to the corners of the elements, and have the solution work even when the elements have automatic height and width, and not require extra markup to make it happen.  Oh, and a ponycar.
</p>
<p>
<strong><a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#box-sizing">Box sizing</a> &#8211;</strong> what in the nine hells of Valeria is taking so long?  We needed that one ten years ago.  I no longer care if it&#8217;s done as its own property or as new keywords on <code>height</code> and <code>width</code>.  I just want it.  Someone will make it happen, with or without the WG or implementors&#8212;<a href="http://meyerweb.com/eric/thoughts/2008/10/22/javascript-will-save-us-all/">mark my words</a>.
</p>
<p>
<strong><a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#siblings-equal-height">Same-height elements</a> &#8211;</strong> yes, a way to tie element heights (whether they&#8217;re siblings or not) together would be welcome, although I can see how specifying it in an implementable would be tricky; no, <code>display: table-cell</code>  is <em>not</em> the answer.  Soon I will rant about this.  Soon.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/02/16/css3-feedback-layout/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS3 Feedback: Selector Blocks</title>
		<link>http://meyerweb.com/eric/thoughts/2009/02/12/selector-blocks/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/02/12/selector-blocks/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 15:37:05 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Commentary]]></category>

		<category><![CDATA[Standards]]></category>

		<category><![CDATA[W3C]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1034</guid>
		<description><![CDATA[Out of all the <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#selectors">selector feedback</a>, <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#nested-selectors">selector blocks</a> was the part that really caught my attention.]]></description>
			<content:encoded><![CDATA[<p class="aside">(This is part of the <a href="http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/">Feedback on &#8216;WaSP Community CSS3 Feedback 2008&#8242;</a> series.)</p>
<p>
Out of all the <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#selectors">selector feedback</a>, <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#nested-selectors">selector blocks</a> was the part that really caught my attention.  I also see the usefulness of a <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#parent-selector">parent selector</a>, but that one has come up many times before, and it&#8217;s always died at the doorstep of implementors, who point out that it&#8217;s far too difficult to implement without serious performance penalties and even risk of browser lockup.  See, for example, <a href="http://shauninman.com/archive/2008/05/05/css_qualified_selectors#comment_3942">the comment left by David Hyatt</a> on <a href="http://shauninman.com/archive/2008/05/05/css_qualified_selectors">Shaun Inman&#8217;s post</a> on the idea.  Similarly, I think <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#contants">constants</a> (or macros or whatever they&#8217;re called) are a great idea and would be very helpful, especially if you&#8217;re coding up a <a href="http://jasonsantamaria.com/" rel="friend colleague met">Jason</a> Special.  Both are loaded with use cases, so I don&#8217;t feel like I can add a lot; besides, constants are already in the WG charter, so there&#8217;s once more hope in the land.
</p>
<p>
So anyway, selector blocks.  To pick one recent example, while working on a project that should very soon see the light of day, I had a situation involving the following chunk of rules.
</p>

<pre>h1, h2, h3, h4, h5, h6, table {
   font: 1em Arial, "Helvetica Neue", Helvetica, sans-serif;}
h1 {font-size: 275%;}
h3:first-child {margin-top: 1em;}
p.tagline {margin: -0.25em 0 1.25em;
   font-size: 125%;
   color: #7B7960;}
h3 {margin: 1.5em 0 0.25em; font-size: 125%;}
h3:before {font-size: 75%; counter-increment: subhead;}
h4 {margin: 2.5em 0 0.75em;
   text-transform: uppercase; font-size: 125%;
   color: #928F59;}
p {margin: 0 0 1em;}
ul {padding-left: 1.5em;}
ul li {list-style: disc; margin: 0.5em 0;}
</pre>

<p>
Nothing unusual about them, of course, unless you count my use of counters.  These rules had been written early on in development, and the design had evolved around that part of the document.  As more page components were added, I realized that I needed to scope all these rules to one section of the document: specifically, a <code>div</code> with a <code>class</code> of <code>main</code>.  So here&#8217;s what I had to do.
</p>

<pre>.main h1, .main h2, .main h3, .main h4, 
.main h5, .main h6, .main table {
   font: 1em Arial, "Helvetica Neue", Helvetica, sans-serif;}
.main h1 {font-size: 275%;}
.main h3:first-child {margin-top: 1em;}
.main p.tagline {margin: -0.25em 0 1.25em;
   font-size: 125%;
   color: #7B7960;}
.main h3 {margin: 1.5em 0 0.25em; font-size: 125%;}
.main h3:before {font-size: 75%; counter-increment: subhead;}
.main h4 {margin: 2.5em 0 0.75em;
   text-transform: uppercase; font-size: 125%;
   color: #928F59;}
.main p {margin: 0 0 1em;}
.main ul {padding-left: 1.5em;}
.main ul li {list-style: disc; margin: 0.5em 0;}
</pre>

<p>
This, on the other hand, is what I really <em>wanted</em> to do:
</p>

<pre>.main {
   h1, h2, h3, h4, h5, h6, table {
      font: 1em Arial, "Helvetica Neue", Helvetica, sans-serif;}
   h1 {font-size: 275%;}
   h3:first-child {margin-top: 1em;}
   p.tagline {margin: -0.25em 0 1.25em;
      font-size: 125%;
      color: #7B7960;}
   h3 {margin: 1.5em 0 0.25em; font-size: 125%;}
   h3:before {font-size: 75%; counter-increment: subhead;}
   h4 {margin: 2.5em 0 0.75em;
      text-transform: uppercase; font-size: 125%;
      color: #928F59;}
   p {margin: 1em 0;}
   ul {padding-left: 1.5em;}
   ul li {list-style: disc; margin: 0.5em 0;}
}
</pre>

<p>
Or, if necessary, to put the whole original chunk into its own style sheet and then do one of the following:
</p>

<pre>div.main {@import url(main-style.css);}

&lt;div class="main" style="@import url(main-style.css);"&gt;
</pre>

<p>
Interestingly, the latter is theoretically possible, thanks to the more advanced profiles in the CSS module &#8220;<a href="http://www.w3.org/TR/css-style-attr">Syntax of CSS rules in HTML&#8217;s &#8217;style&#8217; attribute</a>&#8220;.  I&#8217;m not aware of the former having been seriously considered (despite my best efforts, once upon a time), though it&#8217;s always possible I missed something.
</p>
<p>
But either one of those approaches would be a last resort, in my opinion.  I&#8217;d much rather just wrap the whole chunk in <code>.main { }</code>, like I showed previously, and be done with it.  That capability would also simplify certain annoyingly repetitive patterns, like the very first of those rules.  I think it&#8217;s pretty obvious which of the following is easier to write and maintain:
</p>

<pre>
body.home #content .entry h2, 
body.home #content .entry h3, 
body.home #content .entry h4, 
body.home #content .entry h5, 
body.home #content .entry h6 {...}

body.home #content .entry {
   h2, h3, h4, h5, h6 {...}
}
</pre>

<p>
I mean, just look at the former, and imagine what one goes through to write it in the first place.  Copy, paste, paste, paste, paste, paste&#8230; maddening.  And that&#8217;s just for a small block of CSS like this one.  Imagine the tedium of doing this for a block of 50 rules, or 150.  (Also, this is the the same thing that was requested in the feedback as &#8220;<a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#grouped-alternates">Grouped Alternates</a>&#8220;, albeit with a different syntax.)
</p>
<p>
One objection to this sort of pattern is that it increases dependence on descendant selectors, which are computationally inefficient.  But it doesn&#8217;t: I had to create a whole bunch of descendant selectors as it was, and did so far more clumsily.  And had I missed a command-V somewhere, I&#8217;d have had styles that applied outside their intended subtree.  Introducing a way to nest blocks like this doesn&#8217;t change anything except make it easier and more maintainable to do what we already do.  Honestly, it&#8217;s pretty much impossible to increase dependence on descendant selectors.  The best we can do now is make them less difficult to write.
</p>
<p>
I realize that the syntax I depict would cause backwards-compatibility problems, as in older browsers would not behave as intended when exposed to this sort of thing, but I&#8217;ve also stopped being concerned about that.  We can&#8217;t keep holding ourselves hostage to decisions made a decade or more back.  Provide the capability and authors will use it when they can.  Over time, its use will become more prevalent&#8212;kind of the same way authors adopted CSS in the first place.
</p>
<p>
I also realize that this case has been made time and again by many, many other people.  This isn&#8217;t even the first time I&#8217;ve made this case, though I think the other times were within the WG and therefore off the public record.  The fact that it keeps being made is a strong indicator that the need exists, and dismissing the idea because the same end effect can be achieved with existing selector syntax (as shown above) isn&#8217;t acceptable.  That&#8217;s like saying that complex selection effects can be achieved with JavaScript or XPath, so there&#8217;s no need for advanced CSS selectors.
</p>
<p>
So that&#8217;s my use case.  I actually have a bunch more, but they all follow the same basic pattern: the desire to group rules together into subsections of a document, or to otherwise simplify the writing of CSS.
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/02/12/selector-blocks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Feedback on &#8216;WaSP Community CSS3 Feedback 2008&#8242;</title>
		<link>http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 17:50:58 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Commentary]]></category>

		<category><![CDATA[Standards]]></category>

		<category><![CDATA[W3C]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1024</guid>
		<description><![CDATA[Back before holiday season hit, Elika Etemad---better known as <a href="http://fantasai.inkedblade.net/">Fantasai</a>---published <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008">WaSP Community CSS3 Feedback 2008</a>.  I gave it a read and came away with a number of things I wanted to say.]]></description>
			<content:encoded><![CDATA[<p>
Back before holiday season hit, Elika Etemad&#8212;better known as <a href="http://fantasai.inkedblade.net/">Fantasai</a>&#8212;published <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008">WaSP Community CSS3 Feedback 2008</a>.  I gave it a read and came away with a number of things I wanted to say.  So many things, in fact, that I&#8217;ll need to split them up into a series of posts.  This here post will serve as introduction and hub, with links to the follow-on entries added as they&#8217;re published.  All very <a href="http://tbray.org/ongoing/" rel="acquaintance met">Bray</a>-ny, no?  (Go ahead, groan.  It only encourages me.)
</p>
<p>
Here you go:
</p>
<ol>
<li><a href="http://meyerweb.com/eric/thoughts/2009/02/12/selector-blocks/">Selector blocks</a></li>
<li><a href="http://meyerweb.com/eric/thoughts/2009/02/16/css3-feedback-layout/">Layout</a></li>
<li><a href="http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/">Wanted: Layout System</a></li>
<li><a href="http://meyerweb.com/eric/thoughts/2009/02/19/css3-feedback-animated-shapes/">Animated Shapes</a></li>
<li><a href="http://meyerweb.com/eric/thoughts/2009/02/24/css3-feedback-graphical-thoughts/">Graphical Thoughts</a></li>
</ol>
<p>
I want to make clear up front that I&#8217;m not going to address every single point in the feedback document: it&#8217;s just too incredibly huge.  I did think about making my own copy and then just filling in my reactions to each point, but that didn&#8217;t scale very well.  Not only did it seem really overbearing and maybe just a touch egotistical, but some of my reactions were based on related topics in separate areas of the original.  Besides, I know what it&#8217;s like trying to read a really, really long article, so breaking it up and just focusing on the parts that got me fired up made way more sense.
</p>
<p>
There is one thing I want to address before I start serving up the follow-on installments.  At the end of Fantasai&#8217;s post, there&#8217;s a link to <a href="http://meyerweb.com/eric/thoughts/2006/09/15/w3c-change-outreach/">my 2006 post</a> about the benefit of having a community liaison, someone who bridges the gap between the WG and the public.  She then asks if anyone is interested in volunteering, but personally, I don&#8217;t see the need.  The WG already has a community liaison:  it&#8217;s you, Fantasai.  It has been for some time now, thanks to your regular and informative <a href="http://www.w3.org/blog/CSS">CSS WG blog</a> posts and other outreach work such as &#8220;WaSP Community CSS3 Feedback 2008&#8243;.  The job is being done, and being done very well, I don&#8217;t think there&#8217;s any doubt that the Working Group is much, much better for it.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>London CSS/XHTML Workshop</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/29/london-cssxhtml-workshop/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/01/29/london-cssxhtml-workshop/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 10:59:00 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[(X)HTML]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Speaking]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1016</guid>
		<description><![CDATA[I'm going to be doing an all-new one-day workshop in London in early March, this time with a harder edge and a higher skill level.]]></description>
			<content:encoded><![CDATA[<p>
Hey all, and especially those of you in the EU: I&#8217;m going to be doing an all-new one-day workshop in London in early March via the offices of Carson Workshops, for whom I&#8217;ve done workshops in the past.  Previously I&#8217;ve done two-day gigs with a beginner-to-intermediate skill range, but this time we&#8217;re trying something different.  I&#8217;m going to get down and dirty with some tough topics, and really push hard at the limits of what CSS and semantic markup can do.
</p>
<p>
You can get <a href="http://carsonworkshops.com/2009/ericmeyer/">the details at the CW site</a>, and note the special price for the first quarter of the seats.  That&#8217;s right, this will be a small, intimate workshop, with plenty of chances for questions about and challenges to what I&#8217;m saying.  Previous workshops have featured some really great conversations among everyone there, and I expect the same this time around.
</p>
<p>
I had meant to blog this before life intervened and took me out of my wifi cloud (and more on that soon), so time is a little more of the essence than usual&#8212;if you know someone who you think might be interested, pass the word on, willya?  Thanks!
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/01/29/london-cssxhtml-workshop/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using HTTP Headers to Serve Styles</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 13:46:36 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1010</guid>
		<description><![CDATA[On using HTTP headers to serve CSS, in my case with Apache .htaccess files.]]></description>
			<content:encoded><![CDATA[<p>
How many times have you played out the following scenario?
</p>

<ol>
<li>Makes local changes to your style sheet(s).</li>
<li>Upload the changes to the staging server.</li>
<li>Switch to your browser and hit &#8220;reload&#8221;.</li>
<li>Nothing happens.</li>
<li>Force-reload. Nothing happens.</li>
<li>Go back to make sure the upload is finished and successful.</li>
<li>Reload again.  Still nothing.</li>
<li>Try sprinkling in <code>!important</code>.  Upload, reload, nothing.</li>
<li>Start swearing at your computer.</li>
<li>Check Firebug to see what&#8217;s overriding your new styles.  Discover they aren&#8217;t being applied at all.</li>
<li>Continue in that vein for several minutes before realizing you were hitting reload while looking at the live production server, not the staging server.</li>
<li>Go to the staging server and see all your changes.</li>
<li>Start swearing at your own idiocy.</li>
</ol>

<p>
This happened to me <em>all the time</em> as we neared completion of the redesign of <a href="http://aneventapart.com/">An Event Apart</a>.  It got to the point that I would deliberately add obvious, easily-fixable-later errors to the staging server&#8217;s styles, like a light red page background.
</p>
<p>
Now that we&#8217;re launched and I have time to actually, you know, <em>think</em> about how I do this stuff, it occurred to me that what I should have done is create a distinct &#8220;staging&#8221; style sheet with the obvious error or other visual cue.  Maybe repeat the word &#8220;staging&#8221; along the right side of the page with a background image, like a watermark:
</p>

<pre>html {background: url(staging-bg.png) 100% 50% repeat-y;}</pre>

<p>
Okay, cool.  Then I just need to have that served up with every page on the staging server, without it showing up on the production server.
</p>
<p>
One way to do that is just make sure the image file never migrates to production.  That way, even if I accidentally let the above CSS get onto production, the user will never see it.  But that&#8217;s inelegant and wasteful, and fragile to boot: if the styles accidentally migrate, who&#8217;s to say the image won&#8217;t as well?  And while I&#8217;m sure there are all kinds of CMS and CVS and Git and what-have-you tricks to make sure that doesn&#8217;t happen, I am both clumsy and lazy.  Not only do I have great faith in my ability to screw up my use of such mechanisms, I don&#8217;t really want to be bothered to learn them in the first place.
</p>
<p>
So: why not send the link to the style sheet <a href="http://www.w3.org/TR/REC-html40/present/styles.html#h-14.6">using HTTP headers</a>?  Yeah, that&#8217;s the ticket!  I can just add a line to my <tt>.htaccess</tt> file on the staging server and be done.  Under Apache, which is what I use:
</p>

<pre>Header add Link "&lt;/staging.css&gt;;rel=stylesheet;type=text/css;media=all"</pre>

<p>
Those angle brackets are, so far as I can tell, absolutely mandatory, so bear that in mind.  And of course the path in those brackets can be absolute, unlike what I&#8217;ve shown here.  I&#8217;m sure there are simple PHP equivalents, which I&#8217;ll leave to others to work out.  I really didn&#8217;t need to add the <code>media=all</code> part, but what the heck.
</p>
<p>
Seems so simple, doesn&#8217;t it?  Almost&#8230; <em>too</em> simple.  Like there has to be a catch somewhere.  Well, there is.  The catch is that this is not supported by all user agents.  Internet Explorer, for one; Safari, for another.  It <em>does</em> work in Opera and Gecko browsers.  So you can&#8217;t deploy this on your production server, unless of course you want to use it as a way to hide CSS from both IE and Safari.  (For whatever reason.)  It works great in Gecko-based production environments like mine, though.
</p>
<p>
I looked around for a quick how-to on do this, and couldn&#8217;t find one.  Instead, I found <a href="http://annevankesteren.nl/test/html-element/style-header.php">Anne van Kesteren&#8217;s test page</a>, whose headers I sniffed in order to work out the proper value syntax; and <a href="http://esw.w3.org/topic/LinkHeader">a brief page on the Link header</a> that didn&#8217;t mention CSS at all.  Nothing seemed to put the two of them together.  Nothing until now, that is.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Seeking JavaScript Help</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/16/seeking-javascript-help/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/01/16/seeking-javascript-help/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 11:31:49 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1000</guid>
		<description><![CDATA[After the fantastic response to my last call for help, I'm back with another request for assistance, this time with JavaScript.]]></description>
			<content:encoded><![CDATA[<p>
Even though it turned out that there is no simple solution for <a href="http://meyerweb.com/eric/thoughts/2009/01/14/seeking-math-help/">the math problem I posted</a>, I learned a fair amount from the fantastic responses&#8212;thanks, everyone!&#8212;and eventually came up with a solution that worked for me.  (I&#8217;d like to say it was one of the iterative approaches posted, but none of them worked for me.  In the end, I brute-forced it.)  I&#8217;m hoping for a different outcome with my next question, which is about JavaScript.
</p>
<p>
Consider the following structure, which is a much-edited-down version of part of the <a href="http://hydesim.com/">HYDEsim</a> code:
</p>

<pre>
function Detonation(name,lat,lon,yield) {
    var scale = Math.pow(yield,1/3);
    var gz = new GLatLng(lat,lon);
    this.name = name;
    this.lon = lon;
    this.lat = lat;
    this.gz = gz;
    this.yield = yield;
    this.overpressure = {
        p30 : 0.108 * scale,
        p15 : 0.153 * scale,
        p10 : 0.185 * scale,
         p5 : 0.281 * scale,
         p1 : 0.725 * scale
    };
    this.psi30 = {
        radius: 0.108 * scale,
        overlay : {
            points: makePoints(this.gz,0.108 * scale)
        }
    };
    this.psi15 = {
        radius: 0.153 * scale,
        overlay : {
            points: makePoints(this.gz, 0.153 * scale)
        }
    };
    this.therm20 = {
        radius: thermDist(20,this.yield,0.33,conditions.visibility),
        overlay : {
            points: makePoints(
                this.gz,
                thermDist(20,this.yield,0.33,conditions.visibility)
            )
    };
    // ...and so on...
}
</pre>

<p>
There are two things I&#8217;ve tried and failed to do.  And tried, and tried, and tried; and failed, and failed, and failed.
</p>

<ol>
<li>Eliminate the redundant calculations of radii.  Note how I define a radius property in each case?  And then have to not use it when I create the overlay?  It seems like there must be a way to just define the value once for each subsection and then use it as many times as needed within that context.  How?</li>
<li>How do I make it so that all those properties and overlays and such automatically recalculate any time one of the &#8220;upper-level&#8221; terms changes?  As in, once I&#8217;ve created a new Detonation object <code>det</code>, how can I set things up so declaring <code>det.yield = 250;</code> will trigger recalculation of all the other pieces of the object?  At present, I&#8217;m just blowing away the existing <code>det</code> and creating a whole new one, which just seems clumsy and silly.  I have to believe there&#8217;s a better way.  I just can&#8217;t find it.</li>
</ol>

<p>
<strong>Please note:</strong> tossing off comments like &#8220;oh, just instantiate a mixin constructor with an extra closure&#8221; will be of no help at all, because I don&#8217;t understand what those terms mean.  Hell, I&#8217;m not even sure I used the words &#8220;object&#8221; and &#8220;property&#8221; correctly in my explanation above.  Similarly, pointing me to tutorials that use those terms liberally is unlikely to be of help, since the text will just confuse me.  Sample code (whether posted or in a tutorial) will help a great deal, because it will give me something to poke and prod and dissect.  That&#8217;s how I&#8217;ve always learned to program.  Actually, it&#8217;s how I&#8217;ve always learned anything.
</p>
<p>
As well, I&#8217;m absolutely willing to believe that there are much, much better ways to structure the object, but right now I really need to learn how those two things are accomplished in the context of what I already have.  Once I get familiar with those and finish up some other work, I can start thinking about more fundamental overhauls of the code (which needs it, but <em>not now</em>).
</p>
<p>
I really appreciate any concrete help you can give me.
</p>
<p>
<strong>Addendum:</strong> if you leave code in a comment, please just wrap it in a <code>code</code> element and use whatever indentation you like.  The indentation won&#8217;t show up when the post goes up, but I&#8217;ll go in after and wrap the <code>code</code> in a <code>pre</code> and then everything will be fine.  Sorry to those who&#8217;ve already gone to the effort of posting with indents or <code>nbsp</code> entities to try to preserve indentation!  As soon as I can dig up the right preference panel or plugin to allow <code>pre</code> in comments, I&#8217;ll do that, but for now I&#8217;ll manually edit in the needed <code>pre</code>s as comments are added.  THanks, and again, apologies to those who posted before I made this clear!
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/01/16/seeking-javascript-help/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Seeking Math Help</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/14/seeking-math-help/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/01/14/seeking-math-help/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 21:56:22 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[Projects]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=994</guid>
		<description><![CDATA[So I have this equation that's great for finding one term.  Problem is, I need to solve for another term that's scattered all across the right side.  I'm hoping someone here has the mad algebra skills I managed to lose in the two decades since I last took a math class and can help me out.]]></description>
			<content:encoded><![CDATA[<p>
So I have this equation that&#8217;s great for finding one term.  Problem is, I need to solve for another term that&#8217;s scattered all across the right side.  I&#8217;m hoping someone here has the mad algebra skills I managed to lose in the two decades since I last took a math class and can help me out.
</p>
<p>
Here&#8217;s the original equation:
</p>

<p>
Q = (3.07 &#215; F &#215; Y &#215; (1 + 1.4 &#215; ((D/V) &#215; <em>e</em><sup>(-2 &#215; D/V)</sup>))) / D<sup>2</sup>
</p>

<p>
I want to be able to solve for D, not Q; in other words, have a single D on the left and everything else on the right of the equation.  F, Y, and V are all variable terms; the <em>e</em> is the classic irrational constant.  I tried for quite a while to do this and ran very firmly aground.  The best I managed was this minor simplification:
</p>

<p>
Q = (3.07 &#215; F &#215; Y &#215; (1 + 1.4 &#215; (D / (V &#215; <em>e</em><sup>(2 &#215; D/V)</sup>))) / D<sup>2</sup>
</p>

<p>
&#8230;and even that assumes that I did things correctly.  Here&#8217;s the original equation in pretty shoulda-done-it-in-MathML-but-oh-well form:
</p>

<img src="http://meyerweb.com/pix/2009/thermal-equation.png" alt="" class="standalone" />

<p>
I can shuffle the chairs around, as it were, but never really get anywhere close to having a single D on the left.  &#8220;But it&#8217;s so <em>easy!</em>&#8220;, you may well be shouting.  That&#8217;s why you&#8217;re working for Google and I&#8217;m not. 
</p>
<p>
I remember having questions just like this on tests back in college: &#8220;Given this equation, solve for blah&#8221;.  It&#8217;s been too long, though, and in all honesty I was never that great at this sort of thing in the first place. Help, please?
</p>

<p><strong>[Update 14 Jan 09]</strong>: several commenters have shown that what I&#8217;m trying to do is impossible.  Frustrating, but that&#8217;s math for you.  Looks like I&#8217;ll have to take another approach.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/01/14/seeking-math-help/feed/</wfw:commentRss>
		</item>
		<item>
		<title>An Event Apart and HTML 5</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 16:01:59 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
		
		<category><![CDATA[(X)HTML]]></category>

		<category><![CDATA[An Event Apart]]></category>

		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=982</guid>
		<description><![CDATA[A bit of commentary about the choice of markup language for the brand-new An Event Apart design.]]></description>
			<content:encoded><![CDATA[<p>
The new Gregorian year has brought a striking new <a href="http://zeldman.com/" rel="friend colleague co-worker met">Big Z</a> design to <a href="http://aneventapart.com/">An Event Apart</a>, along with the detailed schedule for our first show and the opening of <a href="https://store.aneventapart.com/">registration for all four shows</a> of the year.  Jeffrey has <a href="http://www.zeldman.com/2009/01/01/an-event-apart-redesigned/">written a bit</a> about the thinking that went into the design already, and I expect more to come.  If you want <em>all</em> the juicy details, he&#8217;ll be talking about it at AEA, as a glance at the top of <a href="http://aneventapart.com/2009/seattle/#schedule">the Seattle schedule</a> will tell you.  And right after that?  An hour of me talking about coding the design he created.
</p>
<p>
One of the things I&#8217;ll be talking about is the choice of markup language for the site, which ended up being <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">HTML 5</a>.  In the beginning, I chose HTML 5 because I wanted to do something like this:
</p>

<pre>
&lt;li&gt;
&lt;a href="/2009/seattle/"&gt;
&lt;h2&gt;&lt;img src="/i/09/city-seattle.jpg" alt="Seattle" /&gt;&lt;/h2&gt;
&lt;h3&gt;May 4&#8212;5, 2009&lt;/h3&gt;
&lt;p&gt;Bell Harbor International Conference Center&lt;/p&gt;
&lt;/a&gt;
&lt;/li&gt;
</pre>

<p>
Yes, <a href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">that&#8217;s legal in HTML 5</a>, thanks to <a href="http://www.brucelawson.co.uk/2008/any-element-linking-in-html-5/">the work done</a> by <a href="http://www.brucelawson.co.uk/" rel="friend colleague met">Bruce Lawson</a> in response to my <a href="http://meyerweb.com/eric/thoughts/2008/07/23/any-element-linking-demo/">href-anywhere agitation</a>.  It isn&#8217;t what I&#8217;d consider ideal, structurally, but it&#8217;s close.  It sure beats having to make the content of every element its own hyperlink, each one pointing at the exact same destination:
</p>

<pre>
&lt;li&gt;
&lt;h2&gt;&lt;a href="/2009/seattle/"&gt;&lt;img src="/i/09/city-seattle.jpg" alt="Seattle" /&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;a href="/2009/seattle/"&gt;May 4&#8212;5, 2009&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href="/2009/seattle/"&gt;Bell Harbor International Conference Center&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
</pre>

<p>
I mean, that&#8217;s just dumb.  Ideally, I could drop an <code>href</code> on the <code>li</code> instead of having to wrap an <code>a</code> element around the content, but baby steps.  Baby steps.
</p>
<p>
So as Bruce discovered, pretty much all browsers will already let you wrap <code>a</code> elements around other stuff, so it got added to HTML 5.  And when I tried it, it worked, clickably speaking.  That is, all the elements I wrapped became part of one big hyperlink, which is what I wanted.
</p>
<p>
What I didn&#8217;t want, though, was the randomized layout weirdness that resulted once I started styling the descendants of the link.  Sometimes everything would lay out properly, and other times the bits and pieces were all over the place.  I could (randomly) flip back and forth between the two just by repeatedly hitting reload.  I thought maybe it was the heading elements that were causing problems, so I converted them all to classed paragraphs.  Nope, same problems.  So I converted them all to classed <code>span</code>s and that solved the problem.  The layout became steady and stable.
</p>
<p>
I was happy to get the layout problems sorted out, obviously.  Only, at that point, I wasn&#8217;t doing anything that required HTML 5.  Wrapping classed <code>span</code>s in links in the place of other, more semantic elements?  Yeah, <em>that&#8217;s</em> original.  It&#8217;s just as original as the coding pattern of &#8220;slowly leaching away the document&#8217;s semantics in order to make it, at long last and after much swearing, consistently render as intended&#8221;.  I&#8217;m sure one or two of you know what that&#8217;s like.
</p>
<p>
As a result, I could have gone back to XHTML 1.1 or even HTML 4.01 without incident.  In fact, I almost did, but in the end I decided to stick with HTML 5.  There were two main reasons.
</p>

<ol>
<li>
<p>First, AEA is all about the current state and near future of web design and development.  HTML 5 is already here and in use, and its use will grow over time.  We try to have the site embody the conference itself as much as possible, so using HTML 5 made some sense.</p>
</li>
<li>
<p>
I wanted to try HTML 5 out for myself under field conditions, to get a sense of how similar or dissimilar it is to what&#8217;s gone before.  Turns out the answers are &#8220;very much so&#8221; to the former and &#8220;frustratingly so&#8221; to the latter, assuming you&#8217;re familiar with XHTML.  The major rules are pretty much all the same: mind your trailing slashes on empty elements, that kind of thing.  But you know what the funniest thing about HTML 5 is?  It&#8217;s the little differences.  Like not permitting a <code>value</code> attribute on an image <code>submit</code>.  That one came as a rather large surprise, and as a result our <a href="http://aneventapart.com/subscribe/">subscribe page</a> is XHTML 1.0 Transitional instead of HTML 5.  (Figuring out how to work around this in HTML 5 is on my post-launch list of things to do.)
</p>
<p>
Oh, and we&#8217;re back to being case-insensitive.  <code>&lt;P Class="note"&gt;</code> is just as valid as <code>&lt;p class="note"&gt;</code>.  Having already fought the Casing Wars once, this got a fractional shrug from me, but some people will probably be all excited that they can uppercase their element names again.  I know I would&#8217;ve been, oh, six or seven years ago.
</p>
<p>
Incidentally, I used <a href="http://validator.nu/">validator.nu</a> to check my work.  It seemed the most up to date, but there&#8217;s no guarantee it&#8217;s perfectly accurate.  Ged knows every other validator I&#8217;ve ever used has eventually been shown to be inaccurate in one or more ways.
</p>
</li>
</ol>

<p>
I get the distinct impression that use of HTML 5 is going to cause equal parts of comfort (for the familiar parts) and eye-watering rage (for the apparently idiotic differences).  Thus it would seem the HTML 5 Working Group is succeeding quite nicely at capturing the current state of browser behavior.  Yay, I guess?
</p>
<p>
And then there was the part where I got really grumpy about not being able to nest a hyperlink element inside another hyperlink element&#8230; but that, like so many things referenced in this post, is a story for another day.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
