IE6 reverse-inherits text-indent
I did a brief web search for this bug when it reared its ugly head, but came up empty. So either I just didn't search well enough, it hasn't been documented, or I've discovered a new IE rendering bug. Likely I didn't look hard enough, I'm sure.
IE6 incorrectly treats text-indent for the contents of (at least) the p element when the contents start with child element with a negative text-indent.
Take this code, for example:
<div style="border: 5px solid #aaa; width: 20em; margin: 1em auto">
<p style="margin: 0; padding: 0">
<span style="text-indent: -30px">OOO</span>XXX
</p>
</div>
FireFox 2.0.0.6 correctly renders the code like this:
IE6 renders like this:
IE brand of flare
IE's rendering is incorrect in the following ways:
- Per the spec,
text-indentonly applies to block elements, so should be ignored in this case - Also per the spec, the visibility of text overflowing the container should correspond to the value of the
overflowproperty (which should default to visible)
Adding insult to injury
Now let's make it a bit more interesting. Floating the span will convert it to a block element automatically, whereby it meets the requirements to apply the text-indent.
<div style="border: 5px solid #aaa; width: 20em; margin: 1em auto">
<p style="margin: 0; padding: 0; color: #00f">
<span style="text-indent: -30px;float: left; color: #f00">OOO</span>XXX
</p>
</div>
Here's how FireFox 2.0.0.6 correctly renders it:
and with text-indent: 30px
And what IE does with it:
and with text-indent: 30px
So let's add to the list:
- The
text-indentassigned to thespanwas also applied to thep! - A side effect of #3 is when using negative indenting, the parent's content can overlap the child's content
- Another side effect of #3 is that the
pcontent can leave its container.
More to point #5
For clarity, now that we have a proper block element implementing the negative text-indent, you can see what should happen with the p content when the floated span leaves the container.
<div style="border: 5px solid #aaa; width: 20em; margin: 1em auto">
<p style="margin: 0; padding: 0; color: #00f">
<span style="text-indent: -9999em;float: left;color: #f00">OOO
</p>
</div>
Here's how FireFox 2.0.0.6 correctly renders it:
And IE:
I've got nothing
I'm unhappy to report that while similar to the IE doubled-margin bug, this case isn't fixed by applying display: inline.
I have no fix. I don't believe I've ever debugged IE applying a style property to the assignee's parent element, so I'm at a loss. The text-indent shouldn't be reverse-inherited to the containing p. That much is clear. I haven't spent much time "researching" a fix, so I have no suggestion other than to berate IE6 with renewed vigor and change your markup or style in disgruntled defeat.
They don't think about the connotations of the word anymore, they perceive it symbolically as a tool, useful to accomplish their goals. If you later realize there is a better name for the feature (which there most likely is), you can't simply rename the current feature without compromising user expectations. Pulling the rug out from under your current user base like that would be strike two.
Now what happens if a new revision of your application includes a feature that perfectly fits the inbox convention? Well, you're out of luck, because the word has already become symbolic of a different interaction model. And don't even think about creating a conventional inbox along side your non-conventional inbox, because that breaks your lexicon.
I've used the inbox paradigm as an example, but the same policy holds true for all mature conventions. Emerging conventions aren't as volatile, but you do run the risk of choosing a representation that will become dated as the new convention matures.
Feature naming is often one of the hardest parts of building an interface. Just be careful when you include conventional terms in your naming options. You might be looking at trouble ahead that you didn't expect.