Archive for December, 2009

Bring back float-displace

Although I was already aware of this property’s existence, I was unaware that it had been removed from later iterations of css3-box – that was, until the related issue was brought up recently on www-style.

To me, float-displace is another good example of a property (another being box-sizing) introduced in CSS3 that aims to ‘patch’ a logical failing present in previous CSS revisisons. The current behavior can be described as, the indented edge (caused by a margin value) of the in-flow element isn’t preserved between the margin-edge of the float and the content-edge of the in-flow element; this creates the following pit-falls:-

  1. It’s completely counter-intuitive for authors who aren’t already aware of this limitation
  2. The only real workaround to this limitation is to apply a margin value (which equals the indentation of the in-flow element) to the floated element, thus emulating this indentation.

From an author’s perspective, it’s perfectly acceptable to assume that the indented egde of the in-flow element will be preserved upon encountering a float.

I have no idea what the reasoning behind removing this property from the current revision was, but am keen to find out.

IE8 haslayout = true

After numerous promises that layout was never going to be included in IE8, it’s now become clear that the feature which, should have never been exposed [even in earlier IE versions] is alive in the latest version of Internet Explorer, albeit in a far less detrimental form than earlier IE* releases.

Believing what Microsoft had promised about layout not being in IE8, I didn’t feel it necessary to carry out a simple test which checks whether an element has layout, back when Beta 1 was first released. The test happened to have been included in a recent thread on WebmasterWorld, in which a contributor suggested that layout was indeed part of IE8. Upon running this test, I was absolutely astonished by the result I was seeing; the test proves that layout is definitely included in IE8 Standards Mode.  Upon checking the scope of the known layout triggers to test the completeness of IE8’s layout implementation, I observed that all (including IE7-specific) known trigger properties invoke layout.

Now that I’d identfied layout was indeed a feature of IE8, I needed to try and ascertain the scope of layout with regards to its effect on document styling.

After discovering this unwelcome addition, the first port of call was to go back over all the bugs I’ve documented to see if by triggering layout, a workaround could be established for each of the bugs, although it subsequently turned out this wasn’t to be the case. With this in mind, I’ve concluded that layout in IE8 is either:-

  1. an implementation whose effects on layout style have been purposefully suppressed. This could have resulted from IE7’s codebase being forked to provide a base for development of IE8
  2. an accidental implementation whose suppressed effect on document styling can be attributed to inadvertant links with IE8’s seperate browser/document modes

More confirmation

I then came across a thread at SitePoint relating to an issue where a rounded-corner JS library (Nifty Corners Cube) was wrongly invoking the shrink-to-fit computation for block-level elements in normal flow. One contributor pointed out a confirmed fix which is reminiscent of triggering layout; height:1%. This particular issue, which is discussed in more detail, was essentially down to Javascript triggering layout in elements whose layout value was initially set to false. Adding a triggering property before the Javascript was fired, fixed the issue since these properties are recognised in IE8 as being layout triggers.

In conclusion, I haven’t yet some across any direct issues, such as CSS-only layout anomalies, that have resulted from layout in IE8, and I’d be very surprised if any such issues arose because of it. The real issue here however, is that some existing web pages are now broken as an indirect consequence of Microsoft backtracking on what it had previously promised. A perfectly plausible rationale behind the train of thought from the creator of Nifty Cube Corners, could be that since Microsoft had promised not to include layout in IE8, he saw no need to change the display:inline-block layout trigger, as this property doesn’t exhibit the change in width computation in IE6 & 7 (as the change to the shrink-to-fit computation is ignored for elements that aren’t naturally inline-level). However, since IE8 includes a full implementation of display:inline-block and implements layout, the unwanted behavior (in this context) is exhibited. Another example of Microsoft going back on their word, and another example of the negative effect that their fabrications are having on authors…

Aside: the IE8 fix for Nifty Corners Cube

I’ve seen a fair few posts now where IE8 appears to adopt the shrink-to-fit computation for block-level elements in normal flow, which the Javascript from Nifty Corners Cube is applied to. A snippet from the distributed ‘niftycube.js’ file:-

function FixIE(el){
if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false)
    el.style.display="inline-block";
}

display:inline-block (which uses the shrink-to-fit computation) is being used in the context of a layout trigger if hasLayout is detected as being false. Since we’ve already established that IE8 includes an implementation of layout, this trigger will be applied unless layout is set to true before this script is activated.

A more suitable trigger would be a property that doesn’t affect the initial width computation of an element. To fix this issue, instead use a more suitable trigger such as overflow:hidden

Downtime, shmowntime.

Apologies if you were greeted with a 403 upon arriving at this here blog this afternoon. A non-sarcastic thanks to YCombinator News for the huge traffic spike, which subsequently resulted in my blog being knocked out for the last 7 or so hours. I recommend Super Cache:)

Update

From June up until a few weeks ago, I took an immediate break for web-related work. The aim of this post is to provide a brief update of my goings on between June and present.

IE8 Bugs

I’m discovering (and people are writing in about) bugs in IE8 on a fairly regular basis at the moment, although that regularity has obviously decreased significantly since the RTW version was released. Astonishingly, there’s still a significant (around 40-50%) percentage of bugs that are regressions from IE7, which I guess goes to demonstrate the insufficient regression testing program used in IE8.  More so, the nature of some of the reported bugs [1][2][3][4][5] go to demonstrate how quirky and broken IE8 actually is; these aren’t straightforward spec violations – these are some very serious quirks akin to the severity of bugs found in a beta release.

Why Microsoft still haven’t removed statements claiming full CSS 2.1 support from their PR material, is beyond me. It’s astonishing to think that Microsoft thought that they could get away with publishing these blantant lies; even if IE8 didn’t have any CSS bugs/spec violations (which is essentially near impossible in itself), we still don’t have an which is one of the criterion required to demonstrate interoperability.

CSS 2.1 testsuite

I recently became a to the CSS 2.1 testsuite, and have been busy submitting many of the test cases used to demonstrate bugs in IE8. It’s of the upmost importance that every conceivable area of the specification is covered, so that we end up with a concise test suite – feel free to , if you’d be willing.

New domain

Since idreamincode.co.uk was only ever meant to be temporary, I decided to purchase the domain name, jhop.me. I’ve always been a fan of acquiring an ‘exotic’ country-code TLD, so I decided to go for a .me. I’ve been careful to preserve legacy links, but if you spot a link that is broken, please get in touch.