<!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>[193557] branches/safari-601.1.46-branch</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/193557">193557</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-12-05 22:19:32 -0800 (Sat, 05 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/190209">r190209</a>. rdar://problem/23772891</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreWebCorexcodeprojprojectpbxproj">branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSComputedStyleDeclarationcpp">branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSComputedStyleDeclarationh">branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSGrammaryin">branches/safari-601.1.46-branch/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSParsercpp">branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSParserh">branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSValuecpp">branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSValueh">branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssPropertySetCSSStyleDeclarationcpp">branches/safari-601.1.46-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssStylePropertiescpp">branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssStylePropertiesh">branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssStyleResolvercpp">branches/safari-601.1.46-branch/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorecssmakeproppl">branches/safari-601.1.46-branch/Source/WebCore/css/makeprop.pl</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreinspectorInspectorStyleSheetcpp">branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorStyleSheet.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorerenderingstyleRenderStyleh">branches/safari-601.1.46-branch/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorerenderingstyleStyleRareInheritedDatacpp">branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorerenderingstyleStyleRareInheritedDatah">branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>branches/safari-601.1.46-branch/LayoutTests/fast/css/custom-properties/</li>
<li><a href="#branchessafari601146branchSourceWebCorecssCSSCustomPropertyValueh">branches/safari-601.1.46-branch/Source/WebCore/css/CSSCustomPropertyValue.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorerenderingstyleStyleCustomPropertyDatah">branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleCustomPropertyData.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2015-12-05 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r190209.
+
+ 2015-09-24 David Hyatt <hyatt@apple.com>
+
+ Add support for CSS Custom Properties (in preparation for implementing CSS Variables).
+ https://bugs.webkit.org/show_bug.cgi?id=130397
+
+ Reviewed by Antti Koivisto.
+
+ * fast/css/custom-properties: Added.
+ * fast/css/custom-properties/computed-style-access-expected.html: Added.
+ * fast/css/custom-properties/computed-style-access-inherited-expected.html: Added.
+ * fast/css/custom-properties/computed-style-access-inherited.html: Added.
+ * fast/css/custom-properties/computed-style-access.html: Added.
+ * fast/css/custom-properties/inline-style-property-get-expected.html: Added.
+ * fast/css/custom-properties/inline-style-property-get.html: Added.
+ * fast/css/custom-properties/rule-property-get-css-value-expected.html: Added.
+ * fast/css/custom-properties/rule-property-get-css-value.html: Added.
+ * fast/css/custom-properties/rule-property-get-expected.html: Added.
+ * fast/css/custom-properties/rule-property-get.html: Added.
+ * fast/css/custom-properties/rule-property-priority-expected.html: Added.
+ * fast/css/custom-properties/rule-property-priority.html: Added.
+ * fast/css/custom-properties/rule-property-set-expected.html: Added.
+ * fast/css/custom-properties/rule-property-set.html: Added.
+ * fast/css/custom-properties/rule-serialization-expected.html: Added.
+ * fast/css/custom-properties/rule-serialization.html: Added.
+
+2015-12-05 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r191452.
</span><span class="cx">
</span><span class="cx"> 2015-10-22 Wenson Hsieh <wenson_hsieh@apple.com>
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -1,5 +1,159 @@
</span><span class="cx"> 2015-12-05 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r190209.
+
+ 2015-09-24 David Hyatt <hyatt@apple.com>
+
+ Add support for CSS Custom Properties (in preparation for implementing CSS Variables).
+ https://bugs.webkit.org/show_bug.cgi?id=130397
+
+ Reviewed by Antti Koivisto.
+
+ Added new tests in fast/css/custom-properties.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Add new header files to the project (CSSCustomPropertyValue and StyleCustomPropertyData).
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::ComputedStyleExtractor::customPropertyValue):
+ (WebCore::ComputedStyleExtractor::propertyValue):
+ If a custom property value is queried (i.e., it starts with "--"), then we use our
+ customPropertyValue lookup to go to the RenderStyle and fetch the appropriate custom property
+ value from the StyleCustomPropertyData.
+
+ (WebCore::CSSComputedStyleDeclaration::length):
+ (WebCore::CSSComputedStyleDeclaration::item):
+ Patched to include custom properties in the returned array. They appear at the end of the array
+ after the built-in properties.
+
+ (WebCore::ComputedStyleExtractor::propertyMatches):
+ Patched to check custom properties.
+
+ (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
+ Make sure the custom properties get copied into the StyleDeclaration.
+
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
+ Patched to call customPropertyValue for custom properties.
+
+ * css/CSSComputedStyleDeclaration.h:
+ Add customPropertyValue() to ComputedStyleExtractor.
+
+ * css/CSSCustomPropertyValue.h: Added.
+ (WebCore::CSSCustomPropertyValue::create):
+ (WebCore::CSSCustomPropertyValue::equals):
+ (WebCore::CSSCustomPropertyValue::customCSSText):
+ (WebCore::CSSCustomPropertyValue::name):
+ (WebCore::CSSCustomPropertyValue::value):
+ (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
+ Custom properties are parsed as a property with an ID of CSSPropertyCustom and a CSSCustomPropertyValue
+ that holds both the name and the value of the property. Ultimately we might want to just ditch property IDs in
+ favor of AtomicStrings for all properties, and then the need to special case custom properties would go
+ away. For now, though, this is the way we work custom properties into the existing system.
+
+ * css/CSSGrammar.y.in:
+ Add a production for recognizing custom properties and storing them using a property ID of CSSPropertyCustom
+ and a CSSCustomPropertyValue that has the name/value pair.
+
+ * css/CSSParser.cpp:
+ (WebCore::filterProperties):
+ Patched to track seen custom properties and to handle them correctly.
+
+ (WebCore::CSSParser::createStyleProperties):
+ Pass in a seenCustomProperties table to ensure we bail when encountering the same custom property twice.
+
+ (WebCore::CSSParser::addCustomPropertyDeclaration):
+ Called from the grammar production to create the CSSCustomPropertyValue.
+
+ (WebCore::isCustomPropertyIdentifier):
+ Recognize the -- custom property during lexing.
+
+ (WebCore::CSSParser::parseIdentifier):
+ Patched to return a CUSTOM_PROPERTY token when a custom property is identified.
+
+ * css/CSSParser.h:
+ (WebCore::isCustomPropertyName):
+ Add a helper function for asking if a property name is custom.
+
+ * css/CSSValue.cpp:
+ (WebCore::CSSValue::equals):
+ (WebCore::CSSValue::cssText):
+ (WebCore::CSSValue::destroy):
+ * css/CSSValue.h:
+ Patched to add support for CSSCustomPropertyValue.
+
+ * css/PropertySetCSSStyleDeclaration.cpp:
+ (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
+ (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
+ (WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
+ (WebCore::PropertySetCSSStyleDeclaration::setProperty):
+ (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
+ Add code for handling custom properties in the CSS OM.
+
+ * css/StyleProperties.cpp:
+ (WebCore::StyleProperties::getPropertyValue):
+ (WebCore::StyleProperties::getCustomPropertyValue):
+ (WebCore::StyleProperties::getPropertyCSSValue):
+ (WebCore::StyleProperties::getCustomPropertyCSSValue):
+ (WebCore::MutableStyleProperties::removeProperty):
+ (WebCore::MutableStyleProperties::removeCustomProperty):
+ (WebCore::StyleProperties::propertyIsImportant):
+ (WebCore::StyleProperties::customPropertyIsImportant):
+ (WebCore::MutableStyleProperties::setProperty):
+ (WebCore::MutableStyleProperties::setCustomProperty):
+ (WebCore::MutableStyleProperties::addParsedProperty):
+ (WebCore::MutableStyleProperties::findPropertyIndex):
+ (WebCore::ImmutableStyleProperties::findCustomPropertyIndex):
+ (WebCore::MutableStyleProperties::findCustomPropertyIndex):
+ (WebCore::MutableStyleProperties::findCSSPropertyWithID):
+ (WebCore::MutableStyleProperties::findCustomCSSPropertyWithName):
+ (WebCore::StyleProperties::propertyMatches):
+ (WebCore::StyleProperties::PropertyReference::cssName):
+ * css/StyleProperties.h:
+ (WebCore::StyleProperties::findCustomPropertyIndex):
+ Patched to support handling custom properties in the CSS OM. We have to create equivalent methods that operate
+ on AtomicString propertyNames instead of on property IDs.
+
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::CascadedProperties::customProperties):
+ (WebCore::StyleResolver::styleForKeyframe):
+ (WebCore::StyleResolver::styleForPage):
+ (WebCore::StyleResolver::applyMatchedProperties):
+ (WebCore::StyleResolver::applyProperty):
+ (WebCore::StyleResolver::CascadedProperties::set):
+ (WebCore::StyleResolver::applyCascadedProperties):
+ The resolver has to hold a HashMap from AtomicStrings to Properties. It matches identically to how built-in
+ properties work except that an extensible table (HashMap) is used to hold the property data.
+
+ * css/makeprop.pl:
+ Patched to include the special CSSPropertyCustom value of 1 (just after the CSSPropertyInvalid id value but before the first
+ built-in property value).
+
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyle::getText):
+ (WebCore::lowercasePropertyName):
+ (WebCore::InspectorStyle::populateAllProperties):
+ Patch inspector to not lowercase CSS custom property names, since they are case-sensitive.
+
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleCustomPropertyData.h: Added.
+ (WebCore::StyleCustomPropertyData::create):
+ (WebCore::StyleCustomPropertyData::copy):
+ (WebCore::StyleCustomPropertyData::operator==):
+ (WebCore::StyleCustomPropertyData::operator!=):
+ (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
+ (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
+ (WebCore::StyleCustomPropertyData::hasCustomProperty):
+ (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
+ * rendering/style/StyleRareInheritedData.cpp:
+ (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+ (WebCore::StyleRareInheritedData::operator==):
+ * rendering/style/StyleRareInheritedData.h:
+ The front end storage in the RenderStyle for custom properties. For now, custom properties are always inherited, so the
+ data is in StyleRareInheritedData.
+
+2015-12-05 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r191452.
</span><span class="cx">
</span><span class="cx"> 2015-10-22 Wenson Hsieh <wenson_hsieh@apple.com>
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -5372,6 +5372,8 @@
</span><span class="cx">                 BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */; };
</span><span class="cx">                 BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC772E121331620C001EC9CE /* CSSLineBoxContainValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC772E16133162C2001EC9CE /* CSSLineBoxContainValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */; };
</span><ins>+                BC779E141BB215BB00CAA8BF /* CSSCustomPropertyValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC779E131BB215BB00CAA8BF /* CSSCustomPropertyValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                BC779E171BB227CA00CAA8BF /* StyleCustomPropertyData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC779E151BB226A200CAA8BF /* StyleCustomPropertyData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7F44A70B9E324E00A9D081 /* ImageObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC7FA6200D1F0CBD00DB22A9 /* LiveNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */; };
</span><span class="cx">                 BC7FA6210D1F0CBD00DB22A9 /* LiveNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -12931,6 +12933,8 @@
</span><span class="cx">                 BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MIMETypeRegistryMac.mm; sourceTree = "<group>"; };
</span><span class="cx">                 BC772E121331620C001EC9CE /* CSSLineBoxContainValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSLineBoxContainValue.h; sourceTree = "<group>"; };
</span><span class="cx">                 BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSLineBoxContainValue.cpp; sourceTree = "<group>"; };
</span><ins>+                BC779E131BB215BB00CAA8BF /* CSSCustomPropertyValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCustomPropertyValue.h; sourceTree = "<group>"; };
+                BC779E151BB226A200CAA8BF /* StyleCustomPropertyData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleCustomPropertyData.h; sourceTree = "<group>"; };
</ins><span class="cx">                 BC7B2AF80450824100A8000F /* Scrollbar.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Scrollbar.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 BC7F44A70B9E324E00A9D081 /* ImageObserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageObserver.h; sourceTree = "<group>"; };
</span><span class="cx">                 BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiveNodeList.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -21574,6 +21578,7 @@
</span><span class="cx">                                 9393E602151A9A1800066F06 /* StyleCachedImageSet.cpp */,
</span><span class="cx">                                 9393E603151A9A1800066F06 /* StyleCachedImageSet.h */,
</span><span class="cx">                                 9DAC7C561AF2CB6400437C44 /* StyleContentAlignmentData.h */,
</span><ins>+                                BC779E151BB226A200CAA8BF /* StyleCustomPropertyData.h */,
</ins><span class="cx">                                 BC5EB67E0E81D4A700B25965 /* StyleDashboardRegion.h */,
</span><span class="cx">                                 BC5EB8B60E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.cpp */,
</span><span class="cx">                                 BC5EB8B70E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.h */,
</span><span class="lines">@@ -22512,6 +22517,7 @@
</span><span class="cx">                                 2D8FEBDB143E3EF70072502B /* CSSCrossfadeValue.h */,
</span><span class="cx">                                 AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */,
</span><span class="cx">                                 AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */,
</span><ins>+                                BC779E131BB215BB00CAA8BF /* CSSCustomPropertyValue.h */,
</ins><span class="cx">                                 4A9CC81516BB9AC600EC645A /* CSSDefaultStyleSheets.cpp */,
</span><span class="cx">                                 4A9CC81616BB9AC600EC645A /* CSSDefaultStyleSheets.h */,
</span><span class="cx">                                 FB965B8217BBB62C00E835B9 /* CSSFilterImageValue.cpp */,
</span><span class="lines">@@ -24864,6 +24870,7 @@
</span><span class="cx">                                 A8CFF04F0A154F09000A4234 /* FixedTableLayout.h in Headers */,
</span><span class="cx">                                 BC073BAA0C399B1F000F5979 /* FloatConversion.h in Headers */,
</span><span class="cx">                                 9A528E8417D7F52F00AA9518 /* FloatingObjects.h in Headers */,
</span><ins>+                                BC779E171BB227CA00CAA8BF /* StyleCustomPropertyData.h in Headers */,
</ins><span class="cx">                                 FE699872192087E7006936BD /* FloatingPointEnvironment.h in Headers */,
</span><span class="cx">                                 B27535690B053814002CE64F /* FloatPoint.h in Headers */,
</span><span class="cx">                                 B2E27CA00B0F2B0900F17C7B /* FloatPoint3D.h in Headers */,
</span><span class="lines">@@ -25859,6 +25866,7 @@
</span><span class="cx">                                 141DC053164834B900371E5A /* LayoutRect.h in Headers */,
</span><span class="cx">                                 A12538D413F9B60A00024754 /* LayoutRepainter.h in Headers */,
</span><span class="cx">                                 141DC054164834B900371E5A /* LayoutSize.h in Headers */,
</span><ins>+                                BC779E141BB215BB00CAA8BF /* CSSCustomPropertyValue.h in Headers */,
</ins><span class="cx">                                 2D9066070BE141D400956998 /* LayoutState.h in Headers */,
</span><span class="cx">                                 141DC0481648348F00371E5A /* LayoutUnit.h in Headers */,
</span><span class="cx">                                 E4C3B1FA0F0E4161009693F6 /* LegacyTileCache.h in Headers */,
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "CSSAspectRatioValue.h"
</span><span class="cx"> #include "CSSBasicShapes.h"
</span><span class="cx"> #include "CSSBorderImage.h"
</span><ins>+#include "CSSCustomPropertyValue.h"
</ins><span class="cx"> #include "CSSFontFeatureValue.h"
</span><span class="cx"> #include "CSSFontValue.h"
</span><span class="cx"> #include "CSSFunctionValue.h"
</span><span class="lines">@@ -1882,6 +1883,20 @@
</span><span class="cx"> return result.release();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& propertyName) const
+{
+ Node* styledNode = this->styledNode();
+ if (!styledNode)
+ return nullptr;
+
+ RefPtr<RenderStyle> style = computeRenderStyleForProperty(styledNode, m_pseudoElementSpecifier, CSSPropertyCustom);
+ if (!style || !style->hasCustomProperty(propertyName))
+ return nullptr;
+
+ String result = style->getCustomPropertyValue(propertyName);
+ return CSSCustomPropertyValue::create(propertyName, result);
+}
+
</ins><span class="cx"> PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</span><span class="cx"> {
</span><span class="cx"> Node* styledNode = this->styledNode();
</span><span class="lines">@@ -3344,6 +3359,9 @@
</span><span class="cx"> case CSSPropertyWritingMode:
</span><span class="cx"> case CSSPropertyWebkitSvgShadow:
</span><span class="cx"> return svgPropertyValue(propertyID, DoNotUpdateLayout);
</span><ins>+ case CSSPropertyCustom:
+ ASSERT_NOT_REACHED();
+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> logUnimplementedPropertyID(propertyID);
</span><span class="lines">@@ -3368,15 +3386,35 @@
</span><span class="cx"> if (!style)
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- return numComputedProperties;
</del><ins>+ const HashMap<AtomicString, String>* customProperties = style->customProperties();
+ return numComputedProperties + (customProperties ? customProperties->size() : 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String CSSComputedStyleDeclaration::item(unsigned i) const
</span><span class="cx"> {
</span><span class="cx"> if (i >= length())
</span><span class="cx"> return emptyString();
</span><ins>+
+ if (i < numComputedProperties)
+ return getPropertyNameString(computedProperties[i]);
+
+ Node* node = m_node.get();
+ if (!node)
+ return emptyString();
</ins><span class="cx">
</span><del>- return getPropertyNameString(computedProperties[i]);
</del><ins>+ RenderStyle* style = node->computedStyle(m_pseudoElementSpecifier);
+ if (!style)
+ return emptyString();
+
+ unsigned index = i - numComputedProperties;
+
+ const auto* customProperties = style->customProperties();
+ if (!customProperties || index >= customProperties->size())
+ return emptyString();
+
+ Vector<String, 4> results;
+ copyKeysToVector(*customProperties, results);
+ return results.at(index);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool ComputedStyleExtractor::propertyMatches(CSSPropertyID propertyID, const CSSValue* value) const
</span><span class="lines">@@ -3457,6 +3495,22 @@
</span><span class="cx"> if (value)
</span><span class="cx"> list.append(CSSProperty(set[i], value.release(), false));
</span><span class="cx"> }
</span><ins>+
+ auto* styledNode = this->styledNode();
+ if (styledNode) {
+ RefPtr<RenderStyle> style = computeRenderStyleForProperty(styledNode, m_pseudoElementSpecifier, CSSPropertyCustom);
+ if (style) {
+ const auto* customProperties = style->customProperties();
+ if (customProperties) {
+ HashMap<AtomicString, String>::const_iterator end = customProperties->end();
+ for (HashMap<AtomicString, String>::const_iterator it = customProperties->begin(); it != end; ++it) {
+ RefPtr<CSSCustomPropertyValue> value = CSSCustomPropertyValue::create(it->key, it->value);
+ list.append(CSSProperty(CSSPropertyCustom, value.release(), false));
+ }
+ }
+ }
+ }
+
</ins><span class="cx"> return MutableStyleProperties::create(list.data(), list.size());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3467,6 +3521,11 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(const String& propertyName)
</span><span class="cx"> {
</span><ins>+ if (isCustomPropertyName(propertyName)) {
+ RefPtr<CSSValue> value = ComputedStyleExtractor(m_node, m_allowVisitedStyle, m_pseudoElementSpecifier).customPropertyValue(propertyName);
+ return value ? value->cloneForCSSOM() : nullptr;
+ }
+
</ins><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx"> if (!propertyID)
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -3476,6 +3535,13 @@
</span><span class="cx">
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyValue(const String &propertyName)
</span><span class="cx"> {
</span><ins>+ if (isCustomPropertyName(propertyName)) {
+ RefPtr<CSSValue> value = ComputedStyleExtractor(m_node, m_allowVisitedStyle, m_pseudoElementSpecifier).customPropertyValue(propertyName);
+ if (!value)
+ return String();
+ return value->cssText();
+ }
+
</ins><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx"> if (!propertyID)
</span><span class="cx"> return String();
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSComputedStyleDeclarationh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.h (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.h        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSComputedStyleDeclaration.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> ComputedStyleExtractor(PassRefPtr<Node>, bool allowVisitedStyle = false, PseudoId = NOPSEUDO);
</span><span class="cx">
</span><span class="cx"> PassRefPtr<CSSValue> propertyValue(CSSPropertyID, EUpdateLayout = UpdateLayout) const;
</span><ins>+ RefPtr<CSSValue> customPropertyValue(const String& propertyName) const;
</ins><span class="cx">
</span><span class="cx"> // Helper methods for HTML editing.
</span><span class="cx"> Ref<MutableStyleProperties> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSCustomPropertyValuehfromrev193501branchessafari601branchSourceWebCorecssCSSCustomPropertyValueh"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46-branch/Source/WebCore/css/CSSCustomPropertyValue.h (from rev 193501, branches/safari-601-branch/Source/WebCore/css/CSSCustomPropertyValue.h) (0 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSCustomPropertyValue.h         (rev 0)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSCustomPropertyValue.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CSSCustomPropertyValue_h
+#define CSSCustomPropertyValue_h
+
+#include "CSSValue.h"
+
+namespace WebCore {
+
+class CSSCustomPropertyValue : public CSSValue {
+public:
+ static Ref<CSSCustomPropertyValue> create(const AtomicString& name, const String& value)
+ {
+ return adoptRef(*new CSSCustomPropertyValue(name, value));
+ }
+
+ bool equals(const CSSCustomPropertyValue& other) const { return m_name == other.m_name && m_value == other.m_value; }
+
+ String customCSSText() const { return value(); }
+
+ const AtomicString& name() const { return m_name; }
+ const String& value() const { return m_value; }
+
+private:
+ CSSCustomPropertyValue(const AtomicString& name, const String& value)
+ : CSSValue(CustomPropertyClass)
+ , m_name(name)
+ , m_value(value)
+ {
+ }
+
+ const AtomicString m_name;
+ const String m_value;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCustomPropertyValue, isCustomPropertyValue())
+
+#endif // CSSCustomPropertyValue_h
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/CSSGrammar.y.in (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSGrammar.y.in        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSGrammar.y.in        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> case DIRFUNCTION:
</span><span class="cx"> case ROLEFUNCTION:
</span><span class="cx"> #endif
</span><ins>+ case CUSTOM_PROPERTY:
</ins><span class="cx"> case UNICODERANGE:
</span><span class="cx"> return true;
</span><span class="cx"> default:
</span><span class="lines">@@ -223,6 +224,8 @@
</span><span class="cx"> %token <string> ROLEFUNCTION
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+%token <string> CUSTOM_PROPERTY
+
</ins><span class="cx"> %token <string> UNICODERANGE
</span><span class="cx">
</span><span class="cx"> %union { CSSParserSelectorCombinator relation; }
</span><span class="lines">@@ -1535,7 +1538,13 @@
</span><span class="cx"> ;
</span><span class="cx">
</span><span class="cx"> declaration:
</span><del>- property ':' maybe_space expr priority {
</del><ins>+ CUSTOM_PROPERTY maybe_space ':' maybe_space expr priority {
+ std::unique_ptr<CSSParserValueList> propertyValue($5);
+ parser->addCustomPropertyDeclaration($1, propertyValue.get(), $6);
+ $$ = true;
+ parser->markPropertyEnd($6, true);
+ }
+ | property ':' maybe_space expr priority {
</ins><span class="cx"> $$ = false;
</span><span class="cx"> bool isPropertyParsed = false;
</span><span class="cx"> std::unique_ptr<CSSParserValueList> propertyValue($4);
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "CSSContentDistributionValue.h"
</span><span class="cx"> #include "CSSCrossfadeValue.h"
</span><span class="cx"> #include "CSSCursorImageValue.h"
</span><ins>+#include "CSSCustomPropertyValue.h"
</ins><span class="cx"> #include "CSSFilterImageValue.h"
</span><span class="cx"> #include "CSSFontFaceRule.h"
</span><span class="cx"> #include "CSSFontFaceSrcValue.h"
</span><span class="lines">@@ -1568,13 +1569,23 @@
</span><span class="cx"> return SourceSize(WTF::move(expression), WTF::move(value));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline void filterProperties(bool important, const CSSParser::ParsedPropertyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, std::bitset<numCSSProperties>& seenProperties)
</del><ins>+static inline void filterProperties(bool important, const CSSParser::ParsedPropertyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, std::bitset<numCSSProperties>& seenProperties, HashSet<AtomicString>& seenCustomProperties)
</ins><span class="cx"> {
</span><span class="cx"> // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
</span><span class="cx"> for (int i = input.size() - 1; i >= 0; --i) {
</span><span class="cx"> const CSSProperty& property = input[i];
</span><span class="cx"> if (property.isImportant() != important)
</span><span class="cx"> continue;
</span><ins>+
+ if (property.id() == CSSPropertyCustom) {
+ const AtomicString& name = downcast<CSSCustomPropertyValue>(*property.value()).name();
+ if (seenCustomProperties.contains(name))
+ continue;
+ seenCustomProperties.add(name);
+ output[--unusedEntries] = property;
+ continue;
+ }
+
</ins><span class="cx"> const unsigned propertyIDIndex = property.id() - firstCSSProperty;
</span><span class="cx"> ASSERT(propertyIDIndex < seenProperties.size());
</span><span class="cx"> if (seenProperties[propertyIDIndex])
</span><span class="lines">@@ -1591,8 +1602,9 @@
</span><span class="cx"> Vector<CSSProperty, 256> results(unusedEntries);
</span><span class="cx">
</span><span class="cx"> // Important properties have higher priority, so add them first. Duplicate definitions can then be ignored when found.
</span><del>- filterProperties(true, m_parsedProperties, results, unusedEntries, seenProperties);
- filterProperties(false, m_parsedProperties, results, unusedEntries, seenProperties);
</del><ins>+ HashSet<AtomicString> seenCustomProperties;
+ filterProperties(true, m_parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties);
+ filterProperties(false, m_parsedProperties, results, unusedEntries, seenProperties, seenCustomProperties);
</ins><span class="cx"> if (unusedEntries)
</span><span class="cx"> results.remove(0, unusedEntries);
</span><span class="cx">
</span><span class="lines">@@ -4096,7 +4108,29 @@
</span><span class="cx">
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><del>-
</del><ins>+
+void CSSParser::addCustomPropertyDeclaration(const CSSParserString& name, CSSParserValueList* value, bool important)
+{
+ if (!value)
+ return;
+
+ // The custom property comes in as a parsed set of CSSParserValues collected into a list.
+ // For CSS variables, we just want to treat the entire set of values as a string, so what we do
+ // is build up a set of CSSValues and serialize them using cssText, separating multiple values
+ // with spaces.
+ AtomicString propertyName = name;
+ StringBuilder builder;
+ for (unsigned i = 0; i < value->size(); i++) {
+ if (i)
+ builder.append(' ');
+ RefPtr<CSSValue> cssValue = value->valueAt(i)->createCSSValue();
+ if (!cssValue)
+ return;
+ builder.append(cssValue->cssText());
+ }
+ addProperty(CSSPropertyCustom, CSSCustomPropertyValue::create(propertyName, builder.toString().lower()), important, false);
+}
+
</ins><span class="cx"> // [ <string> | <uri> | <counter> | attr(X) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit
</span><span class="cx"> // in CSS 2.1 this got somewhat reduced:
</span><span class="cx"> // [ <string> | attr(X) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit
</span><span class="lines">@@ -10745,6 +10779,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename CharacterType>
</span><ins>+static inline bool isCustomPropertyIdentifier(CharacterType* currentCharacter)
+{
+ return isASCIIAlpha(currentCharacter[0]) || currentCharacter[0] == '_' || currentCharacter[0] >= 128
+ || (currentCharacter[0] == '\\' && isCSSEscape(currentCharacter[1]));
+}
+
+template <typename CharacterType>
</ins><span class="cx"> static inline bool isEqualToCSSIdentifier(CharacterType* cssString, const char* constantString)
</span><span class="cx"> {
</span><span class="cx"> // Compare an character memory data with a zero terminated string.
</span><span class="lines">@@ -10983,10 +11024,6 @@
</span><span class="cx"> template <typename CharacterType>
</span><span class="cx"> inline void CSSParser::parseIdentifier(CharacterType*& result, CSSParserString& resultString, bool& hasEscape)
</span><span class="cx"> {
</span><del>- // If a valid identifier start is found, we can safely
- // parse the identifier until the next invalid character.
- ASSERT(isIdentifierStart<CharacterType>());
-
</del><span class="cx"> CharacterType* start = currentCharacter<CharacterType>();
</span><span class="cx"> if (UNLIKELY(!parseIdentifierInternal(currentCharacter<CharacterType>(), result, hasEscape))) {
</span><span class="cx"> // Found an escape we couldn't handle with 8 bits, copy what has been recognized and continue
</span><span class="lines">@@ -11926,6 +11963,11 @@
</span><span class="cx"> }
</span><span class="cx"> resultString.setLength(result - tokenStart<SrcCharacterType>());
</span><span class="cx"> yylval->string = resultString;
</span><ins>+ } else if (currentCharacter<SrcCharacterType>()[0] == '-' && isIdentifierStartAfterDash(currentCharacter<SrcCharacterType>() + 1)) {
+ --currentCharacter<SrcCharacterType>();
+ parseIdentifier(result, resultString, hasEscape);
+ m_token = CUSTOM_PROPERTY;
+ yylval->string = resultString;
</ins><span class="cx"> } else if (currentCharacter<SrcCharacterType>()[0] == '-' && currentCharacter<SrcCharacterType>()[1] == '>') {
</span><span class="cx"> currentCharacter<SrcCharacterType>() += 2;
</span><span class="cx"> m_token = SGML_CD;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.h (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.h        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSParser.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -143,8 +143,9 @@
</span><span class="cx"> bool parseQuotes(CSSPropertyID, bool important);
</span><span class="cx"> bool parseAlt(CSSPropertyID, bool important);
</span><span class="cx">
</span><ins>+ void addCustomPropertyDeclaration(const CSSParserString&, CSSParserValueList*, bool important);
+
</ins><span class="cx"> PassRefPtr<CSSValue> parseAttr(CSSParserValueList& args);
</span><del>-
</del><span class="cx"> PassRefPtr<CSSValue> parseBackgroundColor();
</span><span class="cx">
</span><span class="cx"> struct SourceSize {
</span><span class="lines">@@ -753,6 +754,11 @@
</span><span class="cx"> return *m_tokenStart.ptr16;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline bool isCustomPropertyName(const String& propertyName)
+{
+ return propertyName.length() > 2 && propertyName.characterAt(0) == '-' && propertyName.characterAt(1) == '-';
+}
+
</ins><span class="cx"> inline int cssyylex(void* yylval, CSSParser* parser)
</span><span class="cx"> {
</span><span class="cx"> return parser->lex(yylval);
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSValuecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "CSSContentDistributionValue.h"
</span><span class="cx"> #include "CSSCrossfadeValue.h"
</span><span class="cx"> #include "CSSCursorImageValue.h"
</span><ins>+#include "CSSCustomPropertyValue.h"
</ins><span class="cx"> #include "CSSFilterImageValue.h"
</span><span class="cx"> #include "CSSFontFaceSrcValue.h"
</span><span class="cx"> #include "CSSFontFeatureValue.h"
</span><span class="lines">@@ -236,6 +237,9 @@
</span><span class="cx"> #endif
</span><span class="cx"> case CSSContentDistributionClass:
</span><span class="cx"> return compareCSSValues<CSSContentDistributionValue>(*this, other);
</span><ins>+ case CustomPropertyClass:
+ return compareCSSValues<CSSCustomPropertyValue>(*this, other);
+
</ins><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return false;
</span><span class="lines">@@ -330,7 +334,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> case CSSContentDistributionClass:
</span><span class="cx"> return downcast<CSSContentDistributionValue>(*this).customCSSText();
</span><ins>+ case CustomPropertyClass:
+ return downcast<CSSCustomPropertyValue>(*this).customCSSText();
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="lines">@@ -453,6 +460,9 @@
</span><span class="cx"> case CSSContentDistributionClass:
</span><span class="cx"> delete downcast<CSSContentDistributionValue>(this);
</span><span class="cx"> return;
</span><ins>+ case CustomPropertyClass:
+ delete downcast<CSSCustomPropertyValue>(this);
+ return;
</ins><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssCSSValueh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.h (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.h        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/CSSValue.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx"> bool isCanvasValue() const { return m_classType == CanvasClass; }
</span><span class="cx"> bool isCrossfadeValue() const { return m_classType == CrossfadeClass; }
</span><span class="cx"> bool isCursorImageValue() const { return m_classType == CursorImageClass; }
</span><ins>+ bool isCustomPropertyValue() const { return m_classType == CustomPropertyClass; }
</ins><span class="cx"> bool isFunctionValue() const { return m_classType == FunctionClass; }
</span><span class="cx"> bool isFontFeatureValue() const { return m_classType == FontFeatureClass; }
</span><span class="cx"> bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; }
</span><span class="lines">@@ -176,7 +177,8 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> CSSContentDistributionClass,
</span><del>-
</del><ins>+ CustomPropertyClass,
+
</ins><span class="cx"> // List class types must appear after ValueListClass.
</span><span class="cx"> ValueListClass,
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssPropertySetCSSStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PropertySetCSSStyleDeclaration.h"
</span><span class="cx">
</span><ins>+#include "CSSCustomPropertyValue.h"
</ins><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="lines">@@ -162,6 +163,13 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<CSSValue> PropertySetCSSStyleDeclaration::getPropertyCSSValue(const String& propertyName)
</span><span class="cx"> {
</span><ins>+ if (isCustomPropertyName(propertyName)) {
+ RefPtr<CSSValue> value = m_propertySet->getCustomPropertyCSSValue(propertyName);
+ if (!value)
+ return nullptr;
+ return cloneAndCacheForCSSOM(value.get());
+ }
+
</ins><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx"> if (!propertyID)
</span><span class="cx"> return 0;
</span><span class="lines">@@ -170,6 +178,9 @@
</span><span class="cx">
</span><span class="cx"> String PropertySetCSSStyleDeclaration::getPropertyValue(const String& propertyName)
</span><span class="cx"> {
</span><ins>+ if (isCustomPropertyName(propertyName))
+ return m_propertySet->getCustomPropertyValue(propertyName);
+
</ins><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx"> if (!propertyID)
</span><span class="cx"> return String();
</span><span class="lines">@@ -178,6 +189,9 @@
</span><span class="cx">
</span><span class="cx"> String PropertySetCSSStyleDeclaration::getPropertyPriority(const String& propertyName)
</span><span class="cx"> {
</span><ins>+ if (isCustomPropertyName(propertyName))
+ return m_propertySet->customPropertyIsImportant(propertyName) ? "important" : "";
+
</ins><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx"> if (!propertyID)
</span><span class="cx"> return String();
</span><span class="lines">@@ -203,7 +217,10 @@
</span><span class="cx"> void PropertySetCSSStyleDeclaration::setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> StyleAttributeMutationScope mutationScope(this);
</span><ins>+
</ins><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><ins>+ if (isCustomPropertyName(propertyName))
+ propertyID = CSSPropertyCustom;
</ins><span class="cx"> if (!propertyID)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -213,7 +230,7 @@
</span><span class="cx"> bool important = priority.find("important", 0, false) != notFound;
</span><span class="cx">
</span><span class="cx"> ec = 0;
</span><del>- bool changed = m_propertySet->setProperty(propertyID, value, important, contextStyleSheet());
</del><ins>+ bool changed = propertyID != CSSPropertyCustom ? m_propertySet->setProperty(propertyID, value, important, contextStyleSheet()) : m_propertySet->setCustomProperty(propertyName, value, important, contextStyleSheet());
</ins><span class="cx">
</span><span class="cx"> didMutate(changed ? PropertyChanged : NoChanges);
</span><span class="cx">
</span><span class="lines">@@ -228,6 +245,8 @@
</span><span class="cx"> {
</span><span class="cx"> StyleAttributeMutationScope mutationScope(this);
</span><span class="cx"> CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><ins>+ if (isCustomPropertyName(propertyName))
+ propertyID = CSSPropertyCustom;
</ins><span class="cx"> if (!propertyID)
</span><span class="cx"> return String();
</span><span class="cx">
</span><span class="lines">@@ -236,7 +255,7 @@
</span><span class="cx">
</span><span class="cx"> ec = 0;
</span><span class="cx"> String result;
</span><del>- bool changed = m_propertySet->removeProperty(propertyID, &result);
</del><ins>+ bool changed = propertyID != CSSPropertyCustom ? m_propertySet->removeProperty(propertyID, &result) : m_propertySet->removeCustomProperty(propertyName, &result);
</ins><span class="cx">
</span><span class="cx"> didMutate(changed ? PropertyChanged : NoChanges);
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssStylePropertiescpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include "StyleProperties.h"
</span><span class="cx">
</span><span class="cx"> #include "CSSComputedStyleDeclaration.h"
</span><ins>+#include "CSSCustomPropertyValue.h"
</ins><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSValueKeywords.h"
</span><span class="cx"> #include "CSSValueList.h"
</span><span class="lines">@@ -220,6 +221,14 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String StyleProperties::getCustomPropertyValue(const String& propertyName) const
+{
+ RefPtr<CSSValue> value = getCustomPropertyCSSValue(propertyName);
+ if (value)
+ return value->cssText();
+ return String();
+}
+
</ins><span class="cx"> String StyleProperties::borderSpacingValue(const StylePropertyShorthand& shorthand) const
</span><span class="cx"> {
</span><span class="cx"> RefPtr<CSSValue> horizontalValue = getPropertyCSSValue(shorthand.properties()[0]);
</span><span class="lines">@@ -587,6 +596,14 @@
</span><span class="cx"> return propertyAt(foundPropertyIndex).value();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+RefPtr<CSSValue> StyleProperties::getCustomPropertyCSSValue(const String& propertyName) const
+{
+ int foundPropertyIndex = findCustomPropertyIndex(propertyName);
+ if (foundPropertyIndex == -1)
+ return nullptr;
+ return propertyAt(foundPropertyIndex).value();
+}
+
</ins><span class="cx"> bool MutableStyleProperties::removeShorthandProperty(CSSPropertyID propertyID)
</span><span class="cx"> {
</span><span class="cx"> StylePropertyShorthand shorthand = shorthandForProperty(propertyID);
</span><span class="lines">@@ -631,6 +648,25 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool MutableStyleProperties::removeCustomProperty(const String& propertyName, String* returnText)
+{
+ int foundPropertyIndex = findCustomPropertyIndex(propertyName);
+ if (foundPropertyIndex == -1) {
+ if (returnText)
+ *returnText = "";
+ return false;
+ }
+
+ if (returnText)
+ *returnText = propertyAt(foundPropertyIndex).value()->cssText();
+
+ // A more efficient removal strategy would involve marking entries as empty
+ // and sweeping them when the vector grows too big.
+ m_propertyVector.remove(foundPropertyIndex);
+
+ return true;
+}
+
</ins><span class="cx"> void MutableStyleProperties::removePrefixedOrUnprefixedProperty(CSSPropertyID propertyID)
</span><span class="cx"> {
</span><span class="cx"> int foundPropertyIndex = findPropertyIndex(prefixingVariantForPropertyId(propertyID));
</span><span class="lines">@@ -656,6 +692,14 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool StyleProperties::customPropertyIsImportant(const String& propertyName) const
+{
+ int foundPropertyIndex = findCustomPropertyIndex(propertyName);
+ if (foundPropertyIndex != -1)
+ return propertyAt(foundPropertyIndex).isImportant();
+ return false;
+}
+
</ins><span class="cx"> String StyleProperties::getPropertyShorthand(CSSPropertyID propertyID) const
</span><span class="cx"> {
</span><span class="cx"> int foundPropertyIndex = findPropertyIndex(propertyID);
</span><span class="lines">@@ -684,6 +728,21 @@
</span><span class="cx"> return CSSParser::parseValue(this, propertyID, value, important, cssParserMode(), contextStyleSheet) == CSSParser::ParseResult::Changed;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool MutableStyleProperties::setCustomProperty(const String& propertyName, const String& value, bool important, StyleSheetContents* /*contextStyleSheet*/)
+{
+ // Setting the value to an empty string just removes the property in both IE and Gecko.
+ // Setting it to null seems to produce less consistent results, but we treat it just the same.
+ if (value.isEmpty())
+ return removeCustomProperty(propertyName);
+
+ // When replacing an existing property value, this moves the property to the end of the list.
+ // Firefox preserves the position, and MSIE moves the property to the beginning.
+ RefPtr<CSSCustomPropertyValue> customValue = CSSCustomPropertyValue::create(propertyName, value);
+ addParsedProperty(CSSProperty(CSSPropertyCustom, customValue, important));
+
+ return true;
+}
+
</ins><span class="cx"> void MutableStyleProperties::setProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> prpValue, bool important)
</span><span class="cx"> {
</span><span class="cx"> StylePropertyShorthand shorthand = shorthandForProperty(propertyID);
</span><span class="lines">@@ -702,7 +761,15 @@
</span><span class="cx"> bool MutableStyleProperties::setProperty(const CSSProperty& property, CSSProperty* slot)
</span><span class="cx"> {
</span><span class="cx"> if (!removeShorthandProperty(property.id())) {
</span><del>- CSSProperty* toReplace = slot ? slot : findCSSPropertyWithID(property.id());
</del><ins>+ CSSProperty* toReplace = slot;
+ if (!slot) {
+ if (property.id() == CSSPropertyCustom) {
+ if (property.value())
+ toReplace = findCustomCSSPropertyWithName(downcast<CSSCustomPropertyValue>(*property.value()).name());
+ } else
+ toReplace = findCSSPropertyWithID(property.id());
+ }
+
</ins><span class="cx"> if (toReplace) {
</span><span class="cx"> if (*toReplace == property)
</span><span class="cx"> return false;
</span><span class="lines">@@ -781,6 +848,12 @@
</span><span class="cx">
</span><span class="cx"> bool MutableStyleProperties::addParsedProperty(const CSSProperty& property)
</span><span class="cx"> {
</span><ins>+ if (property.id() == CSSPropertyCustom) {
+ if ((property.value() && !customPropertyIsImportant(downcast<CSSCustomPropertyValue>(*property.value()).name())) || property.isImportant())
+ return setProperty(property);
+ return false;
+ }
+
</ins><span class="cx"> // Only add properties that have no !important counterpart present
</span><span class="cx"> if (!propertyIsImportant(property.id()) || property.isImportant())
</span><span class="cx"> return setProperty(property);
</span><span class="lines">@@ -973,12 +1046,17 @@
</span><span class="cx"> } else
</span><span class="cx"> value = property.value()->cssText();
</span><span class="cx">
</span><del>- if (value == "initial" && !CSSProperty::isInheritedProperty(propertyID))
</del><ins>+ if (propertyID != CSSPropertyCustom && value == "initial" && !CSSProperty::isInheritedProperty(propertyID))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> if (numDecls++)
</span><span class="cx"> result.append(' ');
</span><del>- result.append(getPropertyName(propertyID));
</del><ins>+
+ if (propertyID == CSSPropertyCustom)
+ result.append(downcast<CSSCustomPropertyValue>(*property.value()).name());
+ else
+ result.append(getPropertyName(propertyID));
+
</ins><span class="cx"> result.appendLiteral(": ");
</span><span class="cx"> result.append(value);
</span><span class="cx"> if (property.isImportant())
</span><span class="lines">@@ -1175,6 +1253,40 @@
</span><span class="cx"> return -1;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+int ImmutableStyleProperties::findCustomPropertyIndex(const String& propertyName) const
+{
+ // Convert the propertyID into an uint16_t to compare it with the metadata's m_propertyID to avoid
+ // the compiler converting it to an int multiple times in the loop.
+ for (int n = m_arraySize - 1 ; n >= 0; --n) {
+ if (metadataArray()[n].m_propertyID == CSSPropertyCustom) {
+ // We found a custom property. See if the name matches.
+ if (!valueArray()[n])
+ continue;
+ if (downcast<CSSCustomPropertyValue>(*valueArray()[n]).name() == propertyName)
+ return n;
+ }
+ }
+
+ return -1;
+}
+
+int MutableStyleProperties::findCustomPropertyIndex(const String& propertyName) const
+{
+ // Convert the propertyID into an uint16_t to compare it with the metadata's m_propertyID to avoid
+ // the compiler converting it to an int multiple times in the loop.
+ for (int n = m_propertyVector.size() - 1 ; n >= 0; --n) {
+ if (m_propertyVector.at(n).metadata().m_propertyID == CSSPropertyCustom) {
+ // We found a custom property. See if the name matches.
+ if (!m_propertyVector.at(n).value())
+ continue;
+ if (downcast<CSSCustomPropertyValue>(*m_propertyVector.at(n).value()).name() == propertyName)
+ return n;
+ }
+ }
+
+ return -1;
+}
+
</ins><span class="cx"> CSSProperty* MutableStyleProperties::findCSSPropertyWithID(CSSPropertyID propertyID)
</span><span class="cx"> {
</span><span class="cx"> int foundPropertyIndex = findPropertyIndex(propertyID);
</span><span class="lines">@@ -1183,6 +1295,14 @@
</span><span class="cx"> return &m_propertyVector.at(foundPropertyIndex);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+CSSProperty* MutableStyleProperties::findCustomCSSPropertyWithName(const String& propertyName)
+{
+ int foundPropertyIndex = findCustomPropertyIndex(propertyName);
+ if (foundPropertyIndex == -1)
+ return 0;
+ return &m_propertyVector.at(foundPropertyIndex);
+}
+
</ins><span class="cx"> bool StyleProperties::propertyMatches(CSSPropertyID propertyID, const CSSValue* propertyValue) const
</span><span class="cx"> {
</span><span class="cx"> int foundPropertyIndex = findPropertyIndex(propertyID);
</span><span class="lines">@@ -1265,6 +1385,8 @@
</span><span class="cx">
</span><span class="cx"> String StyleProperties::PropertyReference::cssName() const
</span><span class="cx"> {
</span><ins>+ if (id() == CSSPropertyCustom)
+ return downcast<CSSCustomPropertyValue>(*value()).name();
</ins><span class="cx"> return getPropertyNameString(id());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssStylePropertiesh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.h (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.h        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/StyleProperties.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -92,6 +92,10 @@
</span><span class="cx"> String getPropertyShorthand(CSSPropertyID) const;
</span><span class="cx"> bool isPropertyImplicit(CSSPropertyID) const;
</span><span class="cx">
</span><ins>+ RefPtr<CSSValue> getCustomPropertyCSSValue(const String& propertyName) const;
+ String getCustomPropertyValue(const String& propertyName) const;
+ bool customPropertyIsImportant(const String& propertyName) const;
+
</ins><span class="cx"> Ref<MutableStyleProperties> copyBlockProperties() const;
</span><span class="cx">
</span><span class="cx"> CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cssParserMode); }
</span><span class="lines">@@ -132,7 +136,8 @@
</span><span class="cx"> { }
</span><span class="cx">
</span><span class="cx"> int findPropertyIndex(CSSPropertyID) const;
</span><del>-
</del><ins>+ int findCustomPropertyIndex(const String& propertyName) const;
+
</ins><span class="cx"> unsigned m_cssParserMode : 2;
</span><span class="cx"> mutable unsigned m_isMutable : 1;
</span><span class="cx"> unsigned m_arraySize : 29;
</span><span class="lines">@@ -163,7 +168,8 @@
</span><span class="cx"> const CSSValue** valueArray() const;
</span><span class="cx"> const StylePropertyMetadata* metadataArray() const;
</span><span class="cx"> int findPropertyIndex(CSSPropertyID) const;
</span><del>-
</del><ins>+ int findCustomPropertyIndex(const String& propertyName) const;
+
</ins><span class="cx"> void* m_storage;
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -221,9 +227,14 @@
</span><span class="cx"> CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(StyledElement* parentElement);
</span><span class="cx">
</span><span class="cx"> int findPropertyIndex(CSSPropertyID) const;
</span><del>-
</del><ins>+ int findCustomPropertyIndex(const String& propertyName) const;
+
</ins><span class="cx"> Vector<CSSProperty, 4> m_propertyVector;
</span><span class="cx">
</span><ins>+ // Methods for querying and altering CSS custom properties.
+ bool setCustomProperty(const String& propertyName, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0);
+ bool removeCustomProperty(const String& propertyName, String* returnText = nullptr);
+
</ins><span class="cx"> private:
</span><span class="cx"> explicit MutableStyleProperties(CSSParserMode);
</span><span class="cx"> explicit MutableStyleProperties(const StyleProperties&);
</span><span class="lines">@@ -231,6 +242,7 @@
</span><span class="cx">
</span><span class="cx"> bool removeShorthandProperty(CSSPropertyID);
</span><span class="cx"> CSSProperty* findCSSPropertyWithID(CSSPropertyID);
</span><ins>+ CSSProperty* findCustomCSSPropertyWithName(const String&);
</ins><span class="cx"> std::unique_ptr<PropertySetCSSStyleDeclaration> m_cssomWrapper;
</span><span class="cx">
</span><span class="cx"> friend class StyleProperties;
</span><span class="lines">@@ -279,6 +291,13 @@
</span><span class="cx"> return downcast<ImmutableStyleProperties>(*this).findPropertyIndex(propertyID);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline int StyleProperties::findCustomPropertyIndex(const String& propertyName) const
+{
+ if (is<MutableStyleProperties>(*this))
+ return downcast<MutableStyleProperties>(*this).findCustomPropertyIndex(propertyName);
+ return downcast<ImmutableStyleProperties>(*this).findCustomPropertyIndex(propertyName);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MutableStyleProperties)
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/StyleResolver.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/StyleResolver.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/StyleResolver.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "CSSBorderImage.h"
</span><span class="cx"> #include "CSSCalculationValue.h"
</span><span class="cx"> #include "CSSCursorImageValue.h"
</span><ins>+#include "CSSCustomPropertyValue.h"
</ins><span class="cx"> #include "CSSDefaultStyleSheets.h"
</span><span class="cx"> #include "CSSFilterImageValue.h"
</span><span class="cx"> #include "CSSFontFaceRule.h"
</span><span class="lines">@@ -140,6 +141,7 @@
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/TemporaryChange.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><ins>+#include <wtf/text/AtomicStringHash.h>
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx"> #include "CSSGridLineNamesValue.h"
</span><span class="lines">@@ -190,14 +192,17 @@
</span><span class="cx">
</span><span class="cx"> void applyDeferredProperties(StyleResolver&);
</span><span class="cx">
</span><ins>+ HashMap<AtomicString, Property>& customProperties() { return m_customProperties; }
+
</ins><span class="cx"> private:
</span><span class="cx"> void addStyleProperties(const StyleProperties&, StyleRule&, bool isImportant, bool inheritedOnly, PropertyWhitelistType, unsigned linkMatchType);
</span><span class="cx"> static void setPropertyInternal(Property&, CSSPropertyID, CSSValue&, unsigned linkMatchType);
</span><span class="cx">
</span><del>- Property m_properties[numCSSProperties + 1];
- std::bitset<numCSSProperties + 1> m_propertyIsPresent;
</del><ins>+ Property m_properties[numCSSProperties + 2];
+ std::bitset<numCSSProperties + 2> m_propertyIsPresent;
</ins><span class="cx">
</span><span class="cx"> Vector<Property, 8> m_deferredProperties;
</span><ins>+ HashMap<AtomicString, Property> m_customProperties;
</ins><span class="cx">
</span><span class="cx"> TextDirection m_direction;
</span><span class="cx"> WritingMode m_writingMode;
</span><span class="lines">@@ -862,6 +867,9 @@
</span><span class="cx"> // decl, there's nothing to override. So just add the first properties.
</span><span class="cx"> CascadedProperties cascade(direction, writingMode);
</span><span class="cx"> cascade.addMatches(result, false, 0, result.matchedProperties().size() - 1);
</span><ins>+
+ // Resolve custom properties first.
+ applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom);
</ins><span class="cx">
</span><span class="cx"> applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty);
</span><span class="cx">
</span><span class="lines">@@ -1028,6 +1036,9 @@
</span><span class="cx"> CascadedProperties cascade(direction, writingMode);
</span><span class="cx"> cascade.addMatches(result, false, 0, result.matchedProperties().size() - 1);
</span><span class="cx">
</span><ins>+ // Resolve custom properties first.
+ applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom);
+
</ins><span class="cx"> applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty);
</span><span class="cx">
</span><span class="cx"> // If our font got dirtied, update it now.
</span><span class="lines">@@ -1710,6 +1721,9 @@
</span><span class="cx">
</span><span class="cx"> applyCascadedProperties(cascade, CSSPropertyWebkitRubyPosition, CSSPropertyWebkitRubyPosition);
</span><span class="cx"> adjustStyleForInterCharacterRuby();
</span><ins>+
+ // Resolve custom variables first.
+ applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom);
</ins><span class="cx">
</span><span class="cx"> // Start by applying properties that other properties may depend on.
</span><span class="cx"> applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty);
</span><span class="lines">@@ -1725,6 +1739,9 @@
</span><span class="cx"> cascade.addMatches(matchResult, true, matchResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInheritedOnly);
</span><span class="cx"> cascade.addMatches(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly);
</span><span class="cx"> cascade.addMatches(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly);
</span><ins>+
+ // Resolve custom properties first.
+ applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom);
</ins><span class="cx">
</span><span class="cx"> applyCascadedProperties(cascade, CSSPropertyWebkitRubyPosition, CSSPropertyWebkitRubyPosition);
</span><span class="cx">
</span><span class="lines">@@ -1905,6 +1922,12 @@
</span><span class="cx">
</span><span class="cx"> if (isInherit && !state.parentStyle()->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id))
</span><span class="cx"> state.parentStyle()->setHasExplicitlyInheritedProperties();
</span><ins>+
+ if (id == CSSPropertyCustom) {
+ CSSCustomPropertyValue* customProperty = &downcast<CSSCustomPropertyValue>(*value);
+ state.style()->setCustomPropertyValue(customProperty->name(), customProperty->value());
+ return;
+ }
</ins><span class="cx">
</span><span class="cx"> // Use the generated StyleBuilder.
</span><span class="cx"> StyleBuilder::applyProperty(id, *this, *value, isInitial, isInherit);
</span><span class="lines">@@ -2549,6 +2572,24 @@
</span><span class="cx">
</span><span class="cx"> auto& property = m_properties[id];
</span><span class="cx"> ASSERT(id < m_propertyIsPresent.size());
</span><ins>+ if (id == CSSPropertyCustom) {
+ m_propertyIsPresent.set(id);
+ const auto& customValue = downcast<CSSCustomPropertyValue>(cssValue);
+ bool hasValue = customProperties().contains(customValue.name());
+ if (!hasValue) {
+ Property property;
+ property.id = id;
+ memset(property.cssValue, 0, sizeof(property.cssValue));
+ setPropertyInternal(property, id, cssValue, linkMatchType);
+ customProperties().set(customValue.name(), property);
+ } else {
+ Property property = customProperties().get(customValue.name());
+ setPropertyInternal(property, id, cssValue, linkMatchType);
+ customProperties().set(customValue.name(), property);
+ }
+ return;
+ }
+
</ins><span class="cx"> if (!m_propertyIsPresent[id])
</span><span class="cx"> memset(property.cssValue, 0, sizeof(property.cssValue));
</span><span class="cx"> m_propertyIsPresent.set(id);
</span><span class="lines">@@ -2646,6 +2687,12 @@
</span><span class="cx"> CSSPropertyID propertyID = static_cast<CSSPropertyID>(id);
</span><span class="cx"> if (!cascade.hasProperty(propertyID))
</span><span class="cx"> continue;
</span><ins>+ if (propertyID == CSSPropertyCustom) {
+ HashMap<AtomicString, CascadedProperties::Property>::iterator end = cascade.customProperties().end();
+ for (HashMap<AtomicString, CascadedProperties::Property>::iterator it = cascade.customProperties().begin(); it != end; ++it)
+ it->value.apply(*this);
+ continue;
+ }
</ins><span class="cx"> auto& property = cascade.property(propertyID);
</span><span class="cx"> ASSERT(!shouldApplyPropertyInParseOrder(propertyID));
</span><span class="cx"> property.apply(*this);
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorecssmakeproppl"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/css/makeprop.pl (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/css/makeprop.pl        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/css/makeprop.pl        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> my %namesHash;
</span><span class="cx"> my @duplicates = ();
</span><span class="cx">
</span><del>-my $numPredefinedProperties = 1;
</del><ins>+my $numPredefinedProperties = 2;
</ins><span class="cx"> my @names = ();
</span><span class="cx"> my %nameIsInherited;
</span><span class="cx"> my %propertiesWithStyleBuilderOptions;
</span><span class="lines">@@ -236,6 +236,7 @@
</span><span class="cx">
</span><span class="cx"> static const bool isInheritedPropertyTable[numCSSProperties + $numPredefinedProperties] = {
</span><span class="cx"> false, // CSSPropertyInvalid
</span><ins>+ false, // CSSPropertyCustom
</ins><span class="cx"> EOF
</span><span class="cx">
</span><span class="cx"> foreach my $name (@names) {
</span><span class="lines">@@ -283,6 +284,7 @@
</span><span class="cx">
</span><span class="cx"> enum CSSPropertyID : uint16_t {
</span><span class="cx"> CSSPropertyInvalid = 0,
</span><ins>+ CSSPropertyCustom = 1,
</ins><span class="cx"> EOF
</span><span class="cx">
</span><span class="cx"> my $first = $numPredefinedProperties;
</span><span class="lines">@@ -313,7 +315,7 @@
</span><span class="cx">
</span><span class="cx"> inline CSSPropertyID convertToCSSPropertyID(int value)
</span><span class="cx"> {
</span><del>- ASSERT((value >= firstCSSProperty && value <= lastCSSProperty) || value == CSSPropertyInvalid);
</del><ins>+ ASSERT((value >= firstCSSProperty && value <= lastCSSProperty) || value == CSSPropertyInvalid || value == CSSPropertyCustom);
</ins><span class="cx"> return static_cast<CSSPropertyID>(value);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -872,6 +874,7 @@
</span><span class="cx"> {
</span><span class="cx"> switch (property) {
</span><span class="cx"> case CSSPropertyInvalid:
</span><ins>+ case CSSPropertyCustom:
</ins><span class="cx"> break;
</span><span class="cx"> EOF
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreinspectorInspectorStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorStyleSheet.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorStyleSheet.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/inspector/InspectorStyleSheet.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -348,6 +348,14 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static String lowercasePropertyName(const String& name)
+{
+ // Custom properties are case-sensitive.
+ if (name.length() > 2 && name.characterAt(0) == '-' && name.characterAt(1) == '-')
+ return name;
+ return name.lower();
+}
+
</ins><span class="cx"> bool InspectorStyle::populateAllProperties(Vector<InspectorStyleProperty>* result) const
</span><span class="cx"> {
</span><span class="cx"> HashSet<String> sourcePropertyNames;
</span><span class="lines">@@ -362,16 +370,16 @@
</span><span class="cx"> InspectorStyleProperty p(*it, true, false);
</span><span class="cx"> p.setRawTextFromStyleDeclaration(styleDeclaration);
</span><span class="cx"> result->append(p);
</span><del>- sourcePropertyNames.add(it->name.lower());
</del><ins>+ sourcePropertyNames.add(lowercasePropertyName(it->name));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (int i = 0, size = m_style->length(); i < size; ++i) {
</span><span class="cx"> String name = m_style->item(i);
</span><del>- if (sourcePropertyNames.contains(name.lower()))
</del><ins>+ String lowerName = lowercasePropertyName(name);
+ if (sourcePropertyNames.contains(lowerName))
</ins><span class="cx"> continue;
</span><del>-
- sourcePropertyNames.add(name.lower());
</del><ins>+ sourcePropertyNames.add(lowerName);
</ins><span class="cx"> result->append(InspectorStyleProperty(CSSPropertySourceData(name, m_style->getPropertyValue(name), !m_style->getPropertyPriority(name).isEmpty(), true, SourceRange()), false, false));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/rendering/style/RenderStyle.h (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/rendering/style/RenderStyle.h        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/rendering/style/RenderStyle.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -513,6 +513,11 @@
</span><span class="cx">
</span><span class="cx"> const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
</span><span class="cx">
</span><ins>+ void setCustomPropertyValue(const AtomicString& name, const String& value) { rareInheritedData.access()->m_customProperties.access()->setCustomPropertyValue(name, value); }
+ String getCustomPropertyValue(const AtomicString& name) const { return rareInheritedData->m_customProperties->getCustomPropertyValue(name); }
+ bool hasCustomProperty(const AtomicString& name) const { return rareInheritedData->m_customProperties->hasCustomProperty(name); }
+ const HashMap<AtomicString, String>* customProperties() const { return &(rareInheritedData->m_customProperties->m_values); }
+
</ins><span class="cx"> void setHasViewportUnits(bool hasViewportUnits = true) { noninherited_flags.setHasViewportUnits(hasViewportUnits); }
</span><span class="cx"> bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits(); }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorerenderingstyleStyleCustomPropertyDatahfromrev193501branchessafari601branchSourceWebCorerenderingstyleStyleCustomPropertyDatah"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleCustomPropertyData.h (from rev 193501, branches/safari-601-branch/Source/WebCore/rendering/style/StyleCustomPropertyData.h) (0 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleCustomPropertyData.h         (rev 0)
+++ branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleCustomPropertyData.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef StyleCustomPropertyData_h
+#define StyleCustomPropertyData_h
+
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/AtomicStringHash.h>
+
+namespace WebCore {
+
+class StyleCustomPropertyData : public RefCounted<StyleCustomPropertyData> {
+public:
+ static Ref<StyleCustomPropertyData> create() { return adoptRef(*new StyleCustomPropertyData); }
+ Ref<StyleCustomPropertyData> copy() const { return adoptRef(*new StyleCustomPropertyData(*this)); }
+
+ bool operator==(const StyleCustomPropertyData& o) const { return m_values == o.m_values; }
+ bool operator!=(const StyleCustomPropertyData &o) const { return !(*this == o); }
+
+ void setCustomPropertyValue(const AtomicString& name, const String& value) { m_values.set(name, value); }
+ String getCustomPropertyValue(const AtomicString& name) const { return m_values.get(name); }
+ bool hasCustomProperty(const AtomicString& name) const { return m_values.contains(name); }
+
+ HashMap<AtomicString, String> m_values;
+
+private:
+ explicit StyleCustomPropertyData()
+ : RefCounted<StyleCustomPropertyData>()
+ { }
+ StyleCustomPropertyData(const StyleCustomPropertyData& other)
+ : RefCounted<StyleCustomPropertyData>()
+ , m_values(HashMap<AtomicString, String>(other.m_values))
+ { }
+};
+
+} // namespace WebCore
+
+#endif // StyleCustomPropertyData_h
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCorerenderingstyleStyleRareInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -23,10 +23,12 @@
</span><span class="cx"> #include "StyleRareInheritedData.h"
</span><span class="cx">
</span><span class="cx"> #include "CursorList.h"
</span><ins>+#include "DataRef.h"
</ins><span class="cx"> #include "QuotesData.h"
</span><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "RenderStyleConstants.h"
</span><span class="cx"> #include "ShadowData.h"
</span><ins>+#include "StyleCustomPropertyData.h"
</ins><span class="cx"> #include "StyleImage.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -60,6 +62,8 @@
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> Color tapHighlightColor;
</span><span class="cx"> #endif
</span><ins>+
+ void* customPropertyDataRefs[1];
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> COMPILE_ASSERT(sizeof(StyleRareInheritedData) <= sizeof(GreaterThanOrSameSizeAsStyleRareInheritedData), StyleRareInheritedData_should_bit_pack);
</span><span class="lines">@@ -69,6 +73,7 @@
</span><span class="cx"> , textStrokeWidth(RenderStyle::initialTextStrokeWidth())
</span><span class="cx"> , indent(RenderStyle::initialTextIndent())
</span><span class="cx"> , m_effectiveZoom(RenderStyle::initialZoom())
</span><ins>+ , m_customProperties(StyleCustomPropertyData::create())
</ins><span class="cx"> , widows(RenderStyle::initialWidows())
</span><span class="cx"> , orphans(RenderStyle::initialOrphans())
</span><span class="cx"> , m_hasAutoWidows(true)
</span><span class="lines">@@ -150,6 +155,7 @@
</span><span class="cx"> , cursorData(o.cursorData)
</span><span class="cx"> , indent(o.indent)
</span><span class="cx"> , m_effectiveZoom(o.m_effectiveZoom)
</span><ins>+ , m_customProperties(o.m_customProperties)
</ins><span class="cx"> , widows(o.widows)
</span><span class="cx"> , orphans(o.orphans)
</span><span class="cx"> , m_hasAutoWidows(o.m_hasAutoWidows)
</span><span class="lines">@@ -326,6 +332,7 @@
</span><span class="cx"> #if ENABLE(CSS_TRAILING_WORD)
</span><span class="cx"> && trailingWord == o.trailingWord
</span><span class="cx"> #endif
</span><ins>+ && m_customProperties == o.m_customProperties
</ins><span class="cx"> && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.get());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorerenderingstyleStyleRareInheritedDatah"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.h (193556 => 193557)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.h        2015-12-06 06:16:59 UTC (rev 193556)
+++ branches/safari-601.1.46-branch/Source/WebCore/rendering/style/StyleRareInheritedData.h        2015-12-06 06:19:32 UTC (rev 193557)
</span><span class="lines">@@ -26,7 +26,9 @@
</span><span class="cx"> #define StyleRareInheritedData_h
</span><span class="cx">
</span><span class="cx"> #include "Color.h"
</span><ins>+#include "DataRef.h"
</ins><span class="cx"> #include "Length.h"
</span><ins>+#include "StyleCustomPropertyData.h"
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><span class="lines">@@ -77,6 +79,8 @@
</span><span class="cx">
</span><span class="cx"> Length wordSpacing;
</span><span class="cx">
</span><ins>+ DataRef<StyleCustomPropertyData> m_customProperties;
+
</ins><span class="cx"> // Paged media properties.
</span><span class="cx"> short widows;
</span><span class="cx"> short orphans;
</span></span></pre>
</div>
</div>
</body>
</html>