Posts from February 2006

S5 1.2a2

Published 18 years, 9 months past

The alpha 2 release of S5 1.2 is now available (177KB ZIP file; also available for previewing in the testbed).  There isn’t any major change here, but I did add some notable enhancements to the notes window.  These are:

  • On any slide with incrementals, an indicator of incremental progress will appear in square brackets next to the overall slide show progress on the title line.  It’s a little crude, I admit, but it serves the purpose well enough.
  • Clicking on the title of either the Elapsed Time or Remaining Time counters will “minimize” them.  Click a minimized title to maximize the box.  The actual minimum and maximum effects are purely CSS-driven, hooked onto a collapsed class name.  I’m still pondering the best way to handle this feature, so the class name may change, as for that matter may the mechanism by which one can min/max the boxes.  Suggestions are welcome.
  • Keypresses and clicks are passed from the note window back to the slide show.  In other words, the slide show fully is fully operable from either the slide show window or the notes window.  The only difference is that the notes window doesn’t have the navigation links and popup navigation menu (said difference to disappear in a future release).

That’s it.  In the process, though, I uncovered a bug that shows up in Safari 1.3.1 and 2.0, where it’s ignoring the show-first feature for incrementals.  I’m going to assume that the problem lies in the getIncrementals() function, though of course I could be wrong.  If anyone can spot the error and provide a fix, I’d be grateful.

Update 2 Mar 06: in addition to the Safari problem, I’ve discovered that IE/Win doesn’t seem to share event information between windows.  Thus, if you try to run the slide show from the notes window, errors get thrown.  I managed to fix this in clicker() by adding a test for notes-window events, but trap() has a very different structure and I’m not sure how to fix it.  Thus the testbed in IE/Win currently lets you advance the slide show from the notes window by clicking the mouse button, but keyboard navigation throws an error.  If anyone can tell me how to get around this, even with a pointer to a good article on passing events from one window to another, I’d be very grateful.


A Grand Lady

Published 18 years, 9 months past

Not long after noon this past Tuesday, my grandmother Constance died at the age of 98.  She was my father’s mother, the last of my grandparents to die.  At this point, if I were to start with me and trace the tree diagrams of my mother’s and father’s families all the way back to their root elements, my only living ancestor is my father.

It is always sad when a loved one dies, but it’s what she wanted, and I respect that decision without reservation.  Her health and physical abilities had deteriorated greatly, and she was tired in a way that I cannot hope to comprehend.  She had seen her children grow up and have their own children, and then become grandparents of their own.  Her life had been long, her joys and sorrows beyond counting.  She was ready to call an end.  In many ways, she had been ever since losing her husband a little over three years ago.

Tomorrow we go to join the gathering family.  I think Grammy would have wanted nothing else but that: the family together, forming a great circle of strength and love in which each of us can shelter.


Comment Spam Quips

Published 18 years, 9 months past

In keeping with Molly‘s recent conversations with comment spam, I present to you a back-handed compliment (or is it?) that I found in my moderation queue:

A great site where one can enjoy the thought of a great mind long departed. Cheers for the good work!

Wow.  Harsh.


Botheration

Published 18 years, 9 months past
If you’re bothered by the fact that you weren’t bothered by a thought you just had, isn’t the thought just bothering you by proxy?

Unfortunately Eric

Published 18 years, 10 months past

Thanks to The Wolf‘s pointer to The Other Wolf‘s post, I now bring you “Unfortunately Eric”.

Unfortunately, Eric mentions it, but doesn’t really discuss aa major concern of many…
You mean your misspelling of the word “a”?  I didn’t want to harp on it.
Unfortunately Eric Doesn’t Look Old Enough to Remember MS C 7.0…
Sure I am.  I just don’t want to remember it.
Unfortunately, Eric and Felecia are now against Lisa and the Wildlife preserve.
They started it!
She and Eric had been living with Dan in Hawaii for a while, but unfortunately, Eric had to go back home for a family emergency before we got there.
And that’s how she and Dan ended up together, whereas I ended up on the streets.  Crazy times…
Unfortunately Eric takes several wrong turns on the twisty, identical, unlabeled streets leading to Dog Boys (entirely due to a lack of preparation)…
In my defense, I was totally prepared for Cat Boys.
Unfortunately Eric has not released those precious gems of 415 golden songs, nor the EMB II album, as Eric left the group for other projects…
They weren’t very danceable anyway.
Unfortunately, Eric didn’t receive the letter until after the dance.
Story of my life.
Unfortunately, Eric had a couple of problems.
Your count seems a bit low.
Unfortunately, Eric had an appetite for destruction – which he never had the opportunity to quench…
Eric SMASH!
unfortunately eric is not only drop dead f*cking gorgeous he…
Oh, stop.
Unfortunately, Eric did not live long enough to witness the legend he created.
Aw crap.  Did I drop dead again?

