<!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 <sam@webkit.org>
+
+ 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 <simon.fraser@apple.com>
</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&, const String& propertyName);
- bool floatPropertyValueForNode(Node&, const String& propertyName, float&);
- Color colorPropertyValueForNode(Node&, const String& propertyName);
</del><ins>+ String propertyValueForNode(Node&, CSSPropertyID );
+ bool floatPropertyValueForNode(Node&, CSSPropertyID, float&);
+ Color colorPropertyValueForNode(Node&, CSSPropertyID);
</ins><span class="cx">
</span><span class="cx"> bool isBlockElement(Element&);
</span><span class="cx"> bool elementHasOwnBackgroundColor(Element&);
</span><span class="cx">
</span><del>- PassRefPtr<CSSValue> computedStylePropertyForElement(Element&, const String&);
- PassRefPtr<CSSValue> inlineStylePropertyForElement(Element&, const String&);
</del><ins>+ PassRefPtr<CSSValue> computedStylePropertyForElement(Element&, CSSPropertyID);
+ PassRefPtr<CSSValue> inlineStylePropertyForElement(Element&, CSSPropertyID);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> HashMap<Element*, std::unique_ptr<ComputedStyleExtractor>> 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<CSSValue> HTMLConverterCaches::computedStylePropertyForElement(Element& element, const String& propertyName)
</del><ins>+PassRefPtr<CSSValue> HTMLConverterCaches::computedStylePropertyForElement(Element& 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(&element, nullptr);
</span><span class="cx"> if (result.isNewEntry)
</span><span class="cx"> result.iterator->value = std::make_unique<ComputedStyleExtractor>(&element, true);
</span><span class="cx"> ComputedStyleExtractor& computedStyle = *result.iterator->value;
</span><del>- return computedStyle.propertyValue(propetyId);
</del><ins>+ return computedStyle.propertyValue(propertyId);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<CSSValue> HTMLConverterCaches::inlineStylePropertyForElement(Element& element, const String& propertyName)
</del><ins>+PassRefPtr<CSSValue> HTMLConverterCaches::inlineStylePropertyForElement(Element& 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->getPropertyCSSValue(propetyId);
</del><ins>+ return properties->getPropertyCSSValue(propertyId);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool stringFromCSSValue(CSSValue& value, String& 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& node, const String& propertyName)
</del><ins>+String HTMLConverterCaches::propertyValueForNode(Node& 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& element = toElement(node);
</span><del>- if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) {
</del><ins>+ if (RefPtr<CSSValue> 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<CSSValue> value = inlineStylePropertyForElement(element, propertyName)) {
</del><ins>+ if (RefPtr<CSSValue> value = inlineStylePropertyForElement(element, propertyId)) {
</ins><span class="cx"> String result;
</span><span class="cx"> if (value->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 "none";
</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->propertyValueForNode(*coreNode, String(key));
</del><ins>+ String result = _caches->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& node, const String& propertyName, float& result)
</del><ins>+bool HTMLConverterCaches::floatPropertyValueForNode(Node& node, CSSPropertyID propertyId, float& 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& element = toElement(node);
</span><del>- if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) {
</del><ins>+ if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyId)) {
</ins><span class="cx"> if (value->isPrimitiveValue() && 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<CSSValue> value = inlineStylePropertyForElement(element, propertyName)) {
</del><ins>+ if (RefPtr<CSSValue> value = inlineStylePropertyForElement(element, propertyId)) {
</ins><span class="cx"> if (value->isPrimitiveValue() && floatValueFromPrimitiveValue(toCSSPrimitiveValue(*value), result))
</span><span class="cx"> return true;
</span><span class="cx"> if (value->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->floatPropertyValueForNode(*coreNode, String(key), result))
</del><ins>+ if (!_caches->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& element)
</span><span class="cx"> {
</span><del>- String displayValue = propertyValueForNode(element, "display");
</del><ins>+ String displayValue = propertyValueForNode(element, CSSPropertyDisplay);
</ins><span class="cx"> if (displayValue == "block" || displayValue == "list-item" || displayValue.startsWith("table"))
</span><span class="cx"> return true;
</span><del>- String floatValue = propertyValueForNode(element, "float");
</del><ins>+ String floatValue = propertyValueForNode(element, CSSPropertyFloat);
</ins><span class="cx"> if (floatValue == "left" || floatValue == "right")
</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, "display").startsWith("table");
</del><ins>+ return element.hasTagName(htmlTag) || element.hasTagName(bodyTag) || propertyValueForNode(element, CSSPropertyDisplay).startsWith("table");
</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& node, const String& propertyName)
</del><ins>+Color HTMLConverterCaches::colorPropertyValueForNode(Node& 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& element = toElement(node);
</span><del>- if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) {
</del><ins>+ if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyId)) {
</ins><span class="cx"> if (value->isPrimitiveValue() && toCSSPrimitiveValue(*value).isRGBColor())
</span><del>- return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyName == "color");
</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<CSSValue> value = inlineStylePropertyForElement(element, propertyName)) {
</del><ins>+ if (RefPtr<CSSValue> value = inlineStylePropertyForElement(element, propertyId)) {
</ins><span class="cx"> if (value->isPrimitiveValue() && toCSSPrimitiveValue(*value).isRGBColor())
</span><del>- return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyName == "color");
</del><ins>+ return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</ins><span class="cx"> if (value->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->colorPropertyValueForNode(*coreNode, String(key));
</del><ins>+ Color result = _caches->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:@"font-effect"];
- NSString *textDecoration = [self _stringForNode:element property:@"text-decoration"];
- NSString *verticalAlign = [self _stringForNode:element property:@"vertical-align"];
- NSString *textShadow = [self _stringForNode:element property:@"text-shadow"];
- NSString *fontLigatures = [self _stringForNode:element property:@"font-variant-ligatures"];
- NSString *fontKerning = [self _stringForNode:element property:@"font-kerning"];
- NSString *letterSpacing = [self _stringForNode:element property:@"letter-spacing"];
</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:@"color"];
- PlatformColor *backgroundColor = [self _colorForNode:element property:@"background-color"];
- PlatformColor *strokeColor = [self _colorForNode:element property:@"-webkit-text-stroke-color"];
</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:&fontSize forNode:element property:@"font-size"] || fontSize <= 0.0)
</del><ins>+ if (![self _getFloat:&fontSize forNode:element property:CSSPropertyFontSize] || fontSize <= 0.0)
</ins><span class="cx"> fontSize = _defaultFontSize;
</span><span class="cx"> fontSize *= _textSizeMultiplier;
</span><span class="cx"> if (fontSize < _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:@"font-family"] capitalizedString];
- NSString *fontStyle = [self _stringForNode:element property:@"font-style"];
- NSString *fontWeight = [self _stringForNode:element property:@"font-weight"];
</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:@"font-variant"];
</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 && ![self _elementHasOwnBackgroundColor:element])
</span><span class="cx"> [attrs setObject:backgroundColor forKey:NSBackgroundColorAttributeName];
</span><span class="cx">
</span><del>- if ([self _getFloat:&strokeWidth forNode:element property:@"-webkit-text-stroke-width"]) {
</del><ins>+ if ([self _getFloat:&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:@"outline"].location != NSNotFound)
- [attrs setObject:[NSNumber numberWithDouble:3.0] forKey:NSStrokeWidthAttributeName];
- if ([fontEffect rangeOfString:@"emboss"].location != NSNotFound)
- [attrs setObject:[[[PlatformNSShadow alloc] init] autorelease] forKey:NSShadowAttributeName];
- }
</del><span class="cx"> if (fontKerning || letterSpacing) {
</span><del>- if ([fontEffect rangeOfString:@"none"].location != NSNotFound)
</del><ins>+ if ([fontKerning rangeOfString:@"none"].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:@"normal"].location != NSNotFound)
</del><ins>+ if ([fontLigatures rangeOfString:@"normal"].location != NSNotFound)
</ins><span class="cx"> ; // default: whatever the system decides to do
</span><del>- else if ([fontEffect rangeOfString:@"common-ligatures"].location != NSNotFound)
</del><ins>+ else if ([fontLigatures rangeOfString:@"common-ligatures"].location != NSNotFound)
</ins><span class="cx"> [attrs setObject:@1 forKey:NSLigatureAttributeName]; // explicitly enabled
</span><del>- else if ([fontEffect rangeOfString:@"no-common-ligatures"].location != NSNotFound)
</del><ins>+ else if ([fontLigatures rangeOfString:@"no-common-ligatures"].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:@"sub"].location != NSNotFound)
</span><span class="cx"> [attrs setObject:[NSNumber numberWithInteger:-1] forKey:NSSuperscriptAttributeName];
</span><span class="cx"> }
</span><del>- if ([self _getFloat:&baselineOffset forNode:element property:@"vertical-align"])
</del><ins>+ if ([self _getFloat:&baselineOffset forNode:element property:CSSPropertyVerticalAlign])
</ins><span class="cx"> [attrs setObject:[NSNumber numberWithDouble:baselineOffset] forKey:NSBaselineOffsetAttributeName];
</span><span class="cx"> if (textShadow && [textShadow length] > 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 = ([@"P" isEqualToString:blockTag] || [@"LI" isEqualToString:blockTag] || ([blockTag hasPrefix:@"H"] && 2 == [blockTag length]));
</span><del>- NSString *textAlign = [self _stringForNode:blockElement property:@"text-align"];
- NSString *direction = [self _stringForNode:blockElement property:@"direction"];
- NSString *hyphenation = [self _stringForNode:blockElement property:@"-webkit-hyphens"];
</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:&leftMargin forNode:blockElement property:@"margin-left"] && leftMargin > 0.0)
</del><ins>+ if ([self _getFloat:&leftMargin forNode:blockElement property:CSSPropertyMarginLeft] && leftMargin > 0.0)
</ins><span class="cx"> [paragraphStyle setHeadIndent:leftMargin];
</span><del>- if ([self _getFloat:&textIndent forNode:blockElement property:@"text-indent"])
</del><ins>+ if ([self _getFloat:&textIndent forNode:blockElement property:CSSPropertyTextIndent])
</ins><span class="cx"> [paragraphStyle setFirstLineHeadIndent:[paragraphStyle headIndent] + textIndent];
</span><del>- if ([self _getFloat:&rightMargin forNode:blockElement property:@"margin-right"] && rightMargin > 0.0)
</del><ins>+ if ([self _getFloat:&rightMargin forNode:blockElement property:CSSPropertyMarginRight] && rightMargin > 0.0)
</ins><span class="cx"> [paragraphStyle setTailIndent:-rightMargin];
</span><del>- if ([self _getFloat:&bottomMargin forNode:blockElement property:@"margin-bottom"] && bottomMargin > 0.0)
</del><ins>+ if ([self _getFloat:&bottomMargin forNode:blockElement property:CSSPropertyMarginBottom] && bottomMargin > 0.0)
</ins><span class="cx"> [paragraphStyle setParagraphSpacing:bottomMargin];
</span><span class="cx"> }
</span><del>- if (_webViewTextSizeMultiplier > 0.0 && [self _getFloat:&lineHeight forNode:element property:@"line-height"] && lineHeight > 0.0)
</del><ins>+ if (_webViewTextSizeMultiplier > 0.0 && [self _getFloat:&lineHeight forNode:element property:CSSPropertyLineHeight] && lineHeight > 0.0)
</ins><span class="cx"> [paragraphStyle setMinimumLineHeight:lineHeight / _webViewTextSizeMultiplier];
</span><span class="cx"> if ([_textLists count] > 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<NSTextAttachment> attachment = adoptNS([[PlatformNSTextAttachment alloc] initWithFileWrapper:fileWrapper]);
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>- NSString *vAlign = [self _stringForNode:element property:@"vertical-align"];
- NSString *hAlign = [self _stringForNode:element property:@"horizontal-align"];
- 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<NSString> string = adoptNS([[NSString alloc] initWithFormat:(needsParagraph ? @"%C\n" : @"%C"), static_cast<unichar>(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:@"width"];
</span><span class="cx">
</span><span class="cx"> if ((width && [width length]) || !isTable) {
</span><del>- if ([self _getFloat:&val forNode:element property:@"width"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"min-width"])
</del><ins>+ if ([self _getFloat:&val forNode:element property:CSSPropertyMinWidth])
</ins><span class="cx"> [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockMinimumWidth];
</span><del>- if ([self _getFloat:&val forNode:element property:@"max-width"])
</del><ins>+ if ([self _getFloat:&val forNode:element property:CSSPropertyMaxWidth])
</ins><span class="cx"> [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockMaximumWidth];
</span><del>- if ([self _getFloat:&val forNode:element property:@"min-height"])
</del><ins>+ if ([self _getFloat:&val forNode:element property:CSSPropertyMinHeight])
</ins><span class="cx"> [block setValue:val type:NSTextBlockAbsoluteValueType forDimension:NSTextBlockMinimumHeight];
</span><del>- if ([self _getFloat:&val forNode:element property:@"max-height"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"padding-left"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"padding-top"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"padding-right"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"padding-bottom"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"border-left-width"])
</del><ins>+ if ([self _getFloat:&val forNode:element property:CSSPropertyBorderLeftWidth])
</ins><span class="cx"> [block setWidth:val type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockBorder edge:NSMinXEdge];
</span><del>- if ([self _getFloat:&val forNode:element property:@"border-top-width"])
</del><ins>+ if ([self _getFloat:&val forNode:element property:CSSPropertyBorderTopWidth])
</ins><span class="cx"> [block setWidth:val type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockBorder edge:NSMinYEdge];
</span><del>- if ([self _getFloat:&val forNode:element property:@"border-right-width"])
</del><ins>+ if ([self _getFloat:&val forNode:element property:CSSPropertyBorderRightWidth])
</ins><span class="cx"> [block setWidth:val type:NSTextBlockAbsoluteValueType forLayer:NSTextBlockBorder edge:NSMaxXEdge];
</span><del>- if ([self _getFloat:&val forNode:element property:@"border-bottom-width"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"margin-left"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"margin-top"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"margin-right"])
</del><ins>+ if ([self _getFloat:&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:&val forNode:element property:@"margin-bottom"])
</del><ins>+ if ([self _getFloat:&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:@"background-color"]))
</del><ins>+ if ((color = [self _colorForNode:element property:CSSPropertyBackgroundColor]))
</ins><span class="cx"> [block setBackgroundColor:color];
</span><span class="cx"> if (!color && backgroundColor) [block setBackgroundColor:backgroundColor];
</span><del>- if ((color = [self _colorForNode:element property:@"border-left-color"]))
</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:@"border-top-color"]))
</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:@"border-right-color"]))
</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:@"border-bottom-color"]))
</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:@"border-collapse"];
- NSString *emptyCells = [self _stringForNode:tableElement property:@"empty-cells"];
- NSString *tableLayout = [self _stringForNode:tableElement property:@"table-layout"];
</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 && [cellSpacing length] > 0 && ![cellSpacing hasSuffix:@"%"]) cellSpacingVal = [cellSpacing floatValue];
</span><span class="lines">@@ -1745,7 +1736,7 @@
</span><span class="cx"> }
</span><span class="cx"> RetainPtr<NSTextTableBlock> 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:@"vertical-align"];
</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 ([@"middle" 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:@"unicode-bidi"];
</del><ins>+ NSString *bidi = [self _stringForNode:element property:CSSPropertyUnicodeBidi];
</ins><span class="cx"> if (bidi && [bidi isEqualToString:@"embed"]) {
</span><span class="cx"> NSUInteger val = NSTextWritingDirectionEmbedding;
</span><del>- NSString *direction = [self _stringForNode:element property:@"direction"];
</del><ins>+ NSString *direction = [self _stringForNode:element property:CSSPropertyDirection];
</ins><span class="cx"> if ([direction isEqualToString:@"rtl"])
</span><span class="cx"> val |= NSWritingDirectionRightToLeft;
</span><span class="cx"> [_writingDirectionArray addObject:[NSNumber numberWithUnsignedInteger:val]];
</span><span class="cx"> } else if (bidi && [bidi isEqualToString:@"bidi-override"]) {
</span><span class="cx"> NSUInteger val = NSTextWritingDirectionOverride;
</span><del>- NSString *direction = [self _stringForNode:element property:@"direction"];
</del><ins>+ NSString *direction = [self _stringForNode:element property:CSSPropertyDirection];
</ins><span class="cx"> if ([direction isEqualToString:@"rtl"])
</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 ([@"table-row-group" 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 (![@"table" isEqualToString:[self _stringForNode:tableElement property:@"display"]])
</del><ins>+ if (![@"table" isEqualToString:[self _stringForNode:tableElement property:CSSPropertyDisplay]])
</ins><span class="cx"> tableElement = element;
</span><span class="cx"> }
</span><span class="cx"> while ([_textTables count] > [_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 ([@"table-row" isEqualToString:displayVal] && [_textTables count] > 0) {
</span><del>- PlatformColor *color = [self _colorForNode:element property:@"background-color"];
</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 ([@"table-cell" isEqualToString:displayVal]) {
</span><span class="lines">@@ -1870,14 +1861,14 @@
</span><span class="cx"> }
</span><span class="cx"> } else if ([@"UL" isEqualToString:tag]) {
</span><span class="cx"> RetainPtr<NSTextList> list;
</span><del>- NSString *listStyleType = [self _stringForNode:element property:@"list-style-type"];
</del><ins>+ NSString *listStyleType = [self _stringForNode:element property:CSSPropertyListStyleType];
</ins><span class="cx"> if (!listStyleType || [listStyleType length] == 0)
</span><span class="cx"> listStyleType = @"disc";
</span><span class="cx"> list = adoptNS([[PlatformNSTextList alloc] initWithMarkerFormat:[NSString stringWithFormat:@"{%@}", listStyleType] options:0]);
</span><span class="cx"> [_textLists addObject:list.get()];
</span><span class="cx"> } else if ([@"OL" isEqualToString:tag]) {
</span><span class="cx"> RetainPtr<NSTextList> list;
</span><del>- NSString *listStyleType = [self _stringForNode:element property:@"list-style-type"];
</del><ins>+ NSString *listStyleType = [self _stringForNode:element property:CSSPropertyListStyleType];
</ins><span class="cx"> if (!listStyleType || [listStyleType length] == 0) listStyleType = @"decimal";
</span><span class="cx"> list = adoptNS([[PlatformNSTextList alloc] initWithMarkerFormat:[NSString stringWithFormat:@"{%@}.", 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] > 0) {
</span><del>- NSString *bidi = [self _stringForNode:element property:@"unicode-bidi"];
</del><ins>+ NSString *bidi = [self _stringForNode:element property:CSSPropertyUnicodeBidi];
</ins><span class="cx"> if (bidi && ([bidi isEqualToString:@"embed"] || [bidi isEqualToString:@"bidi-override"])) {
</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 && 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:@"white-space"];
- transformVal = [self _stringForNode:text property:@"text-transform"];
</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:@"display"];
</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>