<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[165761] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/165761">165761</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2014-03-17 14:36:43 -0700 (Mon, 17 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac] Rewrite WebHTMLConverter::_computedStringForNode in C++
https://bugs.webkit.org/show_bug.cgi?id=130274

Reviewed by Andreas Kling.

Rewrote WebHTMLConverter::_computedStringForNode as HTMLConverterCaches::propertyValueForNode.

* platform/mac/HTMLConverter.h: Removed unused caches.
* platform/mac/HTMLConverter.mm:
(HTMLConverterCaches::computedStylePropertyForElement): Added use const String&amp; instead of String&amp; on property name.
(HTMLConverterCaches::inlineStylePropertyForElement): Ditto.
(HTMLConverterCaches::propertyValueForNode): Renamed and rewritten from _computedStringForNode.
(-[WebHTMLConverter _stringForNode:property:]): Simply return the computed value instead of storing it in the cache
now that the computing the value is fast.
(-[WebHTMLConverter dealloc]):
(-[WebHTMLConverter init]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformmacHTMLConverterh">trunk/Source/WebCore/platform/mac/HTMLConverter.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacHTMLConvertermm">trunk/Source/WebCore/platform/mac/HTMLConverter.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165760 => 165761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-17 21:33:47 UTC (rev 165760)
+++ trunk/Source/WebCore/ChangeLog        2014-03-17 21:36:43 UTC (rev 165761)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-03-17  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        [Mac] Rewrite WebHTMLConverter::_computedStringForNode in C++
+        https://bugs.webkit.org/show_bug.cgi?id=130274
+
+        Reviewed by Andreas Kling.
+
+        Rewrote WebHTMLConverter::_computedStringForNode as HTMLConverterCaches::propertyValueForNode.
+
+        * platform/mac/HTMLConverter.h: Removed unused caches.
+        * platform/mac/HTMLConverter.mm:
+        (HTMLConverterCaches::computedStylePropertyForElement): Added use const String&amp; instead of String&amp; on property name.
+        (HTMLConverterCaches::inlineStylePropertyForElement): Ditto.
+        (HTMLConverterCaches::propertyValueForNode): Renamed and rewritten from _computedStringForNode.
+        (-[WebHTMLConverter _stringForNode:property:]): Simply return the computed value instead of storing it in the cache
+        now that the computing the value is fast.
+        (-[WebHTMLConverter dealloc]):
+        (-[WebHTMLConverter init]):
+
</ins><span class="cx"> 2014-03-17  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unnecessary JSC::Handle null checks in bindings code.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacHTMLConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.h (165760 => 165761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/HTMLConverter.h        2014-03-17 21:33:47 UTC (rev 165760)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.h        2014-03-17 21:36:43 UTC (rev 165761)
</span><span class="lines">@@ -56,8 +56,6 @@
</span><span class="cx">     NSMutableArray *_textTableRows;
</span><span class="cx">     NSMutableArray *_textTableRowArrays;
</span><span class="cx">     NSMutableArray *_textTableRowBackgroundColors;
</span><del>-    NSMutableDictionary *_specifiedStylesForElements;
-    NSMutableDictionary *_stringsForNodes;
</del><span class="cx">     NSMutableDictionary *_floatsForNodes;
</span><span class="cx">     NSMutableDictionary *_colorsForNodes;
</span><span class="cx">     NSMutableDictionary *_attributesForElements;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.mm (165760 => 165761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/HTMLConverter.mm        2014-03-17 21:33:47 UTC (rev 165760)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.mm        2014-03-17 21:36:43 UTC (rev 165761)
</span><span class="lines">@@ -401,9 +401,11 @@
</span><span class="cx"> 
</span><span class="cx"> class HTMLConverterCaches {
</span><span class="cx"> public:
</span><del>-    PassRefPtr&lt;CSSValue&gt; computedStylePropertyForElement(Element&amp;, String&amp;);
-    PassRefPtr&lt;CSSValue&gt; inlineStylePropertyForElement(Element&amp;, String&amp;);
</del><ins>+    String propertyValueForNode(Node&amp;, const String&amp; propertyName);
</ins><span class="cx"> 
</span><ins>+    PassRefPtr&lt;CSSValue&gt; computedStylePropertyForElement(Element&amp;, const String&amp;);
+    PassRefPtr&lt;CSSValue&gt; inlineStylePropertyForElement(Element&amp;, const String&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     HashMap&lt;Element*, std::unique_ptr&lt;ComputedStyleExtractor&gt;&gt; m_computedStyles;
</span><span class="cx"> };
</span><span class="lines">@@ -562,7 +564,7 @@
</span><span class="cx">     return array;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;CSSValue&gt; HTMLConverterCaches::computedStylePropertyForElement(Element&amp; element, String&amp; propertyName)
</del><ins>+PassRefPtr&lt;CSSValue&gt; HTMLConverterCaches::computedStylePropertyForElement(Element&amp; element, const String&amp; propertyName)
</ins><span class="cx"> {
</span><span class="cx">     CSSPropertyID propetyId = cssPropertyID(propertyName);
</span><span class="cx">     if (propetyId == CSSPropertyInvalid)
</span><span class="lines">@@ -575,7 +577,7 @@
</span><span class="cx">     return computedStyle.propertyValue(propetyId);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;CSSValue&gt; HTMLConverterCaches::inlineStylePropertyForElement(Element&amp; element, String&amp; propertyName)
</del><ins>+PassRefPtr&lt;CSSValue&gt; HTMLConverterCaches::inlineStylePropertyForElement(Element&amp; element, const String&amp; propertyName)
</ins><span class="cx"> {
</span><span class="cx">     CSSPropertyID propetyId = cssPropertyID(propertyName);
</span><span class="cx">     if (propetyId == CSSPropertyInvalid || !element.isStyledElement())
</span><span class="lines">@@ -605,131 +607,132 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (NSString *)_computedStringForNode:(DOMNode *)node property:(NSString *)key
</del><ins>+String HTMLConverterCaches::propertyValueForNode(Node&amp; node, const String&amp; propertyName)
</ins><span class="cx"> {
</span><del>-    bool haveResult = false;
-    String result;
-    bool inherit = true;
-    Node* coreNode = core(node);
-    if (coreNode &amp;&amp; coreNode-&gt;isElementNode()) {
-        Element&amp; element = toElement(*coreNode);
-        String propertyName = key;
-        inherit = false;
-        if (!haveResult) {
-            if (RefPtr&lt;CSSValue&gt; value = _caches-&gt;computedStylePropertyForElement(element, propertyName))
-                haveResult = stringFromCSSValue(*value, result);
-        }
-        if (!haveResult) {
-            if (RefPtr&lt;CSSValue&gt; value = _caches-&gt;computedStylePropertyForElement(element, propertyName)) {
-                if (value-&gt;isInheritedValue())
-                    inherit = true;
-                else
-                    haveResult = stringFromCSSValue(*value, result);
-            }
-        }
-        Element* coreElement = &amp;element;
-        if (!haveResult) {
-            if ([@&quot;display&quot; isEqualToString:key]) {
-                if (coreElement-&gt;hasTagName(headTag) || coreElement-&gt;hasTagName(scriptTag) || coreElement-&gt;hasTagName(appletTag) || coreElement-&gt;hasTagName(noframesTag))
-                    result = &quot;none&quot;;
-                else if (coreElement-&gt;hasTagName(addressTag) || coreElement-&gt;hasTagName(blockquoteTag) || coreElement-&gt;hasTagName(bodyTag) || coreElement-&gt;hasTagName(centerTag)
-                         || coreElement-&gt;hasTagName(ddTag) || coreElement-&gt;hasTagName(dirTag) || coreElement-&gt;hasTagName(divTag) || coreElement-&gt;hasTagName(dlTag)
-                         || coreElement-&gt;hasTagName(dtTag) || coreElement-&gt;hasTagName(fieldsetTag) || coreElement-&gt;hasTagName(formTag) || coreElement-&gt;hasTagName(frameTag)
-                         || coreElement-&gt;hasTagName(framesetTag) || coreElement-&gt;hasTagName(hrTag) || coreElement-&gt;hasTagName(htmlTag) || coreElement-&gt;hasTagName(h1Tag)
-                         || coreElement-&gt;hasTagName(h2Tag) || coreElement-&gt;hasTagName(h3Tag) || coreElement-&gt;hasTagName(h4Tag) || coreElement-&gt;hasTagName(h5Tag)
-                         || coreElement-&gt;hasTagName(h6Tag) || coreElement-&gt;hasTagName(iframeTag) || coreElement-&gt;hasTagName(menuTag) || coreElement-&gt;hasTagName(noscriptTag)
-                         || coreElement-&gt;hasTagName(olTag) || coreElement-&gt;hasTagName(pTag) || coreElement-&gt;hasTagName(preTag) || coreElement-&gt;hasTagName(ulTag))
-                    result = &quot;block&quot;;
-                else if (coreElement-&gt;hasTagName(liTag))
-                    result = &quot;list-item&quot;;
-                else if (coreElement-&gt;hasTagName(tableTag))
-                    result = &quot;table&quot;;
-                else if (coreElement-&gt;hasTagName(trTag))
-                    result = &quot;table-row&quot;;
-                else if (coreElement-&gt;hasTagName(thTag) || coreElement-&gt;hasTagName(tdTag))
-                    result = &quot;table-cell&quot;;
-                else if (coreElement-&gt;hasTagName(theadTag))
-                    result = &quot;table-header-group&quot;;
-                else if (coreElement-&gt;hasTagName(tbodyTag))
-                    result = &quot;table-row-group&quot;;
-                else if (coreElement-&gt;hasTagName(tfootTag))
-                    result = &quot;table-footer-group&quot;;
-                else if (coreElement-&gt;hasTagName(colTag))
-                    result = &quot;table-column&quot;;
-                else if (coreElement-&gt;hasTagName(colgroupTag))
-                    result = &quot;table-column-group&quot;;
-                else if (coreElement-&gt;hasTagName(captionTag))
-                    result = &quot;table-caption&quot;;
-            } else if ([@&quot;white-space&quot; isEqualToString:key]) {
-                if (coreElement-&gt;hasTagName(preTag))
-                    result = &quot;pre&quot;;
-                else
-                    inherit = YES;
-            } else if ([@&quot;font-style&quot; isEqualToString:key]) {
-                if (coreElement-&gt;hasTagName(iTag) || coreElement-&gt;hasTagName(citeTag) || coreElement-&gt;hasTagName(emTag) || coreElement-&gt;hasTagName(varTag) || coreElement-&gt;hasTagName(addressTag))
-                    result = &quot;italic&quot;;
-                else
-                    inherit = YES;
-            } else if ([@&quot;font-weight&quot; isEqualToString:key]) {
-                if (coreElement-&gt;hasTagName(bTag) || coreElement-&gt;hasTagName(strongTag) || coreElement-&gt;hasTagName(thTag))
-                    result = &quot;bolder&quot;;
-                else
-                    inherit = YES;
-            } else if ([@&quot;text-decoration&quot; isEqualToString:key]) {
-                if (coreElement-&gt;hasTagName(uTag) || coreElement-&gt;hasTagName(insTag))
-                    result = &quot;underline&quot;;
-                else if (coreElement-&gt;hasTagName(sTag) || coreElement-&gt;hasTagName(strikeTag) || coreElement-&gt;hasTagName(delTag))
-                    result = &quot;line-through&quot;;
-                else
-                    inherit = YES; // ??? this is not strictly correct
-            } else if ([@&quot;text-align&quot; isEqualToString:key]) {
-                if (coreElement-&gt;hasTagName(centerTag) || coreElement-&gt;hasTagName(captionTag) || coreElement-&gt;hasTagName(thTag))
-                    result = &quot;center&quot;;
-                else
-                    inherit = YES;
-            } else if ([@&quot;vertical-align&quot; isEqualToString:key]) {
-                if (coreElement-&gt;hasTagName(supTag))
-                    result = &quot;super&quot;;
-                else if (coreElement-&gt;hasTagName(subTag))
-                    result = &quot;sub&quot;;
-                else if (coreElement-&gt;hasTagName(theadTag) || coreElement-&gt;hasTagName(tbodyTag) || coreElement-&gt;hasTagName(tfootTag))
-                    result = &quot;middle&quot;;
-                else if (coreElement-&gt;hasTagName(trTag) || coreElement-&gt;hasTagName(thTag) || coreElement-&gt;hasTagName(tdTag))
-                    inherit = YES;
-            } else if ([@&quot;font-family&quot; isEqualToString:key] || [@&quot;font-variant&quot; isEqualToString:key] || [@&quot;font-effect&quot; isEqualToString:key]
-                       || [@&quot;text-transform&quot; isEqualToString:key] || [@&quot;text-shadow&quot; isEqualToString:key] || [@&quot;visibility&quot; isEqualToString:key]
-                       || [@&quot;border-collapse&quot; isEqualToString:key] || [@&quot;empty-cells&quot; isEqualToString:key] || [@&quot;word-spacing&quot; isEqualToString:key]
-                       || [@&quot;list-style-type&quot; isEqualToString:key] || [@&quot;direction&quot; isEqualToString:key]) {
-                inherit = YES;
-            }
-        }
</del><ins>+    if (!node.isElementNode()) {
+        if (Node* parent = node.parentNode())
+            return propertyValueForNode(*parent, propertyName);
+        return String();
</ins><span class="cx">     }
</span><del>-    if (!haveResult &amp;&amp; inherit) {
-        DOMNode *parentNode = [node parentNode];
-        if (parentNode)
-            return [self _stringForNode:parentNode property:key];
</del><ins>+
+    bool inherit = false;
+    Element&amp; element = toElement(node);
+    if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyName)) {
+        String result;
+        if (stringFromCSSValue(*value, result))
+            return result;
</ins><span class="cx">     }
</span><del>-    if (haveResult)
-        return result.lower();
-    return nil;
</del><ins>+
+    if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyName)) {
+        String result;
+        if (value-&gt;isInheritedValue())
+            inherit = true;
+        else if (stringFromCSSValue(*value, result))
+            return result;
+    }
+
+    switch (cssPropertyID(propertyName)) {
+    case CSSPropertyDisplay:
+        if (element.hasTagName(headTag) || element.hasTagName(scriptTag) || element.hasTagName(appletTag) || element.hasTagName(noframesTag))
+            return &quot;none&quot;;
+        else if (element.hasTagName(addressTag) || element.hasTagName(blockquoteTag) || element.hasTagName(bodyTag) || element.hasTagName(centerTag)
+             || element.hasTagName(ddTag) || element.hasTagName(dirTag) || element.hasTagName(divTag) || element.hasTagName(dlTag)
+             || element.hasTagName(dtTag) || element.hasTagName(fieldsetTag) || element.hasTagName(formTag) || element.hasTagName(frameTag)
+             || element.hasTagName(framesetTag) || element.hasTagName(hrTag) || element.hasTagName(htmlTag) || element.hasTagName(h1Tag)
+             || element.hasTagName(h2Tag) || element.hasTagName(h3Tag) || element.hasTagName(h4Tag) || element.hasTagName(h5Tag)
+             || element.hasTagName(h6Tag) || element.hasTagName(iframeTag) || element.hasTagName(menuTag) || element.hasTagName(noscriptTag)
+             || element.hasTagName(olTag) || element.hasTagName(pTag) || element.hasTagName(preTag) || element.hasTagName(ulTag))
+            return &quot;block&quot;;
+        else if (element.hasTagName(liTag))
+            return &quot;list-item&quot;;
+        else if (element.hasTagName(tableTag))
+            return &quot;table&quot;;
+        else if (element.hasTagName(trTag))
+            return &quot;table-row&quot;;
+        else if (element.hasTagName(thTag) || element.hasTagName(tdTag))
+            return &quot;table-cell&quot;;
+        else if (element.hasTagName(theadTag))
+            return &quot;table-header-group&quot;;
+        else if (element.hasTagName(tbodyTag))
+            return &quot;table-row-group&quot;;
+        else if (element.hasTagName(tfootTag))
+            return &quot;table-footer-group&quot;;
+        else if (element.hasTagName(colTag))
+            return &quot;table-column&quot;;
+        else if (element.hasTagName(colgroupTag))
+            return &quot;table-column-group&quot;;
+        else if (element.hasTagName(captionTag))
+            return &quot;table-caption&quot;;
+        break;
+    case CSSPropertyWhiteSpace:
+        if (element.hasTagName(preTag))
+            return &quot;pre&quot;;
+        inherit = true;
+        break;
+    case CSSPropertyFontStyle:
+        if (element.hasTagName(iTag) || element.hasTagName(citeTag) || element.hasTagName(emTag) || element.hasTagName(varTag) || element.hasTagName(addressTag))
+            return &quot;italic&quot;;
+        inherit = true;
+        break;
+    case CSSPropertyFontWeight:
+        if (element.hasTagName(bTag) || element.hasTagName(strongTag) || element.hasTagName(thTag))
+            return &quot;bolder&quot;;
+        inherit = true;
+        break;
+    case CSSPropertyTextDecoration:
+        if (element.hasTagName(uTag) || element.hasTagName(insTag))
+            return &quot;underline&quot;;
+        else if (element.hasTagName(sTag) || element.hasTagName(strikeTag) || element.hasTagName(delTag))
+            return &quot;line-through&quot;;
+        inherit = true; // FIXME: This is not strictly correct
+        break;
+    case CSSPropertyTextAlign:
+        if (element.hasTagName(centerTag) || element.hasTagName(captionTag) || element.hasTagName(thTag))
+            return &quot;center&quot;;
+        inherit = true;
+        break;
+    case CSSPropertyVerticalAlign:
+        if (element.hasTagName(supTag))
+            return &quot;super&quot;;
+        else if (element.hasTagName(subTag))
+            return &quot;sub&quot;;
+        else if (element.hasTagName(theadTag) || element.hasTagName(tbodyTag) || element.hasTagName(tfootTag))
+            return &quot;middle&quot;;
+        else if (element.hasTagName(trTag) || element.hasTagName(thTag) || element.hasTagName(tdTag))
+            inherit = true;
+        break;
+    case CSSPropertyFontFamily:
+    case CSSPropertyFontVariant:
+    case CSSPropertyTextTransform:
+    case CSSPropertyTextShadow:
+    case CSSPropertyVisibility:
+    case CSSPropertyBorderCollapse:
+    case CSSPropertyEmptyCells:
+    case CSSPropertyWordSpacing:
+    case CSSPropertyListStyleType:
+    case CSSPropertyDirection:
+        inherit = true; // FIXME: Let classes in the css component figure this out.
+        break;
+    default:
+        break;
+    }
+
+    if (inherit) {
+        if (Node* parent = node.parentNode())
+            return propertyValueForNode(*parent, propertyName);
+    }
+    
+    return String();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSString *)_stringForNode:(DOMNode *)node property:(NSString *)key
</span><span class="cx"> {
</span><del>-    NSString *result = nil;
-    RetainPtr&lt;NSMutableDictionary&gt; attributeDictionary = [_stringsForNodes objectForKey:node];
-    if (!attributeDictionary) {
-        attributeDictionary = adoptNS([[NSMutableDictionary alloc] init]);
-        [_stringsForNodes setObject:attributeDictionary.get() forKey:node];
-    }
-    result = [attributeDictionary objectForKey:key];
-    if (result) {
-        if ([result isEqualToString:@&quot;&quot;])
-            result = nil;
-    } else {
-        result = [self _computedStringForNode:node property:key];
-        [attributeDictionary setObject:(result ? result : @&quot;&quot;) forKey:key];
-    }
</del><ins>+    Node* coreNode = core(node);
+    if (!coreNode)
+        return nil;
+    String result = _caches-&gt;propertyValueForNode(*coreNode, String(key));
+    if (!result.length())
+        return nil;
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2420,8 +2423,6 @@
</span><span class="cx">     [_textTableRows release];
</span><span class="cx">     [_textTableRowArrays release];
</span><span class="cx">     [_textTableRowBackgroundColors release];
</span><del>-    [_specifiedStylesForElements release];
-    [_stringsForNodes release];
</del><span class="cx">     [_floatsForNodes release];
</span><span class="cx">     [_colorsForNodes release];
</span><span class="cx">     [_attributesForElements release];
</span><span class="lines">@@ -2449,8 +2450,6 @@
</span><span class="cx">     _textTableRows = [[NSMutableArray alloc] init];
</span><span class="cx">     _textTableRowArrays = [[NSMutableArray alloc] init];
</span><span class="cx">     _textTableRowBackgroundColors = [[NSMutableArray alloc] init];
</span><del>-    _specifiedStylesForElements = [[NSMutableDictionary alloc] init];
-    _stringsForNodes = [[NSMutableDictionary alloc] init];
</del><span class="cx">     _floatsForNodes = [[NSMutableDictionary alloc] init];
</span><span class="cx">     _colorsForNodes = [[NSMutableDictionary alloc] init];
</span><span class="cx">     _attributesForElements = [[NSMutableDictionary alloc] init];
</span></span></pre>
</div>
</div>

</body>
</html>