<!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>[166118] 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/166118">166118</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2014-03-22 11:01:20 -0700 (Sat, 22 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Switch HTMLConverter to use CSSPropertyIDs to refer to CSS properties
https://bugs.webkit.org/show_bug.cgi?id=130639

Reviewed by Simon Fraser.

This is a ~15% speedup on PerformanceTests/Interactive/CopyAll.html.

- Removes gratuitous lookup of CSS properties that are known at compile time.
- Removes attempted use of non-supported CSS properties (font-effect and horizontal-align) 
  that will alway yield the same results.
- Fix some obvious typos where the author thought they were testing for fontKerning or fontLigatures
  but instead used the non-existent font-effect.

* platform/mac/HTMLConverter.mm:
(HTMLConverterCaches::computedStylePropertyForElement):
(HTMLConverterCaches::inlineStylePropertyForElement):
(HTMLConverterCaches::propertyValueForNode):
(-[WebHTMLConverter _stringForNode:property:]):
(HTMLConverterCaches::floatPropertyValueForNode):
(-[WebHTMLConverter _getFloat:forNode:property:]):
(HTMLConverterCaches::isBlockElement):
(HTMLConverterCaches::elementHasOwnBackgroundColor):
(HTMLConverterCaches::colorPropertyValueForNode):
(-[WebHTMLConverter _colorForNode:property:]):
(-[WebHTMLConverter _computedAttributesForElement:]):
(-[WebHTMLConverter _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
(-[WebHTMLConverter _fillInBlock:forElement:backgroundColor:extraMargin:extraPadding:isTable:]):
(-[WebHTMLConverter _addTableForElement:]):
(-[WebHTMLConverter _addTableCellForElement:]):
(-[WebHTMLConverter _processElement:tag:display:depth:]):
(-[WebHTMLConverter _exitElement:tag:display:depth:startIndex:]):
(-[WebHTMLConverter _processText:]):
(-[WebHTMLConverter _traverseNode:depth:embedded:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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 (166117 => 166118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-22 17:52:14 UTC (rev 166117)
+++ trunk/Source/WebCore/ChangeLog        2014-03-22 18:01:20 UTC (rev 166118)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2014-03-22  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Switch HTMLConverter to use CSSPropertyIDs to refer to CSS properties
+        https://bugs.webkit.org/show_bug.cgi?id=130639
+
+        Reviewed by Simon Fraser.
+
+        This is a ~15% speedup on PerformanceTests/Interactive/CopyAll.html.
+
+        - Removes gratuitous lookup of CSS properties that are known at compile time.
+        - Removes attempted use of non-supported CSS properties (font-effect and horizontal-align) 
+          that will alway yield the same results.
+        - Fix some obvious typos where the author thought they were testing for fontKerning or fontLigatures
+          but instead used the non-existent font-effect.
+
+        * platform/mac/HTMLConverter.mm:
+        (HTMLConverterCaches::computedStylePropertyForElement):
+        (HTMLConverterCaches::inlineStylePropertyForElement):
+        (HTMLConverterCaches::propertyValueForNode):
+        (-[WebHTMLConverter _stringForNode:property:]):
+        (HTMLConverterCaches::floatPropertyValueForNode):
+        (-[WebHTMLConverter _getFloat:forNode:property:]):
+        (HTMLConverterCaches::isBlockElement):
+        (HTMLConverterCaches::elementHasOwnBackgroundColor):
+        (HTMLConverterCaches::colorPropertyValueForNode):
+        (-[WebHTMLConverter _colorForNode:property:]):
+        (-[WebHTMLConverter _computedAttributesForElement:]):
+        (-[WebHTMLConverter _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
+        (-[WebHTMLConverter _fillInBlock:forElement:backgroundColor:extraMargin:extraPadding:isTable:]):
+        (-[WebHTMLConverter _addTableForElement:]):
+        (-[WebHTMLConverter _addTableCellForElement:]):
+        (-[WebHTMLConverter _processElement:tag:display:depth:]):
+        (-[WebHTMLConverter _exitElement:tag:display:depth:startIndex:]):
+        (-[WebHTMLConverter _processText:]):
+        (-[WebHTMLConverter _traverseNode:depth:embedded:]):
+
</ins><span class="cx"> 2014-03-21  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Don't flush compositing layers within FrameView::willPaintContents()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.mm (166117 => 166118)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/HTMLConverter.mm        2014-03-22 17:52:14 UTC (rev 166117)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.mm        2014-03-22 18:01:20 UTC (rev 166118)
</span><span class="lines">@@ -401,15 +401,15 @@
</span><span class="cx"> 
</span><span class="cx"> class HTMLConverterCaches {
</span><span class="cx"> public:
</span><del>-    String propertyValueForNode(Node&amp;, const String&amp; propertyName);
-    bool floatPropertyValueForNode(Node&amp;, const String&amp; propertyName, float&amp;);
-    Color colorPropertyValueForNode(Node&amp;, const String&amp; propertyName);
</del><ins>+    String propertyValueForNode(Node&amp;, CSSPropertyID );
+    bool floatPropertyValueForNode(Node&amp;, CSSPropertyID, float&amp;);
+    Color colorPropertyValueForNode(Node&amp;, CSSPropertyID);
</ins><span class="cx"> 
</span><span class="cx">     bool isBlockElement(Element&amp;);
</span><span class="cx">     bool elementHasOwnBackgroundColor(Element&amp;);
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;CSSValue&gt; computedStylePropertyForElement(Element&amp;, const String&amp;);
-    PassRefPtr&lt;CSSValue&gt; inlineStylePropertyForElement(Element&amp;, const String&amp;);
</del><ins>+    PassRefPtr&lt;CSSValue&gt; computedStylePropertyForElement(Element&amp;, CSSPropertyID);
+    PassRefPtr&lt;CSSValue&gt; inlineStylePropertyForElement(Element&amp;, CSSPropertyID);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HashMap&lt;Element*, std::unique_ptr&lt;ComputedStyleExtractor&gt;&gt; m_computedStyles;
</span><span class="lines">@@ -430,9 +430,10 @@
</span><span class="cx"> 
</span><span class="cx"> @interface WebHTMLConverter(WebHTMLConverterInternal)
</span><span class="cx"> 
</span><del>-- (NSString *)_stringForNode:(DOMNode *)node property:(NSString *)key;
-- (PlatformColor *)_colorForNode:(DOMNode *)node property:(NSString *)key;
-- (BOOL)_getFloat:(CGFloat *)val forNode:(DOMNode *)node property:(NSString *)key;
</del><ins>+- (NSString *)_stringForNode:(DOMNode *)node property:(CSSPropertyID)propertyId;
+- (PlatformColor *)_colorForNode:(DOMNode *)node property:(CSSPropertyID)propertyId;
+- (BOOL)_getFloat:(CGFloat *)val forNode:(DOMNode *)node property:(CSSPropertyID)propertyId;
+
</ins><span class="cx"> - (void)_traverseNode:(DOMNode *)node depth:(NSInteger)depth embedded:(BOOL)embedded;
</span><span class="cx"> - (void)_traverseFooterNode:(DOMNode *)node depth:(NSInteger)depth;
</span><span class="cx"> 
</span><span class="lines">@@ -569,28 +570,26 @@
</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, const String&amp; propertyName)
</del><ins>+PassRefPtr&lt;CSSValue&gt; HTMLConverterCaches::computedStylePropertyForElement(Element&amp; element, CSSPropertyID propertyId)
</ins><span class="cx"> {
</span><del>-    CSSPropertyID propetyId = cssPropertyID(propertyName);
-    if (propetyId == CSSPropertyInvalid)
</del><ins>+    if (propertyId == CSSPropertyInvalid)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     auto result = m_computedStyles.add(&amp;element, nullptr);
</span><span class="cx">     if (result.isNewEntry)
</span><span class="cx">         result.iterator-&gt;value = std::make_unique&lt;ComputedStyleExtractor&gt;(&amp;element, true);
</span><span class="cx">     ComputedStyleExtractor&amp; computedStyle = *result.iterator-&gt;value;
</span><del>-    return computedStyle.propertyValue(propetyId);
</del><ins>+    return computedStyle.propertyValue(propertyId);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;CSSValue&gt; HTMLConverterCaches::inlineStylePropertyForElement(Element&amp; element, const String&amp; propertyName)
</del><ins>+PassRefPtr&lt;CSSValue&gt; HTMLConverterCaches::inlineStylePropertyForElement(Element&amp; element, CSSPropertyID propertyId)
</ins><span class="cx"> {
</span><del>-    CSSPropertyID propetyId = cssPropertyID(propertyName);
-    if (propetyId == CSSPropertyInvalid || !element.isStyledElement())
</del><ins>+    if (propertyId == CSSPropertyInvalid || !element.isStyledElement())
</ins><span class="cx">         return nullptr;
</span><span class="cx">     const StyleProperties* properties = toStyledElement(element).inlineStyle();
</span><span class="cx">     if (!properties)
</span><span class="cx">         return nullptr;
</span><del>-    return properties-&gt;getPropertyCSSValue(propetyId);
</del><ins>+    return properties-&gt;getPropertyCSSValue(propertyId);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool stringFromCSSValue(CSSValue&amp; value, String&amp; result)
</span><span class="lines">@@ -612,23 +611,23 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String HTMLConverterCaches::propertyValueForNode(Node&amp; node, const String&amp; propertyName)
</del><ins>+String HTMLConverterCaches::propertyValueForNode(Node&amp; node, CSSPropertyID propertyId)
</ins><span class="cx"> {
</span><span class="cx">     if (!node.isElementNode()) {
</span><span class="cx">         if (Node* parent = node.parentNode())
</span><del>-            return propertyValueForNode(*parent, propertyName);
</del><ins>+            return propertyValueForNode(*parent, propertyId);
</ins><span class="cx">         return String();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool inherit = false;
</span><span class="cx">     Element&amp; element = toElement(node);
</span><del>-    if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyName)) {
</del><ins>+    if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</ins><span class="cx">         String result;
</span><span class="cx">         if (stringFromCSSValue(*value, result))
</span><span class="cx">             return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyName)) {
</del><ins>+    if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyId)) {
</ins><span class="cx">         String result;
</span><span class="cx">         if (value-&gt;isInheritedValue())
</span><span class="cx">             inherit = true;
</span><span class="lines">@@ -636,7 +635,7 @@
</span><span class="cx">             return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    switch (cssPropertyID(propertyName)) {
</del><ins>+    switch (propertyId) {
</ins><span class="cx">     case CSSPropertyDisplay:
</span><span class="cx">         if (element.hasTagName(headTag) || element.hasTagName(scriptTag) || element.hasTagName(appletTag) || element.hasTagName(noframesTag))
</span><span class="cx">             return &quot;none&quot;;
</span><span class="lines">@@ -724,18 +723,18 @@
</span><span class="cx"> 
</span><span class="cx">     if (inherit) {
</span><span class="cx">         if (Node* parent = node.parentNode())
</span><del>-            return propertyValueForNode(*parent, propertyName);
</del><ins>+            return propertyValueForNode(*parent, propertyId);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (NSString *)_stringForNode:(DOMNode *)node property:(NSString *)key
</del><ins>+- (NSString *)_stringForNode:(DOMNode *)node property:(CSSPropertyID)propertyId
</ins><span class="cx"> {
</span><span class="cx">     Node* coreNode = core(node);
</span><span class="cx">     if (!coreNode)
</span><span class="cx">         return nil;
</span><del>-    String result = _caches-&gt;propertyValueForNode(*coreNode, String(key));
</del><ins>+    String result = _caches-&gt;propertyValueForNode(*coreNode, propertyId);
</ins><span class="cx">     if (!result.length())
</span><span class="cx">         return nil;
</span><span class="cx">     return result;
</span><span class="lines">@@ -768,29 +767,29 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool HTMLConverterCaches::floatPropertyValueForNode(Node&amp; node, const String&amp; propertyName, float&amp; result)
</del><ins>+bool HTMLConverterCaches::floatPropertyValueForNode(Node&amp; node, CSSPropertyID propertyId, float&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     if (!node.isElementNode()) {
</span><span class="cx">         if (ContainerNode* parent = node.parentNode())
</span><del>-            return floatPropertyValueForNode(*parent, propertyName, result);
</del><ins>+            return floatPropertyValueForNode(*parent, propertyId, result);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Element&amp; element = toElement(node);
</span><del>-    if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyName)) {
</del><ins>+    if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</ins><span class="cx">         if (value-&gt;isPrimitiveValue() &amp;&amp; floatValueFromPrimitiveValue(toCSSPrimitiveValue(*value), result))
</span><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool inherit = false;
</span><del>-    if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyName)) {
</del><ins>+    if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyId)) {
</ins><span class="cx">         if (value-&gt;isPrimitiveValue() &amp;&amp; floatValueFromPrimitiveValue(toCSSPrimitiveValue(*value), result))
</span><span class="cx">             return true;
</span><span class="cx">         if (value-&gt;isInheritedValue())
</span><span class="cx">             inherit = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    switch (cssPropertyID(propertyName)) {
</del><ins>+    switch (propertyId) {
</ins><span class="cx">     case CSSPropertyTextIndent:
</span><span class="cx">     case CSSPropertyLetterSpacing:
</span><span class="cx">     case CSSPropertyWordSpacing:
</span><span class="lines">@@ -805,19 +804,19 @@
</span><span class="cx"> 
</span><span class="cx">     if (inherit) {
</span><span class="cx">         if (ContainerNode* parent = node.parentNode())
</span><del>-            return floatPropertyValueForNode(*parent, propertyName, result);
</del><ins>+            return floatPropertyValueForNode(*parent, propertyId, result);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (BOOL)_getFloat:(CGFloat *)val forNode:(DOMNode *)node property:(NSString *)key
</del><ins>+- (BOOL)_getFloat:(CGFloat *)val forNode:(DOMNode *)node property:(CSSPropertyID)propertyId
</ins><span class="cx"> {
</span><span class="cx">     Node* coreNode = core(node);
</span><span class="cx">     if (!coreNode)
</span><span class="cx">         return NO;
</span><span class="cx">     float result;
</span><del>-    if (!_caches-&gt;floatPropertyValueForNode(*coreNode, String(key), result))
</del><ins>+    if (!_caches-&gt;floatPropertyValueForNode(*coreNode, propertyId, result))
</ins><span class="cx">         return NO;
</span><span class="cx">     if (val)
</span><span class="cx">         *val = result;
</span><span class="lines">@@ -911,10 +910,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool HTMLConverterCaches::isBlockElement(Element&amp; element)
</span><span class="cx"> {
</span><del>-    String displayValue = propertyValueForNode(element, &quot;display&quot;);
</del><ins>+    String displayValue = propertyValueForNode(element, CSSPropertyDisplay);
</ins><span class="cx">     if (displayValue == &quot;block&quot; || displayValue == &quot;list-item&quot; || displayValue.startsWith(&quot;table&quot;))
</span><span class="cx">         return true;
</span><del>-    String floatValue = propertyValueForNode(element, &quot;float&quot;);
</del><ins>+    String floatValue = propertyValueForNode(element, CSSPropertyFloat);
</ins><span class="cx">     if (floatValue == &quot;left&quot; || floatValue == &quot;right&quot;)
</span><span class="cx">         return true;
</span><span class="cx">     return false;
</span><span class="lines">@@ -926,7 +925,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     // In the text system, text blocks (table elements) and documents (body elements)
</span><span class="cx">     // have their own background colors, which should not be inherited.
</span><del>-    return element.hasTagName(htmlTag) || element.hasTagName(bodyTag) || propertyValueForNode(element, &quot;display&quot;).startsWith(&quot;table&quot;);
</del><ins>+    return element.hasTagName(htmlTag) || element.hasTagName(bodyTag) || propertyValueForNode(element, CSSPropertyDisplay).startsWith(&quot;table&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_elementIsBlockLevel:(DOMElement *)element
</span><span class="lines">@@ -961,29 +960,29 @@
</span><span class="cx">     return color;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Color HTMLConverterCaches::colorPropertyValueForNode(Node&amp; node, const String&amp; propertyName)
</del><ins>+Color HTMLConverterCaches::colorPropertyValueForNode(Node&amp; node, CSSPropertyID propertyId)
</ins><span class="cx"> {
</span><span class="cx">     if (!node.isElementNode()) {
</span><span class="cx">         if (Node* parent = node.parentNode())
</span><del>-            return colorPropertyValueForNode(*parent, propertyName);
</del><ins>+            return colorPropertyValueForNode(*parent, propertyId);
</ins><span class="cx">         return Color();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Element&amp; element = toElement(node);
</span><del>-    if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyName)) {
</del><ins>+    if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</ins><span class="cx">         if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(*value).isRGBColor())
</span><del>-            return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyName == &quot;color&quot;);
</del><ins>+            return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool inherit = false;
</span><del>-    if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyName)) {
</del><ins>+    if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyId)) {
</ins><span class="cx">         if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(*value).isRGBColor())
</span><del>-            return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyName == &quot;color&quot;);
</del><ins>+            return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</ins><span class="cx">         if (value-&gt;isInheritedValue())
</span><span class="cx">             inherit = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    switch (cssPropertyID(propertyName)) {
</del><ins>+    switch (propertyId) {
</ins><span class="cx">     case CSSPropertyColor:
</span><span class="cx">         inherit = true;
</span><span class="cx">         break;
</span><span class="lines">@@ -1001,18 +1000,18 @@
</span><span class="cx"> 
</span><span class="cx">     if (inherit) {
</span><span class="cx">         if (Node* parent = node.parentNode())
</span><del>-            return colorPropertyValueForNode(*parent, propertyName);
</del><ins>+            return colorPropertyValueForNode(*parent, propertyId);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return Color();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (PlatformColor *)_colorForNode:(DOMNode *)node property:(NSString *)key
</del><ins>+- (PlatformColor *)_colorForNode:(DOMNode *)node property:(CSSPropertyID)propertyId
</ins><span class="cx"> {
</span><span class="cx">     Node* coreNode = core(node);
</span><span class="cx">     if (!coreNode)
</span><span class="cx">         return nil;
</span><del>-    Color result = _caches-&gt;colorPropertyValueForNode(*coreNode, String(key));
</del><ins>+    Color result = _caches-&gt;colorPropertyValueForNode(*coreNode, propertyId);
</ins><span class="cx">     if (!result.isValid())
</span><span class="cx">         return nil;
</span><span class="cx">     PlatformColor *platformResult = _platformColor(result);
</span><span class="lines">@@ -1030,23 +1029,22 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     NSFontManager *fontManager = [NSFontManager sharedFontManager];
</span><span class="cx"> #endif
</span><del>-    NSString *fontEffect = [self _stringForNode:element property:@&quot;font-effect&quot;];
-    NSString *textDecoration = [self _stringForNode:element property:@&quot;text-decoration&quot;];
-    NSString *verticalAlign = [self _stringForNode:element property:@&quot;vertical-align&quot;];
-    NSString *textShadow = [self _stringForNode:element property:@&quot;text-shadow&quot;];
-    NSString *fontLigatures = [self _stringForNode:element property:@&quot;font-variant-ligatures&quot;];
-    NSString *fontKerning = [self _stringForNode:element property:@&quot;font-kerning&quot;];
-    NSString *letterSpacing = [self _stringForNode:element property:@&quot;letter-spacing&quot;];
</del><ins>+    NSString *textDecoration = [self _stringForNode:element property:CSSPropertyTextDecoration];
+    NSString *verticalAlign = [self _stringForNode:element property:CSSPropertyVerticalAlign];
+    NSString *textShadow = [self _stringForNode:element property:CSSPropertyTextShadow];
+    NSString *fontLigatures = [self _stringForNode:element property:CSSPropertyWebkitFontVariantLigatures];
+    NSString *fontKerning = [self _stringForNode:element property:CSSPropertyWebkitFontKerning];
+    NSString *letterSpacing = [self _stringForNode:element property:CSSPropertyLetterSpacing];
</ins><span class="cx">     CGFloat fontSize = 0;
</span><span class="cx">     CGFloat baselineOffset = 0;
</span><span class="cx">     CGFloat strokeWidth = 0.0;
</span><span class="cx">     PlatformFont *font = nil;
</span><span class="cx">     PlatformFont *actualFont = (PlatformFont *)[element _font];
</span><del>-    PlatformColor *foregroundColor = [self _colorForNode:element property:@&quot;color&quot;];
-    PlatformColor *backgroundColor = [self _colorForNode:element property:@&quot;background-color&quot;];
-    PlatformColor *strokeColor = [self _colorForNode:element property:@&quot;-webkit-text-stroke-color&quot;];
</del><ins>+    PlatformColor *foregroundColor = [self _colorForNode:element property:CSSPropertyColor];
+    PlatformColor *backgroundColor = [self _colorForNode:element property:CSSPropertyBackgroundColor];
+    PlatformColor *strokeColor = [self _colorForNode:element property:CSSPropertyWebkitTextStrokeColor];
</ins><span class="cx"> 
</span><del>-    if (![self _getFloat:&amp;fontSize forNode:element property:@&quot;font-size&quot;] || fontSize &lt;= 0.0)
</del><ins>+    if (![self _getFloat:&amp;fontSize forNode:element property:CSSPropertyFontSize] || fontSize &lt;= 0.0)
</ins><span class="cx">         fontSize = _defaultFontSize;
</span><span class="cx">     fontSize *= _textSizeMultiplier;
</span><span class="cx">     if (fontSize &lt; _minimumFontSize) fontSize = _minimumFontSize;
</span><span class="lines">@@ -1066,11 +1064,11 @@
</span><span class="cx">         font = [fontManager convertFont:actualFont toSize:fontSize];
</span><span class="cx"> #endif
</span><span class="cx">     if (!font) {
</span><del>-        NSString *fontName = [[self _stringForNode:element property:@&quot;font-family&quot;] capitalizedString];
-        NSString *fontStyle = [self _stringForNode:element property:@&quot;font-style&quot;];
-        NSString *fontWeight = [self _stringForNode:element property:@&quot;font-weight&quot;];
</del><ins>+        NSString *fontName = [[self _stringForNode:element property:CSSPropertyFontFamily] capitalizedString];
+        NSString *fontStyle = [self _stringForNode:element property:CSSPropertyFontStyle];
+        NSString *fontWeight = [self _stringForNode:element property:CSSPropertyFontWeight];
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><del>-        NSString *fontVariant = [self _stringForNode:element property:@&quot;font-variant&quot;];
</del><ins>+        NSString *fontVariant = [self _stringForNode:element property:CSSPropertyFontVariant];
</ins><span class="cx"> #endif
</span><span class="cx">         if (!fontName)
</span><span class="cx">             fontName = _standardFontFamily;
</span><span class="lines">@@ -1116,20 +1114,14 @@
</span><span class="cx">     if (backgroundColor &amp;&amp; ![self _elementHasOwnBackgroundColor:element])
</span><span class="cx">         [attrs setObject:backgroundColor forKey:NSBackgroundColorAttributeName];
</span><span class="cx"> 
</span><del>-    if ([self _getFloat:&amp;strokeWidth forNode:element property:@&quot;-webkit-text-stroke-width&quot;]) {
</del><ins>+    if ([self _getFloat:&amp;strokeWidth forNode:element property:CSSPropertyWebkitTextStrokeWidth]) {
</ins><span class="cx">         float textStrokeWidth = strokeWidth / ([font pointSize] * 0.01);
</span><span class="cx">         [attrs setObject:[NSNumber numberWithDouble:textStrokeWidth] forKey:NSStrokeWidthAttributeName];
</span><span class="cx">     }
</span><span class="cx">     if(strokeColor)
</span><span class="cx">         [attrs setObject:strokeColor forKey:NSStrokeColorAttributeName];
</span><del>-    if (fontEffect) {
-        if ([fontEffect rangeOfString:@&quot;outline&quot;].location != NSNotFound)
-            [attrs setObject:[NSNumber numberWithDouble:3.0] forKey:NSStrokeWidthAttributeName];
-        if ([fontEffect rangeOfString:@&quot;emboss&quot;].location != NSNotFound)
-            [attrs setObject:[[[PlatformNSShadow alloc] init] autorelease] forKey:NSShadowAttributeName];
-    }
</del><span class="cx">     if (fontKerning || letterSpacing) {
</span><del>-        if ([fontEffect rangeOfString:@&quot;none&quot;].location != NSNotFound)
</del><ins>+        if ([fontKerning rangeOfString:@&quot;none&quot;].location != NSNotFound)
</ins><span class="cx">             [attrs setObject:@0.0 forKey:NSKernAttributeName];
</span><span class="cx">         else {
</span><span class="cx">             double kernVal = letterSpacing ? [letterSpacing doubleValue] : 0.0;
</span><span class="lines">@@ -1140,11 +1132,11 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     if (fontLigatures) {
</span><del>-        if ([fontEffect rangeOfString:@&quot;normal&quot;].location != NSNotFound)
</del><ins>+        if ([fontLigatures rangeOfString:@&quot;normal&quot;].location != NSNotFound)
</ins><span class="cx">             ;   // default: whatever the system decides to do
</span><del>-        else if ([fontEffect rangeOfString:@&quot;common-ligatures&quot;].location != NSNotFound)
</del><ins>+        else if ([fontLigatures rangeOfString:@&quot;common-ligatures&quot;].location != NSNotFound)
</ins><span class="cx">             [attrs setObject:@1 forKey:NSLigatureAttributeName];   // explicitly enabled
</span><del>-        else if ([fontEffect rangeOfString:@&quot;no-common-ligatures&quot;].location != NSNotFound)
</del><ins>+        else if ([fontLigatures rangeOfString:@&quot;no-common-ligatures&quot;].location != NSNotFound)
</ins><span class="cx">             [attrs setObject:@0 forKey:NSLigatureAttributeName];  // explicitly disabled
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1160,7 +1152,7 @@
</span><span class="cx">         if ([verticalAlign rangeOfString:@&quot;sub&quot;].location != NSNotFound)
</span><span class="cx">             [attrs setObject:[NSNumber numberWithInteger:-1] forKey:NSSuperscriptAttributeName];
</span><span class="cx">     }
</span><del>-    if ([self _getFloat:&amp;baselineOffset forNode:element property:@&quot;vertical-align&quot;])
</del><ins>+    if ([self _getFloat:&amp;baselineOffset forNode:element property:CSSPropertyVerticalAlign])
</ins><span class="cx">         [attrs setObject:[NSNumber numberWithDouble:baselineOffset] forKey:NSBaselineOffsetAttributeName];
</span><span class="cx">     if (textShadow &amp;&amp; [textShadow length] &gt; 4) {
</span><span class="cx">         NSShadow *shadow = _shadowForShadowStyle(textShadow);
</span><span class="lines">@@ -1174,9 +1166,9 @@
</span><span class="cx">         NSMutableParagraphStyle *paragraphStyle = [[[self class] defaultParagraphStyle] mutableCopy];
</span><span class="cx">         NSString *blockTag = [blockElement tagName];
</span><span class="cx">         BOOL isParagraph = ([@&quot;P&quot; isEqualToString:blockTag] || [@&quot;LI&quot; isEqualToString:blockTag] || ([blockTag hasPrefix:@&quot;H&quot;] &amp;&amp; 2 == [blockTag length]));
</span><del>-        NSString *textAlign = [self _stringForNode:blockElement property:@&quot;text-align&quot;];
-        NSString *direction = [self _stringForNode:blockElement property:@&quot;direction&quot;];
-        NSString *hyphenation = [self _stringForNode:blockElement property:@&quot;-webkit-hyphens&quot;];
</del><ins>+        NSString *textAlign = [self _stringForNode:blockElement property:CSSPropertyTextAlign];
+        NSString *direction = [self _stringForNode:blockElement property:CSSPropertyDirection];
+        NSString *hyphenation = [self _stringForNode:blockElement property:CSSPropertyWebkitHyphens];
</ins><span class="cx">         CGFloat leftMargin = 0;
</span><span class="cx">         CGFloat rightMargin = 0;
</span><span class="cx">         CGFloat bottomMargin = 0;
</span><span class="lines">@@ -1211,16 +1203,16 @@
</span><span class="cx">                 [paragraphStyle setHeaderLevel:headerLevel];
</span><span class="cx">         }
</span><span class="cx">         if (isParagraph) {
</span><del>-            if ([self _getFloat:&amp;leftMargin forNode:blockElement property:@&quot;margin-left&quot;] &amp;&amp; leftMargin &gt; 0.0)
</del><ins>+            if ([self _getFloat:&amp;leftMargin forNode:blockElement property:CSSPropertyMarginLeft] &amp;&amp; leftMargin &gt; 0.0)
</ins><span class="cx">                 [paragraphStyle setHeadIndent:leftMargin];
</span><del>-            if ([self _getFloat:&amp;textIndent forNode:blockElement property:@&quot;text-indent&quot;])
</del><ins>+            if ([self _getFloat:&amp;textIndent forNode:blockElement property:CSSPropertyTextIndent])
</ins><span class="cx">                 [paragraphStyle setFirstLineHeadIndent:[paragraphStyle headIndent] + textIndent];
</span><del>-            if ([self _getFloat:&amp;rightMargin forNode:blockElement property:@&quot;margin-right&quot;] &amp;&amp; rightMargin &gt; 0.0)
</del><ins>+            if ([self _getFloat:&amp;rightMargin forNode:blockElement property:CSSPropertyMarginRight] &amp;&amp; rightMargin &gt; 0.0)
</ins><span class="cx">                 [paragraphStyle setTailIndent:-rightMargin];
</span><del>-            if ([self _getFloat:&amp;bottomMargin forNode:blockElement property:@&quot;margin-bottom&quot;] &amp;&amp; bottomMargin &gt; 0.0)
</del><ins>+            if ([self _getFloat:&amp;bottomMargin forNode:blockElement property:CSSPropertyMarginBottom] &amp;&amp; bottomMargin &gt; 0.0)
</ins><span class="cx">                 [paragraphStyle setParagraphSpacing:bottomMargin];
</span><span class="cx">         }
</span><del>-        if (_webViewTextSizeMultiplier &gt; 0.0 &amp;&amp; [self _getFloat:&amp;lineHeight forNode:element property:@&quot;line-height&quot;] &amp;&amp; lineHeight &gt; 0.0)
</del><ins>+        if (_webViewTextSizeMultiplier &gt; 0.0 &amp;&amp; [self _getFloat:&amp;lineHeight forNode:element property:CSSPropertyLineHeight] &amp;&amp; lineHeight &gt; 0.0)
</ins><span class="cx">             [paragraphStyle setMinimumLineHeight:lineHeight / _webViewTextSizeMultiplier];
</span><span class="cx">         if ([_textLists count] &gt; 0)
</span><span class="cx">             [paragraphStyle setTextLists:_textLists];
</span><span class="lines">@@ -1374,9 +1366,8 @@
</span><span class="cx">         NSUInteger textLength = [_attrStr length];
</span><span class="cx">         RetainPtr&lt;NSTextAttachment&gt; attachment = adoptNS([[PlatformNSTextAttachment alloc] initWithFileWrapper:fileWrapper]);
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-        NSString *vAlign = [self _stringForNode:element property:@&quot;vertical-align&quot;];
-        NSString *hAlign = [self _stringForNode:element property:@&quot;horizontal-align&quot;];
-        attachment.get().bounds = CGRectMake(([hAlign floatValue] / 100.) * element.clientWidth, ([vAlign floatValue] / 100.) * element.clientHeight, element.clientWidth, element.clientHeight);
</del><ins>+        NSString *vAlign = [self _stringForNode:element property:CSSPropertyVerticalAlign];
+        attachment.get().bounds = CGRectMake(0, ([vAlign floatValue] / 100.) * element.clientHeight, element.clientWidth, element.clientHeight);
</ins><span class="cx"> #endif
</span><span class="cx">         RetainPtr&lt;NSString&gt; string = adoptNS([[NSString alloc] initWithFormat:(needsParagraph ? @&quot;%C\n&quot; : @&quot;%C&quot;), static_cast&lt;unichar&gt;(NSAttachmentCharacter)]);
</span><span class="cx">         NSRange rangeToReplace = NSMakeRange(textLength, 0);
</span><span class="lines">@@ -1462,57 +1453,57 @@
</span><span class="cx">     NSString *width = isTableCellElement ? [(DOMHTMLTableCellElement *)element width] : [element getAttribute:@&quot;width&quot;];
</span><span class="cx"> 
</span><span class="cx">     if ((width &amp;&amp; [width length]) || !isTable) {
</span><del>-        if ([self _getFloat:&amp;val forNode:element property:@&quot;width&quot;])
</del><ins>+        if ([self _getFloat:&amp;val forNode:element property:CSSPropertyWidth])
</ins><span class="cx">             [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockWidth];
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;min-width&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMinWidth])
</ins><span class="cx">         [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockMinimumWidth];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;max-width&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMaxWidth])
</ins><span class="cx">         [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockMaximumWidth];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;min-height&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMinHeight])
</ins><span class="cx">         [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockMinimumHeight];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;max-height&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMaxHeight])
</ins><span class="cx">         [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockMaximumHeight];
</span><span class="cx"> 
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;padding-left&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyPaddingLeft])
</ins><span class="cx">         [block setWidth:val + extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMinXEdge];
</span><span class="cx">     else [block setWidth:extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMinXEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;padding-top&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyPaddingTop])
</ins><span class="cx">         [block setWidth:val + extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMinYEdge]; else [block setWidth:extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMinYEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;padding-right&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyPaddingRight])
</ins><span class="cx">         [block setWidth:val + extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMaxXEdge]; else [block setWidth:extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMaxXEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;padding-bottom&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyPaddingBottom])
</ins><span class="cx">         [block setWidth:val + extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMaxYEdge]; else [block setWidth:extraPadding type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockPadding edge:NSMaxYEdge];
</span><span class="cx">     
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;border-left-width&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyBorderLeftWidth])
</ins><span class="cx">         [block setWidth:val type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockBorder edge:NSMinXEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;border-top-width&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyBorderTopWidth])
</ins><span class="cx">         [block setWidth:val type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockBorder edge:NSMinYEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;border-right-width&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyBorderRightWidth])
</ins><span class="cx">         [block setWidth:val type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockBorder edge:NSMaxXEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;border-bottom-width&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyBorderBottomWidth])
</ins><span class="cx">         [block setWidth:val type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockBorder edge:NSMaxYEdge];
</span><span class="cx"> 
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;margin-left&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMarginLeft])
</ins><span class="cx">         [block setWidth:val + extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMinXEdge]; else [block setWidth:extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMinXEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;margin-top&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMarginTop])
</ins><span class="cx">         [block setWidth:val + extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMinYEdge]; else [block setWidth:extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMinYEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;margin-right&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMarginRight])
</ins><span class="cx">         [block setWidth:val + extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMaxXEdge]; else [block setWidth:extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMaxXEdge];
</span><del>-    if ([self _getFloat:&amp;val forNode:element property:@&quot;margin-bottom&quot;])
</del><ins>+    if ([self _getFloat:&amp;val forNode:element property:CSSPropertyMarginBottom])
</ins><span class="cx">         [block setWidth:val + extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMaxYEdge]; else [block setWidth:extraMargin type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockMargin edge:NSMaxYEdge];
</span><span class="cx"> 
</span><del>-    if ((color = [self _colorForNode:element property:@&quot;background-color&quot;]))
</del><ins>+    if ((color = [self _colorForNode:element property:CSSPropertyBackgroundColor]))
</ins><span class="cx">         [block setBackgroundColor:color];
</span><span class="cx">     if (!color &amp;&amp; backgroundColor) [block setBackgroundColor:backgroundColor];
</span><del>-    if ((color = [self _colorForNode:element property:@&quot;border-left-color&quot;]))
</del><ins>+    if ((color = [self _colorForNode:element property:CSSPropertyBorderLeftColor]))
</ins><span class="cx">         [block setBorderColor:color forEdge:NSMinXEdge];
</span><del>-    if ((color = [self _colorForNode:element property:@&quot;border-top-color&quot;]))
</del><ins>+    if ((color = [self _colorForNode:element property:CSSPropertyBorderTopColor]))
</ins><span class="cx">         [block setBorderColor:color forEdge:NSMinYEdge];
</span><del>-    if ((color = [self _colorForNode:element property:@&quot;border-right-color&quot;]))
</del><ins>+    if ((color = [self _colorForNode:element property:CSSPropertyBorderRightColor]))
</ins><span class="cx">         [block setBorderColor:color forEdge:NSMaxXEdge];
</span><del>-    if ((color = [self _colorForNode:element property:@&quot;border-bottom-color&quot;]))
</del><ins>+    if ((color = [self _colorForNode:element property:CSSPropertyBorderBottomColor]))
</ins><span class="cx">         [block setBorderColor:color forEdge:NSMaxYEdge];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1687,9 +1678,9 @@
</span><span class="cx">     [table setCollapsesBorders:NO];
</span><span class="cx">     [table setHidesEmptyCells:NO];
</span><span class="cx">     if (tableElement) {
</span><del>-        NSString *borderCollapse = [self _stringForNode:tableElement property:@&quot;border-collapse&quot;];
-        NSString *emptyCells = [self _stringForNode:tableElement property:@&quot;empty-cells&quot;];
-        NSString *tableLayout = [self _stringForNode:tableElement property:@&quot;table-layout&quot;];
</del><ins>+        NSString *borderCollapse = [self _stringForNode:tableElement property:CSSPropertyBorderCollapse];
+        NSString *emptyCells = [self _stringForNode:tableElement property:CSSPropertyEmptyCells];
+        NSString *tableLayout = [self _stringForNode:tableElement property:CSSPropertyTableLayout];
</ins><span class="cx">         if ([tableElement respondsToSelector:@selector(cellSpacing)]) {
</span><span class="cx">             NSString *cellSpacing = [(DOMHTMLTableElement *)tableElement cellSpacing];
</span><span class="cx">             if (cellSpacing &amp;&amp; [cellSpacing length] &gt; 0 &amp;&amp; ![cellSpacing hasSuffix:@&quot;%&quot;]) cellSpacingVal = [cellSpacing floatValue];
</span><span class="lines">@@ -1745,7 +1736,7 @@
</span><span class="cx">     }
</span><span class="cx">     RetainPtr&lt;NSTextTableBlock&gt; block = adoptNS([[PlatformNSTextTableBlock alloc] initWithTable:table startingRow:rowNumber rowSpan:rowSpan startingColumn:columnNumber columnSpan:colSpan]);
</span><span class="cx">     if (tableCellElement) {
</span><del>-        NSString *verticalAlign = [self _stringForNode:tableCellElement property:@&quot;vertical-align&quot;];
</del><ins>+        NSString *verticalAlign = [self _stringForNode:tableCellElement property:CSSPropertyVerticalAlign];
</ins><span class="cx">         [self _fillInBlock:block.get() forElement:tableCellElement backgroundColor:color extraMargin:cellSpacingVal / 2 extraPadding:0 isTable:NO];
</span><span class="cx">         if ([@&quot;middle&quot; isEqualToString:verticalAlign])
</span><span class="cx">             [block setVerticalAlignment:NSTextBlockMiddleAlignment];
</span><span class="lines">@@ -1768,16 +1759,16 @@
</span><span class="cx">     if (isBlockLevel)
</span><span class="cx">         [_writingDirectionArray removeAllObjects];
</span><span class="cx">     else {
</span><del>-        NSString *bidi = [self _stringForNode:element property:@&quot;unicode-bidi&quot;];
</del><ins>+        NSString *bidi = [self _stringForNode:element property:CSSPropertyUnicodeBidi];
</ins><span class="cx">         if (bidi &amp;&amp; [bidi isEqualToString:@&quot;embed&quot;]) {
</span><span class="cx">             NSUInteger val = NSTextWritingDirectionEmbedding;
</span><del>-            NSString *direction = [self _stringForNode:element property:@&quot;direction&quot;];
</del><ins>+            NSString *direction = [self _stringForNode:element property:CSSPropertyDirection];
</ins><span class="cx">             if ([direction isEqualToString:@&quot;rtl&quot;])
</span><span class="cx">                 val |= NSWritingDirectionRightToLeft;
</span><span class="cx">             [_writingDirectionArray addObject:[NSNumber numberWithUnsignedInteger:val]];
</span><span class="cx">         } else if (bidi &amp;&amp; [bidi isEqualToString:@&quot;bidi-override&quot;]) {
</span><span class="cx">             NSUInteger val = NSTextWritingDirectionOverride;
</span><del>-            NSString *direction = [self _stringForNode:element property:@&quot;direction&quot;];
</del><ins>+            NSString *direction = [self _stringForNode:element property:CSSPropertyDirection];
</ins><span class="cx">             if ([direction isEqualToString:@&quot;rtl&quot;])
</span><span class="cx">                 val |= NSWritingDirectionRightToLeft;
</span><span class="cx">             [_writingDirectionArray addObject:[NSNumber numberWithUnsignedInteger:val]];
</span><span class="lines">@@ -1788,7 +1779,7 @@
</span><span class="cx">         if ([@&quot;table-row-group&quot; isEqualToString:displayVal]) {
</span><span class="cx">             // If we are starting in medias res, the first thing we see may be the tbody, so go up to the table
</span><span class="cx">             tableElement = [self _blockLevelElementForNode:[element parentNode]];
</span><del>-            if (![@&quot;table&quot; isEqualToString:[self _stringForNode:tableElement property:@&quot;display&quot;]])
</del><ins>+            if (![@&quot;table&quot; isEqualToString:[self _stringForNode:tableElement property:CSSPropertyDisplay]])
</ins><span class="cx">                 tableElement = element;
</span><span class="cx">         }
</span><span class="cx">         while ([_textTables count] &gt; [_textBlocks count])
</span><span class="lines">@@ -1798,7 +1789,7 @@
</span><span class="cx">         [_textTableFooters setObject:element forKey:[NSValue valueWithNonretainedObject:[_textTables lastObject]]];
</span><span class="cx">         retval = NO;
</span><span class="cx">     } else if ([@&quot;table-row&quot; isEqualToString:displayVal] &amp;&amp; [_textTables count] &gt; 0) {
</span><del>-        PlatformColor *color = [self _colorForNode:element property:@&quot;background-color&quot;];
</del><ins>+        PlatformColor *color = [self _colorForNode:element property:CSSPropertyBackgroundColor];
</ins><span class="cx">         if (!color) color = [PlatformColorClass clearColor];
</span><span class="cx">         [_textTableRowBackgroundColors addObject:color];
</span><span class="cx">     } else if ([@&quot;table-cell&quot; isEqualToString:displayVal]) {
</span><span class="lines">@@ -1870,14 +1861,14 @@
</span><span class="cx">         }
</span><span class="cx">     } else if ([@&quot;UL&quot; isEqualToString:tag]) {
</span><span class="cx">         RetainPtr&lt;NSTextList&gt; list;
</span><del>-        NSString *listStyleType = [self _stringForNode:element property:@&quot;list-style-type&quot;];
</del><ins>+        NSString *listStyleType = [self _stringForNode:element property:CSSPropertyListStyleType];
</ins><span class="cx">         if (!listStyleType || [listStyleType length] == 0)
</span><span class="cx">             listStyleType = @&quot;disc&quot;;
</span><span class="cx">         list = adoptNS([[PlatformNSTextList alloc] initWithMarkerFormat:[NSString stringWithFormat:@&quot;{%@}&quot;, listStyleType] options:0]);
</span><span class="cx">         [_textLists addObject:list.get()];
</span><span class="cx">     } else if ([@&quot;OL&quot; isEqualToString:tag]) {
</span><span class="cx">         RetainPtr&lt;NSTextList&gt; list;
</span><del>-        NSString *listStyleType = [self _stringForNode:element property:@&quot;list-style-type&quot;];
</del><ins>+        NSString *listStyleType = [self _stringForNode:element property:CSSPropertyListStyleType];
</ins><span class="cx">         if (!listStyleType || [listStyleType length] == 0) listStyleType = @&quot;decimal&quot;;
</span><span class="cx">         list = adoptNS([[PlatformNSTextList alloc] initWithMarkerFormat:[NSString stringWithFormat:@&quot;{%@}.&quot;, listStyleType] options:0]);
</span><span class="cx">         if ([element respondsToSelector:@selector(start)]) {
</span><span class="lines">@@ -2012,7 +2003,7 @@
</span><span class="cx">             [self _newParagraphForElement:element tag:tag allowEmpty:(range.length == 0) suppressTrailingSpace:YES];
</span><span class="cx">         }
</span><span class="cx">     } else if ([_writingDirectionArray count] &gt; 0) {
</span><del>-        NSString *bidi = [self _stringForNode:element property:@&quot;unicode-bidi&quot;];
</del><ins>+        NSString *bidi = [self _stringForNode:element property:CSSPropertyUnicodeBidi];
</ins><span class="cx">         if (bidi &amp;&amp; ([bidi isEqualToString:@&quot;embed&quot;] || [bidi isEqualToString:@&quot;bidi-override&quot;])) {
</span><span class="cx">             [_writingDirectionArray removeLastObject];
</span><span class="cx">         }
</span><span class="lines">@@ -2136,8 +2127,8 @@
</span><span class="cx">     BOOL suppressLeadingSpace = ((_flags.isSoft &amp;&amp; lastChar == ' ') || lastChar == '\n' || lastChar == '\r' || lastChar == '\t' || lastChar == NSParagraphSeparatorCharacter || lastChar == NSLineSeparatorCharacter || lastChar == NSFormFeedCharacter || lastChar == WebNextLineCharacter);
</span><span class="cx">     NSRange rangeToReplace = NSMakeRange(textLength, 0);
</span><span class="cx">     CFMutableStringRef mutstr = NULL;
</span><del>-    whitespaceVal = [self _stringForNode:text property:@&quot;white-space&quot;];
-    transformVal = [self _stringForNode:text property:@&quot;text-transform&quot;];
</del><ins>+    whitespaceVal = [self _stringForNode:text property:CSSPropertyWhiteSpace];
+    transformVal = [self _stringForNode:text property:CSSPropertyTextTransform];
</ins><span class="cx">     
</span><span class="cx">     if (_domRange) {
</span><span class="cx">         if (text == [_domRange startContainer]) {
</span><span class="lines">@@ -2270,7 +2261,7 @@
</span><span class="cx">         }
</span><span class="cx">     } else if (nodeType == DOM_ELEMENT_NODE) {
</span><span class="cx">         DOMElement *element = (DOMElement *)node;
</span><del>-        NSString *tag = [element tagName], *displayVal = [self _stringForNode:element property:@&quot;display&quot;];
</del><ins>+        NSString *tag = [element tagName], *displayVal = [self _stringForNode:element property:CSSPropertyDisplay];
</ins><span class="cx">         if ([self _enterElement:element tag:tag display:displayVal embedded:embedded]) {
</span><span class="cx">             NSUInteger startIndex = [_attrStr length];
</span><span class="cx">             if ([self _processElement:element tag:tag display:displayVal depth:depth]) {
</span></span></pre>
</div>
</div>

</body>
</html>