It’ll be interesting to see how long it takes for this post to throw Google’s results out of whack.  (Answer: three days.)


Unitless line-heights

Published 18 years, 10 months past

I’d like to share something that will be old news to readers of CSS: The Definitive Guide and all of my other books, but nonetheless needs to be said out loud, in public, for everyone to hear.

The property line-height can accept unitless number values.  You can also give line-height united values, though generally you shouldn’t.  But unitless numbers are just fine for this property.

So what’s the difference?  When you define a united value, like 1em, you’re setting things up to pass along the computed result to any descendants.  For example, suppose the following CSS is applied to a document containing the following markup fragment:

ul {font-size: 15px; line-height: 1em;}
li {font-size: 10px;}
small {font-size: 80%;}

<ul>
  <li>I'm a list item with <small>small text</small>.</li>
</ul>

The ul element has its line-height computed to be 15px because for line-height, em-based values are calculated using the computed font-size of the element itself.  I declared the font-size directly, so we know its computed size in pixels.

(Yes, yes, I know, pixel-sized text is evil and wrong, but it makes explaining how all this works a lot simpler.)

So that computed value of 15px is what’s passed on to the descendent elements.  The li and small elements will inherit a line-height value of 15px.  End of story.  They don’t change it based on their own font sizes; in fact, they don’t change it at all.  They just take that 15px and use it, exactly the same as if I’d said:

ul {font-size: 15px; line-height: 1em;}
li {font-size: 10px; line-height: 15px;}
small {font-size: 80%; line-height: 15px;}

Okay, now suppose I take the em off that line-height value, so that the styles now read:

ul {font-size: 15px; line-height: 1;}
li {font-size: 10px;}
small {font-size: 80%;}

Now what’s passed on is that raw number, which is used by descendent elements as a scaling factor—a multiplier, if you will–and not the computed result.

Thus every element that inherits that value of 1 will take that value and multiply it with their computed font-sizes.  The list item, with its declared font-size: 10px, will have a computed line-height of 10px.  Then it will pass that 1 on to the small element, which will multiply it with its computed font-size.  That’s 8 pixels; therefore, its line-height will also be 8 pixels.

The end result is exactly the same as if I’d written:

ul {font-size: 15px; line-height: 1;}
li {font-size: 10px; line-height: 10px;}
small {font-size: 80%; line-height: 8px;}

That’s a pretty major difference.  This is why it’s always strongly recommended that you use unitless numbers if you’re going to set a line-height on something like the html or body elements, or indeed on any element that is going to have descendant elements.

