<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Inherit Expression for IE?</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Thu, 18 Mar 2010 20:56:32 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: flash tekkie</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-416102</link>
		<dc:creator>flash tekkie</dc:creator>
		<pubDate>Sat, 18 Oct 2008 10:34:26 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-416102</guid>
		<description>Any script execution at the Style Sheet stack of the browser is a performance issue and more importantly a security threat so the use of IE expressions should not be encouraged. It&#039;s a non-standard approach that does not comply with W3C directives.

Good news is &lt;a href=&quot;http://tekkie.flashbit.net/browsers/internet-explorer-dumping-css-hacks-to-comply-with-standards&quot; title=&quot;Internet Explorer dumping CSS hacks to comply with standards&quot; rel=&quot;nofollow&quot;&gt;Microsoft is ending expressions in Internet Explorer&lt;/a&gt; as announced on Thursday earlier this week. Indeed a very nice move towards the standard-compliant browser.</description>
		<content:encoded><![CDATA[<p>Any script execution at the Style Sheet stack of the browser is a performance issue and more importantly a security threat so the use of IE expressions should not be encouraged. It&#8217;s a non-standard approach that does not comply with W3C directives.</p>
<p>Good news is <a href="http://tekkie.flashbit.net/browsers/internet-explorer-dumping-css-hacks-to-comply-with-standards" title="Internet Explorer dumping CSS hacks to comply with standards" rel="nofollow">Microsoft is ending expressions in Internet Explorer</a> as announced on Thursday earlier this week. Indeed a very nice move towards the standard-compliant browser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared Ritchey</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-399777</link>
		<dc:creator>Jared Ritchey</dc:creator>
		<pubDate>Tue, 12 Aug 2008 17:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-399777</guid>
		<description>Good stuff! I use a cross between Yahoo Grids, the 960 Grid and now this in a sort of hybrid solution for my layouts and it works 98% in each browser.

I&#039;m wondering however if it isn&#039;t required to use javascript hacking if the idea behind the inherit is to remind a person to style the elements rather than depend on inherit as a default directive;

I&#039;m trying to talk myself out of using any more hacks to make IE behave. Designers are already stuck using Transparent PNG hacks and other HTC (HTML Component) just to get IE to play nice.

This is a really good post Eric, thanks for the education and perspective.

~ Jared Ritchey</description>
		<content:encoded><![CDATA[<p>Good stuff! I use a cross between Yahoo Grids, the 960 Grid and now this in a sort of hybrid solution for my layouts and it works 98% in each browser.</p>
<p>I&#8217;m wondering however if it isn&#8217;t required to use javascript hacking if the idea behind the inherit is to remind a person to style the elements rather than depend on inherit as a default directive;</p>
<p>I&#8217;m trying to talk myself out of using any more hacks to make IE behave. Designers are already stuck using Transparent PNG hacks and other HTC (HTML Component) just to get IE to play nice.</p>
<p>This is a really good post Eric, thanks for the education and perspective.</p>
<p>~ Jared Ritchey</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florent Guiliani</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-227057</link>
		<dc:creator>Florent Guiliani</dc:creator>
		<pubDate>Thu, 30 Aug 2007 10:20:05 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-227057</guid>
		<description>@Dean Edwards - Your way is the best way from a feature point of vue. (except I would change:
inherit(this,&quot;fontFamily&quot;,&quot;times&quot;));
by
inherit(this,&quot;fontFamily&quot;,document.documentElement.currentStyle.fontFamily));

but It&#039;s very slowwwwwwwwwing the page :(. It&#039;s seems IE is calling js expression on any user action.</description>
		<content:encoded><![CDATA[<p>@Dean Edwards &#8211; Your way is the best way from a feature point of vue. (except I would change:<br />
inherit(this,&#8221;fontFamily&#8221;,&#8221;times&#8221;));<br />
by<br />
inherit(this,&#8221;fontFamily&#8221;,document.documentElement.currentStyle.fontFamily));</p>
<p>but It&#8217;s very slowwwwwwwwwing the page :(. It&#8217;s seems IE is calling js expression on any user action.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Sleight</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-140836</link>
		<dc:creator>Jack Sleight</dc:creator>
		<pubDate>Wed, 25 Apr 2007 11:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-140836</guid>
		<description>I think the most logical &quot;default&quot; for font-family would be &quot;serif&quot;. Given that most browsers (on Windows at least) seem to use Times New Roman as their default.

It should certainly be one of the generic families (serif, sans-serif,  cursive, fantasy or monospace). serif and sans-serif seem the obvious choices.</description>
		<content:encoded><![CDATA[<p>I think the most logical &#8220;default&#8221; for font-family would be &#8220;serif&#8221;. Given that most browsers (on Windows at least) seem to use Times New Roman as their default.</p>
<p>It should certainly be one of the generic families (serif, sans-serif,  cursive, fantasy or monospace). serif and sans-serif seem the obvious choices.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Edwards</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-140138</link>
		<dc:creator>Dean Edwards</dc:creator>
		<pubDate>Tue, 24 Apr 2007 23:28:01 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-140138</guid>
		<description>@priit - I would recommend *not* using CSS expressions most of the time. As you point out they can be very slow. There are ways round the fact that they are endlessly evaluated but you really have to know what you are doing. To be clear, I recommend not using expressions, especially for something as trivial as this example.</description>
		<content:encoded><![CDATA[<p>@priit &#8211; I would recommend *not* using CSS expressions most of the time. As you point out they can be very slow. There are ways round the fact that they are endlessly evaluated but you really have to know what you are doing. To be clear, I recommend not using expressions, especially for something as trivial as this example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dao</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139709</link>
		<dc:creator>Dao</dc:creator>
		<pubDate>Tue, 24 Apr 2007 17:01:06 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139709</guid>
		<description>&lt;blockquote&gt;you should check this, because during page loading things are different and html does have parentNode too.&lt;/blockquote&gt;
That doesn&#039;t overrule my point: it would be more sensible to just not use that expression for the &lt;code&gt;html&lt;/code&gt; element.

Apart from performance, what&#039;s wrong with:
&lt;code&gt;&#160;&#160;* {
&#160;&#160;&#160;&#160;font-style: expression(this.parentNode.currentStyle.fontStyle);
&#160;&#160;}
&#160;&#160;html {
&#160;&#160;&#160;&#160;font-style: normal;
&#160;&#160;}&lt;/code&gt;
?

&lt;blockquote&gt;Are you sure that running your solution through profiler versus mine, your is not perhaps ten times slower?&lt;/blockquote&gt;
Using &lt;code&gt;expression&lt;/code&gt; is expensive in the first place; I don&#039;t think calling a function adds relevant overhead.</description>
		<content:encoded><![CDATA[<blockquote><p>you should check this, because during page loading things are different and html does have parentNode too.</p></blockquote>
<p>That doesn&#8217;t overrule my point: it would be more sensible to just not use that expression for the <code>html</code> element.</p>
<p>Apart from performance, what&#8217;s wrong with:<br />
<code>&nbsp;&nbsp;* {<br />
&nbsp;&nbsp;&nbsp;&nbsp;font-style: expression(this.parentNode.currentStyle.fontStyle);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;html {<br />
&nbsp;&nbsp;&nbsp;&nbsp;font-style: normal;<br />
&nbsp;&nbsp;}</code><br />
?</p>
<blockquote><p>Are you sure that running your solution through profiler versus mine, your is not perhaps ten times slower?</p></blockquote>
<p>Using <code>expression</code> is expensive in the first place; I don&#8217;t think calling a function adds relevant overhead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Priit Pirita</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139677</link>
		<dc:creator>Priit Pirita</dc:creator>
		<pubDate>Tue, 24 Apr 2007 16:36:23 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139677</guid>
		<description>Dean,
Are you sure you want to add such overhead to do such a simple thing? As I said, IE evaluates CSS expressions constantly, you move the cursor over the element and expression is evaluated and again and again. And there is lot of tags in Eric&#039;s reset script. Are you sure that running your solution through profiler versus mine, your is not perhaps ten times slower? Are you sure that all this does not affect on browsers responsivness? I do expect you should know IE ten times better than I do, that&#039;s why I am asking...</description>
		<content:encoded><![CDATA[<p>Dean,<br />
Are you sure you want to add such overhead to do such a simple thing? As I said, IE evaluates CSS expressions constantly, you move the cursor over the element and expression is evaluated and again and again. And there is lot of tags in Eric&#8217;s reset script. Are you sure that running your solution through profiler versus mine, your is not perhaps ten times slower? Are you sure that all this does not affect on browsers responsivness? I do expect you should know IE ten times better than I do, that&#8217;s why I am asking&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Edwards</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139631</link>
		<dc:creator>Dean Edwards</dc:creator>
		<pubDate>Tue, 24 Apr 2007 15:50:15 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139631</guid>
		<description>@Priit - am I sure of what? The code I posted works, whether it is practical to use it or not is up to the individual. Personally, I wouldn&#039;t bother with expressions to fix such a minor bug.</description>
		<content:encoded><![CDATA[<p>@Priit &#8211; am I sure of what? The code I posted works, whether it is practical to use it or not is up to the individual. Personally, I wouldn&#8217;t bother with expressions to fix such a minor bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thacker</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139625</link>
		<dc:creator>thacker</dc:creator>
		<pubDate>Tue, 24 Apr 2007 15:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139625</guid>
		<description>My final two-cents--

To hell with using JavaScript for CSS. I suggest a separate reset IE style sheet within a conditional comment for all IE browsers.. simple and stupid.

&lt;code&gt;html,body,div,span,
applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,em,font,img,ins,kbd,q,s,samp,
small,strike,strong,sub,sup,tt,var,
fieldset,form,label,legend,
caption{font-style:normal;font-weight:normal;font-family:monospace}
&lt;/code&gt;

Anyone see any pitfalls in my logic, please blast away.</description>
		<content:encoded><![CDATA[<p>My final two-cents&#8211;</p>
<p>To hell with using JavaScript for CSS. I suggest a separate reset IE style sheet within a conditional comment for all IE browsers.. simple and stupid.</p>
<p><code>html,body,div,span,<br />
applet,object,iframe,<br />
h1,h2,h3,h4,h5,h6,p,blockquote,pre,<br />
a,abbr,acronym,address,big,cite,code,<br />
del,dfn,em,font,img,ins,kbd,q,s,samp,<br />
small,strike,strong,sub,sup,tt,var,<br />
fieldset,form,label,legend,<br />
caption{font-style:normal;font-weight:normal;font-family:monospace}<br />
</code></p>
<p>Anyone see any pitfalls in my logic, please blast away.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Priit Pirita</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139431</link>
		<dc:creator>Priit Pirita</dc:creator>
		<pubDate>Tue, 24 Apr 2007 12:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139431</guid>
		<description>Dean,
are you absolutely sure? The thing is that IE does not evaluate those expressions only once, instead it evaluates them more or less all the time. Which means the less overhead the better or?</description>
		<content:encoded><![CDATA[<p>Dean,<br />
are you absolutely sure? The thing is that IE does not evaluate those expressions only once, instead it evaluates them more or less all the time. Which means the less overhead the better or?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thacker</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139398</link>
		<dc:creator>thacker</dc:creator>
		<pubDate>Tue, 24 Apr 2007 12:28:03 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139398</guid>
		<description>I could damn well be missing and/or misunderstanding a few things with the overall purpose of a reset style sheet and its functional implementation.

I am viewing the reset style sheet as more of a design tool that can be removed, or portions of it, prior to moving the content to the production server. I have been assuming that its use and development has and is directed primarily for projection and screen media. [Have not yet evaluated its impact upon print media or creating a separate massive print reset, nor the same for handheld devices.]

The use of script dynamic properties within a temporary reset file that serves as a visual aide to the developer/designer to insure that elements have been assigned values for font styling seems to make some sense. Keeping it simple and stupid seems to make some sense. Testing the hell out of any script, using a NASA philosophy, prior to deployment makes even more sense.

Spending ten bucks to solve a nickel problem doesn&#039;t make sense.

I am leery as hell about the use of client-side JavaScript for a lot of reasons.

But then as stated, I could be just confused.</description>
		<content:encoded><![CDATA[<p>I could damn well be missing and/or misunderstanding a few things with the overall purpose of a reset style sheet and its functional implementation.</p>
<p>I am viewing the reset style sheet as more of a design tool that can be removed, or portions of it, prior to moving the content to the production server. I have been assuming that its use and development has and is directed primarily for projection and screen media. [Have not yet evaluated its impact upon print media or creating a separate massive print reset, nor the same for handheld devices.]</p>
<p>The use of script dynamic properties within a temporary reset file that serves as a visual aide to the developer/designer to insure that elements have been assigned values for font styling seems to make some sense. Keeping it simple and stupid seems to make some sense. Testing the hell out of any script, using a NASA philosophy, prior to deployment makes even more sense.</p>
<p>Spending ten bucks to solve a nickel problem doesn&#8217;t make sense.</p>
<p>I am leery as hell about the use of client-side JavaScript for a lot of reasons.</p>
<p>But then as stated, I could be just confused.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dean Edwards</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139332</link>
		<dc:creator>Dean Edwards</dc:creator>
		<pubDate>Tue, 24 Apr 2007 11:31:36 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139332</guid>
		<description>@ppk - you know that IE does not obey the rules so why bother quoting them. ;-)

Jonathon is on the right track. To get true inheritance you should walk up the DOM tree like this:

&lt;style type=&quot;text/css&quot;&gt;
p  {font-family: wingdings;}
p.inherit {font-family: expression(inherit(this,&quot;fontFamily&quot;,&quot;times&quot;));}
&lt;/style&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
function inherit(element, property, defaultValue) {
&#160;&#160;function process(element) {
&#160;&#160;&#160;&#160;if (!element) return defaultValue;
&#160;&#160;&#160;&#160;return element.currentStyle[property] &#124;&#124; process(element.parentElement);
&#160;&#160;};
&#160;&#160;return process(element.parentElement) &#124;&#124; defaultValue;
};
&lt;/script&gt;</description>
		<content:encoded><![CDATA[<p>@ppk &#8211; you know that IE does not obey the rules so why bother quoting them. ;-)</p>
<p>Jonathon is on the right track. To get true inheritance you should walk up the DOM tree like this:</p>
<p>&lt;style type=&#8221;text/css&quot;&gt;<br />
p  {font-family: wingdings;}<br />
p.inherit {font-family: expression(inherit(this,&quot;fontFamily&quot;,&quot;times&quot;));}<br />
&lt;/style&gt;</p>
<p>&lt;script type=&quot;text/javascript&quot;&gt;<br />
function inherit(element, property, defaultValue) {<br />
&nbsp;&nbsp;function process(element) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!element) return defaultValue;<br />
&nbsp;&nbsp;&nbsp;&nbsp;return element.currentStyle[property] || process(element.parentElement);<br />
&nbsp;&nbsp;};<br />
&nbsp;&nbsp;return process(element.parentElement) || defaultValue;<br />
};<br />
&lt;/script&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ppk</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139265</link>
		<dc:creator>ppk</dc:creator>
		<pubDate>Tue, 24 Apr 2007 09:21:54 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-139265</guid>
		<description>Do you have to do anything?

In the case of &lt;code&gt;font-family&lt;/code&gt;, do you need to specify anything? As far as I know, the default value of &lt;code&gt;font-family&lt;/code&gt; is &lt;code&gt;inherit&lt;/code&gt; (or at least, the functionality is the same). 

Nearly every element uses the same font-family as its parent, unless you explicitly overrule it. The only exceptions are elements like &lt;code&gt;&lt;code&gt;&lt;/code&gt;, which have a default monospace font.

So doing nothing might be the best way of solving the &lt;code&gt;font-family&lt;/code&gt; problem. Alternatively, as Sebastian said, use &lt;code&gt;document.documentElement.currentStyle.fontFamily&lt;/code&gt; throughout the document.</description>
		<content:encoded><![CDATA[<p>Do you have to do anything?</p>
<p>In the case of <code>font-family</code>, do you need to specify anything? As far as I know, the default value of <code>font-family</code> is <code>inherit</code> (or at least, the functionality is the same). </p>
<p>Nearly every element uses the same font-family as its parent, unless you explicitly overrule it. The only exceptions are elements like <code>&lt;code&gt;</code>, which have a default monospace font.</p>
<p>So doing nothing might be the best way of solving the <code>font-family</code> problem. Alternatively, as Sebastian said, use <code>document.documentElement.currentStyle.fontFamily</code> throughout the document.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thacker</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-138415</link>
		<dc:creator>thacker</dc:creator>
		<pubDate>Mon, 23 Apr 2007 20:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-138415</guid>
		<description>Patrick--

I was having issues with IE 6 and 7 only when the script was referenced via conditional commented style sheets. Changing the single quotes to double quotes, as you did, resolved the IE errors.</description>
		<content:encoded><![CDATA[<p>Patrick&#8211;</p>
<p>I was having issues with IE 6 and 7 only when the script was referenced via conditional commented style sheets. Changing the single quotes to double quotes, as you did, resolved the IE errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Teague</title>
		<link>http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-138374</link>
		<dc:creator>Patrick Teague</dc:creator>
		<pubDate>Mon, 23 Apr 2007 19:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comment-138374</guid>
		<description>Which version of IE is thacker having the issue in?  My initial try in IE caused issues, but this is because I forgot to convert the special &#039; char that quotes are converted to in the posting.  Once I changed the &quot;special&quot; quotes to normal quotes it worked fine in IE 5.01, 5.5, &amp; 6 on winXP.

One thing to note about the expression() value is that it executes JavaScript.  When JavaScript is turned off the expression() is never calculated.  However, because it is JavaScript, the default could be a variable.  Unfortunately if the variable doesn&#039;t exist (unless it is an object property) it will cause an error.  So something like -

&lt;code&gt;font-family: expression(
 this.parentNode.currentStyle ?
 this.parentNode.currentStyle.fontFamily :
 xFamily );&lt;/code&gt;

wouldn&#039;t be a good idea, but you could do something similar to

&lt;code&gt;font-family: expression(
   this.parentNode.currentStyle ? 
   this.parentNode.currentStyle.fontFamily :
   top.xFamily );&lt;/code&gt;

if top.xFamily doesn&#039;t exist it simply treats it as a null or empty value &amp; displays whatever IE&#039;s default is.

When using expression() just be aware of some of the things others have discovered - &lt;a href=&quot;http://www.456bereastreet.com/archive/200611/ie_expressions_ignore_css_media_types/&quot; rel=&quot;nofollow&quot;&gt;456 Berea Street - IE expressions ignore CSS media types&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Which version of IE is thacker having the issue in?  My initial try in IE caused issues, but this is because I forgot to convert the special &#8216; char that quotes are converted to in the posting.  Once I changed the &#8220;special&#8221; quotes to normal quotes it worked fine in IE 5.01, 5.5, &amp; 6 on winXP.</p>
<p>One thing to note about the expression() value is that it executes JavaScript.  When JavaScript is turned off the expression() is never calculated.  However, because it is JavaScript, the default could be a variable.  Unfortunately if the variable doesn&#8217;t exist (unless it is an object property) it will cause an error.  So something like -</p>
<p><code>font-family: expression(<br />
 this.parentNode.currentStyle ?<br />
 this.parentNode.currentStyle.fontFamily :<br />
 xFamily );</code></p>
<p>wouldn&#8217;t be a good idea, but you could do something similar to</p>
<p><code>font-family: expression(<br />
   this.parentNode.currentStyle ?<br />
   this.parentNode.currentStyle.fontFamily :<br />
   top.xFamily );</code></p>
<p>if top.xFamily doesn&#8217;t exist it simply treats it as a null or empty value &amp; displays whatever IE&#8217;s default is.</p>
<p>When using expression() just be aware of some of the things others have discovered &#8211; <a href="http://www.456bereastreet.com/archive/200611/ie_expressions_ignore_css_media_types/" rel="nofollow">456 Berea Street &#8211; IE expressions ignore CSS media types</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head profile="http://gmpg.org/xfn/1">
<title>meyerweb.com</title>
<link rel="openid.server" href="http://www.myopenid.com/server">
<link rel="openid.delegate" href="http://emeyer.myopenid.com/">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel="shortcut icon" href="/favicon.ico"><link rel="home" href="http://meyerweb.com/" title="Home" ><link rel="stylesheet" href="http://meyerweb.com/ui/meyerweb.css" type="text/css" media="screen, projection"><link rel="stylesheet" href="http://meyerweb.com/ui/theme.css" type="text/css" media="screen, projection" id="themeLink"><link rel="stylesheet" href="http://meyerweb.com/ui/print.css" type="text/css" media="print"><script src="http://meyerweb.com/ui/addresses.js" type="text/javascript"></script><link rel="stylesheet" href="/ui/wordpress.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/tfe.css" type="text/css" media="screen">
<link rel="stylesheet" href="/ui/home.css" type="text/css" media="screen">
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric" href="/eric/thoughts/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only technical posts)" href="/eric/thoughts/category/tech/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Thoughts From Eric (only personal posts)" href="/eric/thoughts/category/personal/rss2/full" />
<link rel="alternate" type="application/rss+xml" title="Distractions" href="/eric/thoughts/recent-links/rss2" />
<link rel="alternate" type="application/rss+xml" title="Excuse of the Day" href="/feeds/excuse/rss20.xml" />
</head>
<body id="www-meyerweb-com" class="hpg">

<div id="sitemast"><h1><a href="/"><span>meyerweb</span>.com</a></h1></div><div id="search"><h4>Exploration</h4><!-- SiteSearch Google --><form method="get" action="http://www.google.com/custom" target="_top"><div><input type="hidden" name="domains" value="meyerweb.com"></input><label for="sbb" style="display: none">Submit search form</label><input type="submit" name="sa" value="Google Search" id="sbb"></input><label for="sbi" style="display: none">Enter your search terms</label><input type="text" name="q" size="31" maxlength="255" value="" id="sbi"></input><p><input type="radio" name="sitesearch" value="meyerweb.com" checked id="ss1"></input><label for="ss1" title="Search meyerweb.com">meyerweb.com</label><input type="radio" name="sitesearch" value="" id="ss0"></input><label for="ss0" title="Search the Web">Web</label></p><input type="hidden" name="client" value="pub-3772084027748653"></input><input type="hidden" name="forid" value="1"></input><input type="hidden" name="ie" value="ISO-8859-1"></input><input type="hidden" name="oe" value="ISO-8859-1"></input><input type="hidden" name="safe" value="active"></input><input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input><input type="hidden" name="hl" value="en"></input></div></form><!-- SiteSearch Google --><!-- <form method="get" action="http://www.google.com/custom"><div><input type="submit" name="sa" value="Search"><input type="text" name="q" size="20" maxlength="255" value=""><input type="hidden" name="sitesearch" value="meyerweb.com"></div></form><small><a href="http://www.google.com/search">Powered by Google</a></small> --></div><div id="main"><div class="skipper">Skip to: <a href="#extra">site navigation/presentation</a></div><div class="skipper">Skip to: <a href="#thoughts">Thoughts From Eric</a></div>
<div id="thoughts">


<div class="entry">
<h3><a href="http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/" rel="bookmark" title="Permanent Link: Inherit Expression for IE?">Inherit Expression for IE?</a></h3>
<ul class="meta">
<li class="date">Mon 23 Apr 2007</li>
<li class="time">1040</li>
<li class="cat"><a href="http://meyerweb.com/eric/thoughts/category/tech/css/" title="View all posts in CSS" rel="category tag">CSS</a></li>
<li class="cmt"><a href="http://meyerweb.com/eric/thoughts/2007/04/23/inherit-expression-for-ie/#comments">27 responses</a></li>
<li></li><li></li></ul>

<div class="text">
<p>
The reset styles are currently held up on a point of non-support in IE/Win.  However, there&#8217;s a decent chance we can work around it.  I&#8217;m hoping you (or someone you know) can help.
</p>
<p>
One of the things I indicated was problematic, but that I would keep, was the use of <code>inherit</code> for a few properties.  This value isn&#8217;t supported by IE/Win, and while I&#8217;m okay with including it anyway, it could cause confusion for others trying to use my reset styles.
</p>
<p>
Priit Pirita suggested the use of IE expressions to simulate inheritance.  For example:
</p>
<pre>
<code> font-style: expression(
   this.parentNode.currentStyle ? 
   this.parentNode.currentStyle.fontStyle : 
   ‘normal’);</code>
</pre>
<p>
That would assign the weight of the parent element for any element whose parent had a <code>currentStyle</code>, and fall back to <code>normal</code> in any case where that wasn&#8217;t true.
</p>
<p>
Cool enough, assuming you&#8217;re okay with using expressions, but there are a couple of wrinkles I haven&#8217;t quite worked out.  The first is this:
</p>
<pre>
<code> font-family: expression(
   this.parentNode.currentStyle ? 
   this.parentNode.currentStyle.fontFamily :
   ‘[...???...]’);</code>
</pre>
<p>
What should be filled in for the <code>[...???...]</code>?  The font family that IE/Win uses by default when first installed?  A null value?  Something else?  I dunno.  Hopefully someone here does.
</p>
<p>
The second problem is that some people have reported errors generated by expressions; see <a href="http://meyerweb.com/eric/thoughts/2007/04/18/reset-reasoning/#comment-135669">this comment by thacker</a> for an example.  Can anyone explain why those errors happen and how to avoid them?
</p>
<p>
The end goal here is not only to come up with <code>inherit</code> equivalents for <code>font-weight</code>, <code>font-style</code>, and <code>font-family</code>, but also to come up with a generic method of simulating <code>inherit</code> for <em>any</em> property.  Doing so would be an enormous boon to developers, so here&#8217;s hoping we can pull together and solve this puzzle.  Thanks!
</p></div>

</div>

</div>
<p style="font-size: 90%; text-align: right; margin-top: 0.5em; padding-top: 0;">(If you care, there's even an <a href="/eric/thoughts/page/2/">archive of previous thoughts</a>...)</p>

</div><div id="extra"><div class="panel" id="archipelago"><h4>Identity Archipelago</h4><ul><li><a href="http://flickr.com/photos/meyerweb/" rel="me">Flickr</a></li><li><a href="http://twitter.com/meyerweb/" rel="me">Twitter</a></li><li><a href="http://dopplr.com/traveller/meyerweb">Dopplr</a></li><li><a href="http://www.linkedin.com/in/meyerweb" rel="me">LinkedIn</a></li><li><a href="http://technorati.com/profile/emeyer" rel="me">Technorati</a></li></ul></div><div class="panel" id="pointers"><h4>Projects Elsewhere</h4><ul><li><a href="http://aneventapart.com/">An Event Apart</a></li><li><a href="http://complexspiral.com/">Complex Spiral Consulting</a></li><li><a href="http://www.webassist.com/go/css/emeyer/">CSS Sculptor</a></li><li><a href="http://css-discuss.org/">css-discuss</a></li><li><a href="http://microformats.org/">Microformats</a></li><li><a href="http://s5project.org/">S5</a></li></ul></div><div class="panel" id="tour"><ul><li><a href="http://fray.com/issue3/"><img src="http://fray.com/images/i3c.gif" alt="Fray Contributor (Issue 3: Sex &amp; Death)" /></a></li><!-- <li><a href="http://www.webassist.com/go/css/emeyer/"><img src="/pix/CS_ad_180x109.jpg" alt="CSS Sculptor for Dreamweaver" style="max-width: 100%;" /></a></li> --></ul></div><div class="panel">
<h4>Recently Tweeted</h4>
<p class="more"><a href="http://twitter.com/meyerweb">see more</a></p>
<p>Fingernickel choo-choo roll. <small>&#8211;tweeted 2 hours, 34 minutes ago</small></p>
</div><div id="sideblog" class="panel">
<h4>Distractions</h4>
<p class="more">
<a href="/eric/thoughts/recent-links/">archive</a>
</p>
<ul>
<li><a href="http://tweetagewasteland.com/2010/03/my-head-is-in-the-cloud/" title="March 18 | &#8220;I sense that my addiction to the realtime stream is only making room for the consumption of a faster stream.&#8221;">My Head is in the Cloud</a> <small>[via <a href="http://daringfireball.net/">John</a>]</small></li>
<li><a href="http://8bitnyc.com/" title="March 17 | All of a sudden I want to establish a mission in Central Park and negotiate with the natives for gold and food.">8-Bit NYC</a></li>
<li><a href="http://www.youtube.com/watch?v=nFicqklGuB0&amp;feature=player_embedded" title="March 12 | Wry comment expressing my appreciation of the creative derivativeness of this video and its uncanny accuracy in mocking common tropes.">Academy Award Winning Movie Trailer</a></li>
<li><a href="http://www.youtube.com/watch?v=414TmP12WAU" title="March 9 | &#8220;Apple juice&#8230; for half price!&#8221;  More like twice PRICELESS.  (Note: If you&#8217;re at work, don your headphones.)">Happy in Paraguay</a> <small>[via <a href="http://unstoppablerobotninja.com/">Ethan</a>]</small></li>
<li><a href="http://www.youtube.com/watch?v=9V5ubAOeOBk&amp;feature=player_embedded" title="February 10 | This is approximately the best thing ever.">U900 -Walk Don&#8217;t Run (Isogabamaware)</a></li>
<li><a href="http://www.456bereastreet.com/archive/201002/sifr_default_css_hides_content_from_at_least_one_screen_reader/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A 456bereastreet %28456 Berea Street%29" title="February 8 | -9999px comes through again, but I really wish we were beyond that kind of thing.">sIFR default CSS hides content from at least one screen reader</a></li>
<li><a href="http://www.macosxhints.com/article.php?story=20100117064356428" title="February 8 | Storing this for future use.">Take a picture with the iSight camera when a folder is opened</a></li>
<li><a href="http://mingle2.com/blog/view/web-developer-mind" title="February 4 | Mostly valid.  (SEE WHAT I DID THERE?)">The Mind of a Web Developer: An Illustrated Diagram</a></li>
<li><a href="http://www.theonion.com/content/news/science_channel_refuses_to_dumb" title="January 28 | &#8220;Punkin Chunkin, for Christ&#8217;s sake&#8230; What more do you people want?&#8221;">Science Channel Refuses To Dumb Down Science Any Further</a></li>
<li><a href="http://www.mailchimp.com/blog/project-omnivore-declassified/" title="January 27 | Sounds like quite a feat.  But I wonder how we&#8217;d feel if Microsoft or Google announced the same kind of thing on their e-mail services.">MailChimp&#8217;s Project Omnivore: Declassified</a></li>
<li><a href="http://www.politifact.com/truth-o-meter/statements/2010/jan/25/carolyn-maloney/congresswoman-says-democratic-presidents-create-mo/" title="January 26 | &#8220;Obviously, luck matters a lot, but when there is a consistent pattern over more than 60 years, it starts to look like more than just luck.&#8221;">Congresswoman says Democratic presidents create more private-sector jobs</a></li>
<li><a href="http://www.ted.com/talks/taylor_mali_what_teachers_make.html" title="January 25 | Truth.">Taylor Mali: What teachers make</a></li>
<li><a href="http://notebook.johnmartz.com/how-websites-work?c=1" title="January 22 | At last, the truth is out and I can stop pretending:  beatific monkeys are what makes it all go.">How websites work</a></li>
</ul>
</div>
<div class="panel" id="advisory">
<div class="guarded">
<a href="http://blogadvisorysystem.com/"><img src="/pix/bas/guarded.png" alt="Blog Advisory System Alert Level: Guarded"></a>
</div>
</div>

<div class="panel" id="excuse">
<h4>The <a href="/feeds/excuse/">excuse of the day</a> is</h4>
<p>packet storms caused by a flock of rogue penguins</p>
</div>

<div class="panel" id="extras">
<h4>Extras</h4>
<ul>
<li><a href="/feeds/">Feeds</a> &#8226;</li>
<li><a href="/eric/faq.html">FAQ</a> &#8226;</li>
<li><a href="/family.html">Family</a></li>
</ul>
</div>

</div>

<div id="navigate">
<h4>Navigation</h4>
<ul id="navlinks">
<li id="archLink"><a href="/eric/thoughts/">Archives</a></li>
<li id="cssLink"><a href="/eric/css/">CSS</a></li>
<li id="toolsLink"><a href="/eric/tools/">Toolbox</a></li>
<li id="writeLink"><a href="/eric/writing.html">Writing</a></li>
<li id="speakLink"><a href="/eric/talks/">Speaking</a></li>
<li id="otherLink"><a href="/other/">Leftovers</a></li>
<li id="aboutsite"><a href="/ui/about.html">About this site</a></li>
</ul>
</div>

<div id="footer">
<p class="sosumi">All contents of this site, unless otherwise noted, are &copy;1995-2008 <strong>Eric A. and Kathryn S. Meyer</strong>.  All Rights Reserved.</p>
<p>"<a href="/eric/thoughts/">Thoughts From Eric</a>" is powered by the &uuml;bercool <a href="http://wordpress.org/">WordPress</a></p>
</div>
</body>
</html>