The fact that the CSS validator has a bug that causes it to generate parse errors on unitless number values for line-height (see report #2307) rather confuses things; we get an occasional jeering e-mail over at A List Apart as a result, since running CSS validation on the site gets an error due to my use of line-height: 1;.  Jeffrey points the correspondents to that bug report, and usually we never hear anything back.

And if anyone reading this feels motivated to fix the validator, please do.  As it says in the bug report, all they really need is a patch for review.  I might do it myself when I have some free time.  That’ll be in, oh, 2009 or so.

Again: the property line-height can accept unitless number values, and they’re a better choice than united values in 99 out of 100 cases anyway.  Okay?  Thank you.

[Addendum 26 Aug 06: Roger Johansson points out a bug in older Gecko browsers relating to unitless line-heights.]


AEA Atlanta Heats Up

Published 18 years, 10 months past

Registration for AEA Atlanta has been open a week now and one-fifth of the seats are already claimed, so you might want to step up the pressure on your boss.  The early bird deadline won’t be here for another three and a half weeks, but seat availability may not last that long.  (As I’ve mentioned before, it didn’t in Philadelphia.)

Even better, the value of any one of those seats just went up.  How so?  We’ve just announced that we’ll have two (count ’em!) guest speakers joining us: Jason Santa Maria, who delivered one of the highest rated presentations in Philadelphia; and Atlanta native Todd Dominey of Dominey Design, Turner Entertainment, and What Do I Know.

What will they talk about?  You’ll have to come to Atlanta to find out.  Personally, I can’t wait.


Charting IE7b2

Published 18 years, 10 months past

So IE7 beta 2 is out.  As you might expect in a beta, it has some things that don’t work as one might hope, whether due to long-standing behaviors or brand new bugs.

I’ve said it before, and I’ll say it again: don’t panic.  Trying to fix a site that’s “broken” in IE7b2 is kind of like deciding to raze your profitable gas station just because you heard car companies are experimenting with hydrogen fuel cells.  When the final version of IE7 comes out, then you can worry about what to do.  Maybe your site won’t be “broken” any more, and you won’t have to do anything.

In the meantime, what you should do is figure out what’s causing the problem you’re seeing in b2, create a very minimal test case that causes the problem, and submit that to Microsoft.  By doing that, you give them a chance to identify the problem and fix it before IE7 goes final… at which time, you won’t have to do anything about your site, because it won’t be broken.

That’s if they fix the bug in question.  They might not; they don’t have infinite time and energy.  But I can absolutely guarantee that they’ll never get around to fixing a bug nobody told them about.

In the CSS world, there are some points of concern, including bugs that are new to IE7b2.  The css-discuss community has started collecting information over on the wiki, and if you have test cases that demonstrate CSS bugs in IE7, you should feel free to add information and links to that page.

Before you do, though, make sure to observe the following (adapted from my post to css-discuss):

  1. Make absolutely certain you’re testing IE7 beta 2.  IE7b1, which is available for download on various sites, had no known CSS enhancements.  It did not support CSS2.1 selectors, or fix any bugs on which CSS hacks depend, or just about anything else.  If you test with IE7b1, you’re wasting your time.  Again, be SURE you’re testing with IE7b2.

  2. If you’re testing property, value, or behavioral support in IE7, make absolutely certain that your test case uses no hacks, filters, conditional comments, or other measures.  If you’re testing float margin-doubling, for example, but you still have in a CSS hack targeted at IE6, you might get completely spurious results. Make your tests as simple as humanly possible while still showing the problem.

  3. If you’re testing support for hacks, filters, or conditional comments in IE7, try to make sure you’re testing using simple effects. For example, here’s how I’d test for IE7 support of a child combinator:

       p {color: red; font-style: italic; font-weight: normal;
          text-transform: none;}
       div>p {color: green;}
       div > p {font-style: normal;}
       #test>p {font-weight: bold;}
       #test > p {text-transform: uppercase;}
    
       <div id="test"><p>Bold uppercase green</p></div>
       <p>Italic normal case red</p>
    

    This approach uses property/value combinations that we all know IE/Win has supported for a long, long time.  If I tried to test with widths and margins and padding, I’d be concerned that a box model bug was sneaking in and making me think there was a selection bug.  With the color-font-text approach, this is far less likely.  (Not non-zero, but close.)

    Similarly, to test arbitrary-element hover, I’d do nothing more exciting than:

        p:hover {color: green; background: cyan;}
    
  4. If you find a new bug, as Al Sparber has with the a:hover/@import problem, absolutely document it with a basic test case (as Al did) and feel free to ask others for confirmation.  But remember the previous points when you construct your test case.

The goal of all this isn’t just to make sure Microsoft knows about every CSS bug under the sun, though that certainly wouldn’t hurt.  What I also hope to see happen is that we get an idea of what’s new, what’s broken, and what absolutely must be fixed.  To pick a hypothetical example, suppose it was discovered that in fixing float margin-doubling, IE7 broke clearing behavior.  That would absolutely have to get fixed before IE7 final.  Doing so would be far more critical than, say, adding support for generated content, or even fixed positioning.

Again, don’t panic, but please do help find any bugs or other problems in IE7b2, so that we have a chance of seeing the problems corrected.

Addenda: so just after I posted this, I found out about the IEblog post What’s New for CSS in Beta 2 Preview? and the in-progress MSDN technical note Cascading Style Sheet Compatibility in Internet Explorer 7.  Those might come in handy as a baseline of “here’s what I should see” while you work to find out what you actually see.


Browse the Archive