<!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>[169225] branches/safari-537.77-branch/Source</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/169225">169225</a></dd>
<dt>Author</dt> <dd>lforschler@apple.com</dd>
<dt>Date</dt> <dd>2014-05-22 15:43:07 -0700 (Thu, 22 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/166741">r166741</a>.  &lt;rdar://problem/16975484&gt;</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari53777branchSourceWebCoreChangeLog">branches/safari-537.77-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreWebCoreexpin">branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#branchessafari53777branchSourceWebCorecssCSSComputedStyleDeclarationcpp">branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCorecssStyleResolvercpp">branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicscaPlatformCAFiltersh">branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm">branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationcpp">branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationh">branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h</a></li>
<li><a href="#branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationscpp">branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCorerenderingFilterEffectRenderercpp">branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebCorerenderingRenderLayerFilterInfocpp">branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp</a></li>
<li><a href="#branchessafari53777branchSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp">branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari53777branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/ChangeLog (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/ChangeLog        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/ChangeLog        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2014-05-22  Lucas Forschler  &lt;lforschler@apple.com&gt;
+
+        Merge r166741
+
+    2014-04-02  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+            Harden FilterOperation type casting
+            https://bugs.webkit.org/show_bug.cgi?id=131142
+
+            Reviewed by Sam Weinig.
+
+            DefaultFilterOperation had an error-prone behavior where it set the base class
+            OperationType to the type of some other filter class, but overrode isDefault(). 
+            This made it very easy to write incorrect code that casted incorrectly based on type().
+
+            Fix by making adding a DEFAULT filter operation type, and storing the represented
+            type on DefaultFilterOperation().
+
+            Also remove the OperationType argument for constructors of FilterOperations that
+            can only be of one type, to avoid possible mistakes.
+
+            Make the type cast macros a bit more normal, and use them in a few places.
+
+            Fixed PlatformCAFiltersMac to handle the default filter case more cleanly.
+
+            * WebCore.exp.in:
+            * css/CSSComputedStyleDeclaration.cpp:
+            (WebCore::ComputedStyleExtractor::valueForFilter):
+            * css/StyleResolver.cpp:
+            (WebCore::StyleResolver::createFilterOperations):
+            * platform/graphics/ca/PlatformCAFilters.h:
+            * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
+            (PlatformCAFilters::filterValueForOperation):
+            (PlatformCAFilters::colorMatrixValueForFilter):
+            * platform/graphics/filters/FilterOperation.cpp:
+            (WebCore::DefaultFilterOperation::operator==):
+            (WebCore::ReferenceFilterOperation::ReferenceFilterOperation):
+            (WebCore::ReferenceFilterOperation::operator==):
+            (WebCore::BlurFilterOperation::operator==):
+            (WebCore::BlurFilterOperation::blend):
+            (WebCore::DropShadowFilterOperation::operator==):
+            (WebCore::DropShadowFilterOperation::blend):
+            * platform/graphics/filters/FilterOperation.h:
+            (WebCore::FilterOperation::blend):
+            (WebCore::FilterOperation::type):
+            (WebCore::FilterOperation::isBasicColorMatrixFilterOperation):
+            (WebCore::FilterOperation::isBasicComponentTransferFilterOperation):
+            (WebCore::FilterOperation::isSameType):
+            (WebCore::DefaultFilterOperation::create):
+            (WebCore::DefaultFilterOperation::representedType):
+            (WebCore::DefaultFilterOperation::DefaultFilterOperation):
+            (WebCore::ReferenceFilterOperation::create):
+            (WebCore::BlurFilterOperation::create):
+            (WebCore::BlurFilterOperation::BlurFilterOperation):
+            (WebCore::DropShadowFilterOperation::create):
+            (WebCore::DropShadowFilterOperation::DropShadowFilterOperation):
+            (WebCore::FilterOperation::isDefault): Deleted.
+            * platform/graphics/filters/FilterOperations.cpp:
+            (WebCore::FilterOperations::outsets):
+            * rendering/FilterEffectRenderer.cpp:
+            (WebCore::FilterEffectRenderer::build):
+            * rendering/RenderLayerFilterInfo.cpp:
+            (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
+
</ins><span class="cx"> 2014-05-22  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r167851
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/WebCore.exp.in        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -788,6 +788,7 @@
</span><span class="cx"> __ZN7WebCore24FrameDestructionObserverC2EPNS_5FrameE
</span><span class="cx"> __ZN7WebCore24FrameDestructionObserverD2Ev
</span><span class="cx"> __ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKN3WTF6StringES5_NS_19ParserContentPolicyE
</span><ins>+__ZN7WebCore24ReferenceFilterOperationC1ERKN3WTF6StringES4_
</ins><span class="cx"> __ZN7WebCore24decodeURLEscapeSequencesERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore24deleteCookiesForHostnameERKNS_21NetworkStorageSessionERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore24fileSystemRepresentationERKN3WTF6StringE
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -917,67 +917,67 @@
</span><span class="cx">         FilterOperation* filterOperation = (*it).get();
</span><span class="cx">         switch (filterOperation-&gt;getOperationType()) {
</span><span class="cx">         case FilterOperation::REFERENCE: {
</span><del>-            ReferenceFilterOperation* referenceOperation = static_cast&lt;ReferenceFilterOperation*&gt;(filterOperation);
</del><ins>+            ReferenceFilterOperation* referenceOperation = toReferenceFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ReferenceFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(referenceOperation-&gt;url(), CSSPrimitiveValue::CSS_STRING));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::GRAYSCALE: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::GrayscaleFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(colorMatrixOperation-&gt;amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::SEPIA: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::SepiaFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(colorMatrixOperation-&gt;amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::SATURATE: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::SaturateFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(colorMatrixOperation-&gt;amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::HUE_ROTATE: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::HueRotateFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(colorMatrixOperation-&gt;amount(), CSSPrimitiveValue::CSS_DEG));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::INVERT: {
</span><del>-            BasicComponentTransferFilterOperation* componentTransferOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::InvertFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(componentTransferOperation-&gt;amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::OPACITY: {
</span><del>-            BasicComponentTransferFilterOperation* componentTransferOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::OpacityFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(componentTransferOperation-&gt;amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::BRIGHTNESS: {
</span><del>-            BasicComponentTransferFilterOperation* brightnessOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* brightnessOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::BrightnessFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(brightnessOperation-&gt;amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::CONTRAST: {
</span><del>-            BasicComponentTransferFilterOperation* contrastOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* contrastOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::ContrastFilterOperation);
</span><span class="cx">             filterValue-&gt;append(cssValuePool().createValue(contrastOperation-&gt;amount(), CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::BLUR: {
</span><del>-            BlurFilterOperation* blurOperation = static_cast&lt;BlurFilterOperation*&gt;(filterOperation);
</del><ins>+            BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::BlurFilterOperation);
</span><span class="cx">             filterValue-&gt;append(zoomAdjustedPixelValue(blurOperation-&gt;stdDeviation().value(), style));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::DROP_SHADOW: {
</span><del>-            DropShadowFilterOperation* dropShadowOperation = static_cast&lt;DropShadowFilterOperation*&gt;(filterOperation);
</del><ins>+            DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
</ins><span class="cx">             filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::DropShadowFilterOperation);
</span><span class="cx">             // We want our computed style to look like that of a text shadow (has neither spread nor inset style).
</span><span class="cx">             ShadowData shadowData = ShadowData(dropShadowOperation-&gt;location(), dropShadowOperation-&gt;stdDeviation(), 0, Normal, false, dropShadowOperation-&gt;color());
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/css/StyleResolver.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -3931,7 +3931,7 @@
</span><span class="cx">             WebKitCSSSVGDocumentValue* svgDocumentValue = static_cast&lt;WebKitCSSSVGDocumentValue*&gt;(argument);
</span><span class="cx">             KURL url = m_state.document()-&gt;completeURL(svgDocumentValue-&gt;url());
</span><span class="cx"> 
</span><del>-            RefPtr&lt;ReferenceFilterOperation&gt; operation = ReferenceFilterOperation::create(svgDocumentValue-&gt;url(), url.fragmentIdentifier(), operationType);
</del><ins>+            RefPtr&lt;ReferenceFilterOperation&gt; operation = ReferenceFilterOperation::create(svgDocumentValue-&gt;url(), url.fragmentIdentifier());
</ins><span class="cx">             if (SVGURIReference::isExternalURIReference(svgDocumentValue-&gt;url(), m_state.document())) {
</span><span class="cx">                 if (!svgDocumentValue-&gt;loadRequested())
</span><span class="cx">                     m_state.pendingSVGDocuments().set(operation.get(), svgDocumentValue);
</span><span class="lines">@@ -4001,7 +4001,7 @@
</span><span class="cx">             if (stdDeviation.isUndefined())
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            operations.operations().append(BlurFilterOperation::create(stdDeviation, operationType));
</del><ins>+            operations.operations().append(BlurFilterOperation::create(stdDeviation));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSFilterValue::DropShadowFilterOperation: {
</span><span class="lines">@@ -4020,7 +4020,7 @@
</span><span class="cx">             if (item-&gt;color)
</span><span class="cx">                 color = colorFromPrimitiveValue(item-&gt;color.get());
</span><span class="cx"> 
</span><del>-            operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent, operationType));
</del><ins>+            operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSFilterValue::UnknownFilterOperation:
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicscaPlatformCAFiltersh"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -54,7 +54,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #ifdef USE_CA_FILTERS
</span><del>-    static RetainPtr&lt;NSValue&gt; colorMatrixValueForFilter(const FilterOperation&amp;);
</del><ins>+    // A null operation indicates that we should make a &quot;no-op&quot; filter of the given type.
+    static RetainPtr&lt;NSValue&gt; colorMatrixValueForFilter(FilterOperation::OperationType, const FilterOperation*);
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicscamacPlatformCAFiltersMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -108,6 +108,9 @@
</span><span class="cx">         String filterName = String::format(&quot;filter_%d&quot;, i);
</span><span class="cx">         const FilterOperation* filterOperation = filters.at(i);
</span><span class="cx">         switch (filterOperation-&gt;getOperationType()) {
</span><ins>+        case FilterOperation::DEFAULT:
+            ASSERT_NOT_REACHED();
+            break;
</ins><span class="cx">         case FilterOperation::DROP_SHADOW: {
</span><span class="cx">             // FIXME: For now assume drop shadow is the last filter, put it on the layer.
</span><span class="cx">             // &lt;rdar://problem/10959969&gt; Handle case where drop-shadow is not the last filter.
</span><span class="lines">@@ -133,7 +136,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::SEPIA: {
</span><del>-            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation-&gt;getOperationType(), filterOperation);
</ins><span class="cx">             CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx">             [filter setValue:colorMatrixValue.get() forKey:@&quot;inputColorMatrix&quot;];
</span><span class="cx">             [filter setName:filterName];
</span><span class="lines">@@ -158,7 +161,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::INVERT: {
</span><del>-            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation-&gt;getOperationType(), filterOperation);
</ins><span class="cx">             CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx">             [filter setValue:colorMatrixValue.get() forKey:@&quot;inputColorMatrix&quot;];
</span><span class="cx">             [filter setName:filterName];
</span><span class="lines">@@ -166,7 +169,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::OPACITY: {
</span><del>-            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation-&gt;getOperationType(), filterOperation);
</ins><span class="cx">             CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx">             [filter setValue:colorMatrixValue.get() forKey:@&quot;inputColorMatrix&quot;];
</span><span class="cx">             [filter setName:filterName];
</span><span class="lines">@@ -174,7 +177,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::BRIGHTNESS: {
</span><del>-            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation-&gt;getOperationType(), filterOperation);
</ins><span class="cx">             CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx">             [filter setValue:colorMatrixValue.get() forKey:@&quot;inputColorMatrix&quot;];
</span><span class="cx">             [filter setName:filterName];
</span><span class="lines">@@ -182,7 +185,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::CONTRAST: {
</span><del>-            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(*filterOperation);
</del><ins>+            RetainPtr&lt;NSValue&gt; colorMatrixValue = PlatformCAFilters::colorMatrixValueForFilter(filterOperation-&gt;getOperationType(), filterOperation);
</ins><span class="cx">             CAFilter *filter = [CAFilter filterWithType:kCAFilterColorMatrix];
</span><span class="cx">             [filter setValue:colorMatrixValue.get() forKey:@&quot;inputColorMatrix&quot;];
</span><span class="cx">             [filter setName:filterName];
</span><span class="lines">@@ -334,26 +337,33 @@
</span><span class="cx">     FilterOperation::OperationType type = operation-&gt;getOperationType();
</span><span class="cx">     RetainPtr&lt;id&gt; value;
</span><span class="cx">     
</span><ins>+    if (type == FilterOperation::DEFAULT) {
+        type = toDefaultFilterOperation(operation)-&gt;representedType();
+        operation = nullptr;
+    }
+    
</ins><span class="cx">     switch (type) {
</span><ins>+    case FilterOperation::DEFAULT:
+        ASSERT_NOT_REACHED();
+        break;
</ins><span class="cx">     case FilterOperation::GRAYSCALE: {
</span><span class="cx">         // CIFilter: inputIntensity
</span><span class="cx">         // CAFilter: inputAmount
</span><span class="cx">         double amount = 0;
</span><del>-        if (!operation-&gt;isDefault()) {
-            const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
-            amount = op-&gt;amount();
-        }
</del><ins>+        if (operation)
+            amount = toBasicColorMatrixFilterOperation(operation)-&gt;amount();
+        
</ins><span class="cx">         value = [NSNumber numberWithDouble:amount];
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     case FilterOperation::SEPIA: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx">         // CAFilter: inputColorMatrix
</span><del>-        value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+        value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx">         // CIFilter: inputRVector, inputGVector, inputBVector
</span><span class="cx">         double amount = 0;
</span><del>-        if (!operation-&gt;isDefault()) {
</del><ins>+        if (operation) {
</ins><span class="cx">             const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
</span><span class="cx">             amount = op-&gt;amount();
</span><span class="cx">         }
</span><span class="lines">@@ -378,10 +388,8 @@
</span><span class="cx">         // CIFilter: inputSaturation
</span><span class="cx">         // CAFilter: inputAmount
</span><span class="cx">         double amount = 1;
</span><del>-        if (!operation-&gt;isDefault()) {
-            const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
-            amount = op-&gt;amount();
-        }
</del><ins>+        if (operation)
+            amount = toBasicColorMatrixFilterOperation(operation)-&gt;amount();
</ins><span class="cx">         
</span><span class="cx">         value = [NSNumber numberWithDouble:amount];
</span><span class="cx">         break;
</span><span class="lines">@@ -390,10 +398,9 @@
</span><span class="cx">         // Hue rotate CIFilter: inputAngle
</span><span class="cx">         // Hue rotate CAFilter: inputAngle
</span><span class="cx">         double amount = 0;
</span><del>-        if (!operation-&gt;isDefault()) {
-            const BasicColorMatrixFilterOperation* op = toBasicColorMatrixFilterOperation(operation);
-            amount = op-&gt;amount();
-        }
</del><ins>+        if (operation)
+            amount = toBasicColorMatrixFilterOperation(operation)-&gt;amount();
+        
</ins><span class="cx">         amount = deg2rad(amount);
</span><span class="cx">         value = [NSNumber numberWithDouble:amount];
</span><span class="cx">         break;
</span><span class="lines">@@ -401,15 +408,13 @@
</span><span class="cx">     case FilterOperation::INVERT: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx">         // CAFilter: inputColorMatrix
</span><del>-        value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+        value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx">         // CIFilter: inputRVector, inputGVector, inputBVector, inputBiasVector
</span><span class="cx">         double amount = 0;
</span><del>-        if (!operation-&gt;isDefault()) {
-            const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
-            amount = op-&gt;amount();
-        }
-
</del><ins>+        if (operation)
+            amount = toBasicComponentTransferFilterOperation(operation)-&gt;amount();
+        
</ins><span class="cx">         double multiplier = 1 - amount * 2;
</span><span class="cx"> 
</span><span class="cx">         // The color matrix animation for invert does a scale of each color component by a value that goes from 
</span><span class="lines">@@ -429,14 +434,12 @@
</span><span class="cx">     case FilterOperation::OPACITY: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx">         // Opacity CAFilter: inputColorMatrix
</span><del>-        value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+        value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx">         // Opacity CIFilter: inputAVector
</span><span class="cx">         double amount = 1;
</span><del>-        if (!operation-&gt;isDefault()) {
-            const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
-            amount = op-&gt;amount();
-        }
</del><ins>+        if (operation)
+            amount = toBasicComponentTransferFilterOperation(operation)-&gt;amount();
</ins><span class="cx">         
</span><span class="cx">         value = adoptNS([[CIVector alloc] initWithX:0 Y:0 Z:0 W:amount]);
</span><span class="cx"> #endif
</span><span class="lines">@@ -446,14 +449,12 @@
</span><span class="cx">     case FilterOperation::BRIGHTNESS: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx">         // Brightness CAFilter: inputColorMatrix
</span><del>-        value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+        value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx">         // Brightness CIFilter: inputColorMatrix
</span><span class="cx">         double amount = 1;
</span><del>-        if (!operation-&gt;isDefault()) {
-            const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
-            amount = op-&gt;amount();
-        }
</del><ins>+        if (operation)
+            amount = toBasicComponentTransferFilterOperation(operation)-&gt;amount();
</ins><span class="cx">         
</span><span class="cx">         CIVector* rowVector = 0;
</span><span class="cx">         switch (internalFilterPropertyIndex) {
</span><span class="lines">@@ -469,15 +470,13 @@
</span><span class="cx">     case FilterOperation::CONTRAST: {
</span><span class="cx"> #if USE_CA_FILTERS
</span><span class="cx">         // Contrast CAFilter: inputColorMatrix
</span><del>-        value = PlatformCAFilters::colorMatrixValueForFilter(*operation);
</del><ins>+        value = PlatformCAFilters::colorMatrixValueForFilter(type, operation);
</ins><span class="cx"> #else
</span><span class="cx">         // Contrast CIFilter: inputContrast
</span><span class="cx">         double amount = 1;
</span><del>-        if (!operation-&gt;isDefault()) {
-            const BasicComponentTransferFilterOperation* op = toBasicComponentTransferFilterOperation(operation);
-            amount = op-&gt;amount();
-        }
-
</del><ins>+        if (operation)
+            amount = toBasicComponentTransferFilterOperation(operation)-&gt;amount();
+        
</ins><span class="cx">         value = [NSNumber numberWithDouble:amount];
</span><span class="cx"> #endif
</span><span class="cx">         break;
</span><span class="lines">@@ -486,11 +485,8 @@
</span><span class="cx">         // CIFilter: inputRadius
</span><span class="cx">         // CAFilter: inputRadius
</span><span class="cx">         double amount = 0;
</span><del>-
-        if (!operation-&gt;isDefault()) {
-            const BlurFilterOperation* op = toBlurFilterOperation(operation);
-            amount = floatValueForLength(op-&gt;stdDeviation(), 0);
-        }
</del><ins>+        if (operation)
+            amount = floatValueForLength(toBlurFilterOperation(operation)-&gt;stdDeviation(), 0);
</ins><span class="cx">         
</span><span class="cx">         value = [NSNumber numberWithDouble:amount];
</span><span class="cx">         break;
</span><span class="lines">@@ -503,12 +499,11 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE_CA_FILTERS
</span><del>-RetainPtr&lt;NSValue&gt; PlatformCAFilters::colorMatrixValueForFilter(const FilterOperation&amp; filterOperation)
</del><ins>+RetainPtr&lt;NSValue&gt; PlatformCAFilters::colorMatrixValueForFilter(FilterOperation::OperationType type, const FilterOperation* filterOperation)
</ins><span class="cx"> {
</span><del>-    switch (filterOperation.getOperationType()) {
</del><ins>+    switch (type) {
</ins><span class="cx">     case FilterOperation::SEPIA: {
</span><del>-        const BasicColorMatrixFilterOperation&amp; op = toBasicColorMatrixFilterOperation(filterOperation);
-        double t = op.amount();
</del><ins>+        double t = filterOperation ? toBasicColorMatrixFilterOperation(filterOperation)-&gt;amount() : 0;
</ins><span class="cx">         t = std::min(std::max(0.0, t), 1.0);
</span><span class="cx">         CAColorMatrix colorMatrix = {
</span><span class="cx">             static_cast&lt;float&gt;(WebCore::blend(sepiaNoneConstants[0][0], sepiaFullConstants[0][0], t)),
</span><span class="lines">@@ -527,11 +522,7 @@
</span><span class="cx">         return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx">     }
</span><span class="cx">     case FilterOperation::INVERT: {
</span><del>-        const BasicComponentTransferFilterOperation&amp; op = toBasicComponentTransferFilterOperation(filterOperation);
-        float amount = op.amount();
-        if (op.isDefault())
-            amount = 0;
-
</del><ins>+        float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)-&gt;amount() : 0;
</ins><span class="cx">         float multiplier = 1 - amount * 2;
</span><span class="cx">         CAColorMatrix colorMatrix = {
</span><span class="cx">             multiplier, 0, 0, 0, amount,
</span><span class="lines">@@ -542,11 +533,7 @@
</span><span class="cx">         return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx">     }
</span><span class="cx">     case FilterOperation::OPACITY: {
</span><del>-        const BasicComponentTransferFilterOperation&amp; op = toBasicComponentTransferFilterOperation(filterOperation);
-        float amount = op.amount();
-        if (op.isDefault())
-            amount = 1;
-
</del><ins>+        float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)-&gt;amount() : 1;
</ins><span class="cx">         CAColorMatrix colorMatrix = {
</span><span class="cx">             1, 0, 0, 0, 0,
</span><span class="cx">             0, 1, 0, 0, 0,
</span><span class="lines">@@ -556,11 +543,7 @@
</span><span class="cx">         return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx">     }
</span><span class="cx">     case FilterOperation::CONTRAST: {
</span><del>-        const BasicComponentTransferFilterOperation&amp; op = toBasicComponentTransferFilterOperation(filterOperation);
-        float amount = op.amount();
-        if (op.isDefault())
-            amount = 1;
-
</del><ins>+        float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)-&gt;amount() : 1;
</ins><span class="cx">         float intercept = -0.5 * amount + 0.5;
</span><span class="cx">         CAColorMatrix colorMatrix = {
</span><span class="cx">             amount, 0, 0, 0, intercept,
</span><span class="lines">@@ -571,11 +554,7 @@
</span><span class="cx">         return [NSValue valueWithCAColorMatrix:colorMatrix];
</span><span class="cx">     }
</span><span class="cx">     case FilterOperation::BRIGHTNESS: {
</span><del>-        const BasicComponentTransferFilterOperation&amp; op = toBasicComponentTransferFilterOperation(filterOperation);
-        float amount = op.amount();
-        if (op.isDefault())
-            amount = 1;
-
</del><ins>+        float amount = filterOperation ? toBasicComponentTransferFilterOperation(filterOperation)-&gt;amount() : 1;
</ins><span class="cx">         CAColorMatrix colorMatrix = {
</span><span class="cx">             amount, 0, 0, 0, 0,
</span><span class="cx">             0, amount, 0, 0, 0,
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -35,9 +35,17 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+    
+bool DefaultFilterOperation::operator==(const FilterOperation&amp; o) const
+{
+    if (!isSameType(o))
+        return false;
+    
+    return representedType() == toDefaultFilterOperation(o).representedType();
+}
</ins><span class="cx"> 
</span><del>-ReferenceFilterOperation::ReferenceFilterOperation(const String&amp; url, const String&amp; fragment, OperationType type)
-    : FilterOperation(type)
</del><ins>+ReferenceFilterOperation::ReferenceFilterOperation(const String&amp; url, const String&amp; fragment)
+    : FilterOperation(REFERENCE)
</ins><span class="cx">     , m_url(url)
</span><span class="cx">     , m_fragment(fragment)
</span><span class="cx"> {
</span><span class="lines">@@ -46,7 +54,15 @@
</span><span class="cx"> ReferenceFilterOperation::~ReferenceFilterOperation()
</span><span class="cx"> {
</span><span class="cx"> }
</span><del>-
</del><ins>+    
+bool ReferenceFilterOperation::operator==(const FilterOperation&amp; o) const
+{
+    if (!isSameType(o))
+        return false;
+    
+    return m_url == toReferenceFilterOperation(o).m_url;
+}
+    
</ins><span class="cx"> #if ENABLE(SVG)
</span><span class="cx"> void ReferenceFilterOperation::setCachedSVGDocumentReference(PassOwnPtr&lt;CachedSVGDocumentReference&gt; cachedSVGDocumentReference)
</span><span class="cx"> {
</span><span class="lines">@@ -127,7 +143,15 @@
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> }
</span><del>-
</del><ins>+    
+bool BlurFilterOperation::operator==(const FilterOperation&amp; o) const
+{
+    if (!isSameType(o))
+        return false;
+    
+    return m_stdDeviation == toBlurFilterOperation(o).stdDeviation();
+}
+    
</ins><span class="cx"> PassRefPtr&lt;FilterOperation&gt; BlurFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
</span><span class="cx"> {
</span><span class="cx">     if (from &amp;&amp; !from-&gt;isSameType(*this))
</span><span class="lines">@@ -136,13 +160,21 @@
</span><span class="cx">     LengthType lengthType = m_stdDeviation.type();
</span><span class="cx"> 
</span><span class="cx">     if (blendToPassthrough)
</span><del>-        return BlurFilterOperation::create(Length(lengthType).blend(m_stdDeviation, progress), m_type);
</del><ins>+        return BlurFilterOperation::create(Length(lengthType).blend(m_stdDeviation, progress));
</ins><span class="cx"> 
</span><del>-    const BlurFilterOperation* fromOp = static_cast&lt;const BlurFilterOperation*&gt;(from);
</del><ins>+    const BlurFilterOperation* fromOp = toBlurFilterOperation(from);
</ins><span class="cx">     Length fromLength = fromOp ? fromOp-&gt;m_stdDeviation : Length(lengthType);
</span><del>-    return BlurFilterOperation::create(m_stdDeviation.blend(fromLength, progress), m_type);
</del><ins>+    return BlurFilterOperation::create(m_stdDeviation.blend(fromLength, progress));
</ins><span class="cx"> }
</span><del>-
</del><ins>+    
+bool DropShadowFilterOperation::operator==(const FilterOperation&amp; o) const
+{
+    if (!isSameType(o))
+        return false;
+    const DropShadowFilterOperation&amp; other = toDropShadowFilterOperation(o);
+    return m_location == other.m_location &amp;&amp; m_stdDeviation == other.m_stdDeviation &amp;&amp; m_color == other.m_color;
+}
+    
</ins><span class="cx"> PassRefPtr&lt;FilterOperation&gt; DropShadowFilterOperation::blend(const FilterOperation* from, double progress, bool blendToPassthrough)
</span><span class="cx"> {
</span><span class="cx">     if (from &amp;&amp; !from-&gt;isSameType(*this))
</span><span class="lines">@@ -152,10 +184,9 @@
</span><span class="cx">         return DropShadowFilterOperation::create(
</span><span class="cx">             WebCore::blend(m_location, IntPoint(), progress),
</span><span class="cx">             WebCore::blend(m_stdDeviation, 0, progress),
</span><del>-            WebCore::blend(m_color, Color(Color::transparent), progress),
-            m_type);
</del><ins>+            WebCore::blend(m_color, Color(Color::transparent), progress));
</ins><span class="cx"> 
</span><del>-    const DropShadowFilterOperation* fromOp = static_cast&lt;const DropShadowFilterOperation*&gt;(from);
</del><ins>+    const DropShadowFilterOperation* fromOp = toDropShadowFilterOperation(from);
</ins><span class="cx">     IntPoint fromLocation = fromOp ? fromOp-&gt;location() : IntPoint();
</span><span class="cx">     int fromStdDeviation = fromOp ? fromOp-&gt;stdDeviation() : 0;
</span><span class="cx">     Color fromColor = fromOp ? fromOp-&gt;color() : Color(Color::transparent);
</span><span class="lines">@@ -163,7 +194,7 @@
</span><span class="cx">     return DropShadowFilterOperation::create(
</span><span class="cx">         WebCore::blend(fromLocation, m_location, progress),
</span><span class="cx">         WebCore::blend(fromStdDeviation, m_stdDeviation, progress),
</span><del>-        WebCore::blend(fromColor, m_color, progress), m_type);
</del><ins>+        WebCore::blend(fromColor, m_color, progress));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationh"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperation.h        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
</span><span class="cx">  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><del>- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</del><ins>+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</ins><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #ifndef FilterOperation_h
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx">         VALIDATED_CUSTOM,
</span><span class="cx"> #endif
</span><span class="cx">         PASSTHROUGH,
</span><ins>+        DEFAULT,
</ins><span class="cx">         NONE
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -86,22 +87,31 @@
</span><span class="cx">     bool operator!=(const FilterOperation&amp; o) const { return !(*this == o); }
</span><span class="cx"> 
</span><span class="cx">     virtual PassRefPtr&lt;FilterOperation&gt; blend(const FilterOperation* /*from*/, double /*progress*/, bool /*blendToPassthrough*/ = false)
</span><del>-    { 
</del><ins>+    {
</ins><span class="cx">         ASSERT(!blendingNeedsRendererSize());
</span><del>-        return 0; 
</del><ins>+        return 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     virtual PassRefPtr&lt;FilterOperation&gt; blend(const FilterOperation* /*from*/, double /*progress*/, const LayoutSize&amp;, bool /*blendToPassthrough*/ = false)
</span><del>-    { 
</del><ins>+    {
</ins><span class="cx">         ASSERT(blendingNeedsRendererSize());
</span><del>-        return 0; 
</del><ins>+        return 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual OperationType getOperationType() const { return m_type; }
-    virtual bool isSameType(const FilterOperation&amp; o) const { return o.getOperationType() == m_type; }
-    
-    virtual bool isDefault() const { return false; }
</del><ins>+    OperationType getOperationType() const { return m_type; }
</ins><span class="cx"> 
</span><ins>+    bool isBasicColorMatrixFilterOperation() const
+    {
+        return m_type == GRAYSCALE || m_type == SEPIA || m_type == SATURATE || m_type == HUE_ROTATE;
+    }
+
+    bool isBasicComponentTransferFilterOperation() const
+    {
+        return m_type == INVERT || m_type == BRIGHTNESS || m_type == CONTRAST || m_type == OPACITY;
+    }
+
+    bool isSameType(const FilterOperation&amp; o) const { return o.getOperationType() == m_type; }
+
</ins><span class="cx">     // True if the alpha channel of any pixel can change under this operation.
</span><span class="cx">     virtual bool affectsOpacity() const { return false; }
</span><span class="cx">     // True if the the value of one pixel can affect the value of another pixel under this operation, such as blur.
</span><span class="lines">@@ -118,28 +128,33 @@
</span><span class="cx">     OperationType m_type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#define FILTEROPERATION_TYPE_CASTS(ToValueTypeName, predicate) \
+    TYPE_CASTS_BASE(ToValueTypeName, WebCore::FilterOperation, value, value-&gt;predicate, value.predicate)
+
</ins><span class="cx"> class DefaultFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;DefaultFilterOperation&gt; create(OperationType type)
</del><ins>+    static PassRefPtr&lt;DefaultFilterOperation&gt; create(OperationType representedType)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new DefaultFilterOperation(type));
</del><ins>+        return adoptRef(new DefaultFilterOperation(representedType));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    OperationType representedType() const { return m_representedType; }
+
</ins><span class="cx"> private:
</span><ins>+    virtual bool operator==(const FilterOperation&amp;) const;
</ins><span class="cx"> 
</span><del>-    virtual bool operator==(const FilterOperation&amp; o) const
</del><ins>+    DefaultFilterOperation(OperationType representedType)
+        : FilterOperation(DEFAULT)
+        , m_representedType(representedType)
</ins><span class="cx">     {
</span><del>-        return isSameType(o);
</del><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual bool isDefault() const { return true; }
-
-    DefaultFilterOperation(OperationType type)
-        : FilterOperation(type)
-    {
-    }
</del><ins>+    OperationType m_representedType;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+FILTEROPERATION_TYPE_CASTS(DefaultFilterOperation, type() == FilterOperation::DEFAULT);
+
+
</ins><span class="cx"> class PassthroughFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;PassthroughFilterOperation&gt; create()
</span><span class="lines">@@ -160,11 +175,13 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+FILTEROPERATION_TYPE_CASTS(PassthroughFilterOperation, type() == FilterOperation::PASSTHROUGH);
+
</ins><span class="cx"> class ReferenceFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;ReferenceFilterOperation&gt; create(const String&amp; url, const String&amp; fragment, OperationType type)
</del><ins>+    static PassRefPtr&lt;ReferenceFilterOperation&gt; create(const String&amp; url, const String&amp; fragment)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new ReferenceFilterOperation(url, fragment, type));
</del><ins>+        return adoptRef(new ReferenceFilterOperation(url, fragment));
</ins><span class="cx">     }
</span><span class="cx">     ~ReferenceFilterOperation();
</span><span class="cx"> 
</span><span class="lines">@@ -183,15 +200,9 @@
</span><span class="cx">     void setFilterEffect(PassRefPtr&lt;FilterEffect&gt; filterEffect) { m_filterEffect = filterEffect; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    ReferenceFilterOperation(const String&amp; url, const String&amp; fragment, OperationType);
</del><ins>+    ReferenceFilterOperation(const String&amp; url, const String&amp; fragment);
</ins><span class="cx"> 
</span><del>-    virtual bool operator==(const FilterOperation&amp; o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const ReferenceFilterOperation* other = static_cast&lt;const ReferenceFilterOperation*&gt;(&amp;o);
-        return m_url == other-&gt;m_url;
-    }
</del><ins>+    virtual bool operator==(const FilterOperation&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     String m_url;
</span><span class="cx">     String m_fragment;
</span><span class="lines">@@ -201,6 +212,8 @@
</span><span class="cx">     RefPtr&lt;FilterEffect&gt; m_filterEffect;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+FILTEROPERATION_TYPE_CASTS(ReferenceFilterOperation, type() == FilterOperation::REFERENCE);
+
</ins><span class="cx"> // GRAYSCALE, SEPIA, SATURATE and HUE_ROTATE are variations on a basic color matrix effect.
</span><span class="cx"> // For HUE_ROTATE, the angle of rotation is stored in m_amount.
</span><span class="cx"> class BasicColorMatrixFilterOperation : public FilterOperation {
</span><span class="lines">@@ -228,6 +241,8 @@
</span><span class="cx">     double m_amount;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+FILTEROPERATION_TYPE_CASTS(BasicColorMatrixFilterOperation, isBasicColorMatrixFilterOperation());
+
</ins><span class="cx"> // INVERT, BRIGHTNESS, CONTRAST and OPACITY are variations on a basic component transfer effect.
</span><span class="cx"> class BasicComponentTransferFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><span class="lines">@@ -256,11 +271,13 @@
</span><span class="cx">     double m_amount;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+FILTEROPERATION_TYPE_CASTS(BasicComponentTransferFilterOperation, isBasicComponentTransferFilterOperation());
+
</ins><span class="cx"> class BlurFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;BlurFilterOperation&gt; create(Length stdDeviation, OperationType type)
</del><ins>+    static PassRefPtr&lt;BlurFilterOperation&gt; create(Length stdDeviation)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new BlurFilterOperation(stdDeviation, type));
</del><ins>+        return adoptRef(new BlurFilterOperation(stdDeviation));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Length stdDeviation() const { return m_stdDeviation; }
</span><span class="lines">@@ -271,16 +288,10 @@
</span><span class="cx">     virtual PassRefPtr&lt;FilterOperation&gt; blend(const FilterOperation* from, double progress, bool blendToPassthrough = false);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    virtual bool operator==(const FilterOperation&amp; o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const BlurFilterOperation* other = static_cast&lt;const BlurFilterOperation*&gt;(&amp;o);
-        return m_stdDeviation == other-&gt;m_stdDeviation;
-    }
</del><ins>+    virtual bool operator==(const FilterOperation&amp;) const;
</ins><span class="cx"> 
</span><del>-    BlurFilterOperation(Length stdDeviation, OperationType type)
-        : FilterOperation(type)
</del><ins>+    BlurFilterOperation(Length stdDeviation)
+        : FilterOperation(BLUR)
</ins><span class="cx">         , m_stdDeviation(stdDeviation)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -288,11 +299,13 @@
</span><span class="cx">     Length m_stdDeviation;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+FILTEROPERATION_TYPE_CASTS(BlurFilterOperation, type() == FilterOperation::BLUR);
+
</ins><span class="cx"> class DropShadowFilterOperation : public FilterOperation {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;DropShadowFilterOperation&gt; create(const IntPoint&amp; location, int stdDeviation, Color color, OperationType type)
</del><ins>+    static PassRefPtr&lt;DropShadowFilterOperation&gt; create(const IntPoint&amp; location, int stdDeviation, Color color)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color, type));
</del><ins>+        return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     int x() const { return m_location.x(); }
</span><span class="lines">@@ -307,17 +320,10 @@
</span><span class="cx">     virtual PassRefPtr&lt;FilterOperation&gt; blend(const FilterOperation* from, double progress, bool blendToPassthrough = false);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    virtual bool operator==(const FilterOperation&amp;) const;
</ins><span class="cx"> 
</span><del>-    virtual bool operator==(const FilterOperation&amp; o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const DropShadowFilterOperation* other = static_cast&lt;const DropShadowFilterOperation*&gt;(&amp;o);
-        return m_location == other-&gt;m_location &amp;&amp; m_stdDeviation == other-&gt;m_stdDeviation &amp;&amp; m_color == other-&gt;m_color;
-    }
-
-    DropShadowFilterOperation(const IntPoint&amp; location, int stdDeviation, Color color, OperationType type)
-        : FilterOperation(type)
</del><ins>+    DropShadowFilterOperation(const IntPoint&amp; location, int stdDeviation, Color color)
+        : FilterOperation(DROP_SHADOW)
</ins><span class="cx">         , m_location(location)
</span><span class="cx">         , m_stdDeviation(stdDeviation)
</span><span class="cx">         , m_color(color)
</span><span class="lines">@@ -329,16 +335,8 @@
</span><span class="cx">     Color m_color;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#define SIMPLE_FILTER_OPERATION_CASTS(ToValueTypeName, predicate) \
-    TYPE_CASTS_BASE(ToValueTypeName, FilterOperation, operation, operation-&gt;type() == FilterOperation::predicate, operation.type() == FilterOperation::predicate)
</del><ins>+FILTEROPERATION_TYPE_CASTS(DropShadowFilterOperation, type() == FilterOperation::DROP_SHADOW);
</ins><span class="cx"> 
</span><del>-SIMPLE_FILTER_OPERATION_CASTS(ReferenceFilterOperation, REFERENCE)
-SIMPLE_FILTER_OPERATION_CASTS(BlurFilterOperation, BLUR)
-SIMPLE_FILTER_OPERATION_CASTS(DropShadowFilterOperation, DROP_SHADOW)
-
-TYPE_CASTS_BASE(BasicColorMatrixFilterOperation, FilterOperation, operation, operation-&gt;type() == FilterOperation::GRAYSCALE || operation-&gt;type() == FilterOperation::SEPIA || operation-&gt;type() == FilterOperation::SATURATE || operation-&gt;type() == FilterOperation::HUE_ROTATE, operation.type() == FilterOperation::GRAYSCALE || operation.type() == FilterOperation::SEPIA || operation.type() == FilterOperation::SATURATE || operation.type() == FilterOperation::HUE_ROTATE)
-TYPE_CASTS_BASE(BasicComponentTransferFilterOperation, FilterOperation, operation, operation-&gt;type() == FilterOperation::INVERT || operation-&gt;type() == FilterOperation::BRIGHTNESS || operation-&gt;type() == FilterOperation::CONTRAST || operation-&gt;type() == FilterOperation::OPACITY, operation.type() == FilterOperation::INVERT || operation.type() == FilterOperation::BRIGHTNESS || operation.type() == FilterOperation::CONTRAST || operation.type() == FilterOperation::OPACITY)
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(CSS_FILTERS)
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCoreplatformgraphicsfiltersFilterOperationscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/platform/graphics/filters/FilterOperations.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -122,10 +122,10 @@
</span><span class="cx"> {
</span><span class="cx">     FilterOutsets totalOutsets;
</span><span class="cx">     for (size_t i = 0; i &lt; m_operations.size(); ++i) {
</span><del>-        FilterOperation* filterOperation = m_operations.at(i).get();
</del><ins>+        const FilterOperation* filterOperation = m_operations.at(i).get();
</ins><span class="cx">         switch (filterOperation-&gt;getOperationType()) {
</span><span class="cx">         case FilterOperation::BLUR: {
</span><del>-            BlurFilterOperation* blurOperation = static_cast&lt;BlurFilterOperation*&gt;(filterOperation);
</del><ins>+            const BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
</ins><span class="cx">             float stdDeviation = floatValueForLength(blurOperation-&gt;stdDeviation(), 0);
</span><span class="cx">             IntSize outsetSize = outsetSizeForBlur(stdDeviation);
</span><span class="cx">             FilterOutsets outsets(outsetSize.height(), outsetSize.width(), outsetSize.height(), outsetSize.width());
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::DROP_SHADOW: {
</span><del>-            DropShadowFilterOperation* dropShadowOperation = static_cast&lt;DropShadowFilterOperation*&gt;(filterOperation);
</del><ins>+            const DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
</ins><span class="cx">             IntSize outsetSize = outsetSizeForBlur(dropShadowOperation-&gt;stdDeviation());
</span><span class="cx">             FilterOutsets outsets(
</span><span class="cx">                 std::max(0, outsetSize.height() - dropShadowOperation-&gt;y()),
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorerenderingFilterEffectRenderercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/rendering/FilterEffectRenderer.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -209,13 +209,13 @@
</span><span class="cx">         FilterOperation* filterOperation = operations.operations().at(i).get();
</span><span class="cx">         switch (filterOperation-&gt;getOperationType()) {
</span><span class="cx">         case FilterOperation::REFERENCE: {
</span><del>-            ReferenceFilterOperation* referenceOperation = static_cast&lt;ReferenceFilterOperation*&gt;(filterOperation);
</del><ins>+            ReferenceFilterOperation* referenceOperation = toReferenceFilterOperation(filterOperation);
</ins><span class="cx">             effect = buildReferenceFilter(renderer, previousEffect, referenceOperation);
</span><span class="cx">             referenceOperation-&gt;setFilterEffect(effect);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::GRAYSCALE: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             Vector&lt;float&gt; inputParameters;
</span><span class="cx">             double oneMinusAmount = clampTo(1 - colorMatrixOperation-&gt;amount(), 0.0, 1.0);
</span><span class="cx"> 
</span><span class="lines">@@ -243,7 +243,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::SEPIA: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             Vector&lt;float&gt; inputParameters;
</span><span class="cx">             double oneMinusAmount = clampTo(1 - colorMatrixOperation-&gt;amount(), 0.0, 1.0);
</span><span class="cx"> 
</span><span class="lines">@@ -271,21 +271,21 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::SATURATE: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             Vector&lt;float&gt; inputParameters;
</span><span class="cx">             inputParameters.append(narrowPrecisionToFloat(colorMatrixOperation-&gt;amount()));
</span><span class="cx">             effect = FEColorMatrix::create(this, FECOLORMATRIX_TYPE_SATURATE, inputParameters);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::HUE_ROTATE: {
</span><del>-            BasicColorMatrixFilterOperation* colorMatrixOperation = static_cast&lt;BasicColorMatrixFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicColorMatrixFilterOperation* colorMatrixOperation = toBasicColorMatrixFilterOperation(filterOperation);
</ins><span class="cx">             Vector&lt;float&gt; inputParameters;
</span><span class="cx">             inputParameters.append(narrowPrecisionToFloat(colorMatrixOperation-&gt;amount()));
</span><span class="cx">             effect = FEColorMatrix::create(this, FECOLORMATRIX_TYPE_HUEROTATE, inputParameters);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::INVERT: {
</span><del>-            BasicComponentTransferFilterOperation* componentTransferOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             ComponentTransferFunction transferFunction;
</span><span class="cx">             transferFunction.type = FECOMPONENTTRANSFER_TYPE_TABLE;
</span><span class="cx">             Vector&lt;float&gt; transferParameters;
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::OPACITY: {
</span><del>-            BasicComponentTransferFilterOperation* componentTransferOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             ComponentTransferFunction transferFunction;
</span><span class="cx">             transferFunction.type = FECOMPONENTTRANSFER_TYPE_TABLE;
</span><span class="cx">             Vector&lt;float&gt; transferParameters;
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::BRIGHTNESS: {
</span><del>-            BasicComponentTransferFilterOperation* componentTransferOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             ComponentTransferFunction transferFunction;
</span><span class="cx">             transferFunction.type = FECOMPONENTTRANSFER_TYPE_LINEAR;
</span><span class="cx">             transferFunction.slope = narrowPrecisionToFloat(componentTransferOperation-&gt;amount());
</span><span class="lines">@@ -322,7 +322,7 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::CONTRAST: {
</span><del>-            BasicComponentTransferFilterOperation* componentTransferOperation = static_cast&lt;BasicComponentTransferFilterOperation*&gt;(filterOperation);
</del><ins>+            BasicComponentTransferFilterOperation* componentTransferOperation = toBasicComponentTransferFilterOperation(filterOperation);
</ins><span class="cx">             ComponentTransferFunction transferFunction;
</span><span class="cx">             transferFunction.type = FECOMPONENTTRANSFER_TYPE_LINEAR;
</span><span class="cx">             float amount = narrowPrecisionToFloat(componentTransferOperation-&gt;amount());
</span><span class="lines">@@ -334,13 +334,13 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::BLUR: {
</span><del>-            BlurFilterOperation* blurOperation = static_cast&lt;BlurFilterOperation*&gt;(filterOperation);
</del><ins>+            BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
</ins><span class="cx">             float stdDeviation = floatValueForLength(blurOperation-&gt;stdDeviation(), 0);
</span><span class="cx">             effect = FEGaussianBlur::create(this, stdDeviation, stdDeviation);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::DROP_SHADOW: {
</span><del>-            DropShadowFilterOperation* dropShadowOperation = static_cast&lt;DropShadowFilterOperation*&gt;(filterOperation);
</del><ins>+            DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
</ins><span class="cx">             effect = FEDropShadow::create(this, dropShadowOperation-&gt;stdDeviation(), dropShadowOperation-&gt;stdDeviation(),
</span><span class="cx">                                                 dropShadowOperation-&gt;x(), dropShadowOperation-&gt;y(), dropShadowOperation-&gt;color(), 1);
</span><span class="cx">             break;
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebCorerenderingRenderLayerFilterInfocpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebCore/rendering/RenderLayerFilterInfo.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">         RefPtr&lt;FilterOperation&gt; filterOperation = operations.operations().at(i);
</span><span class="cx">         if (filterOperation-&gt;getOperationType() != FilterOperation::REFERENCE)
</span><span class="cx">             continue;
</span><del>-        ReferenceFilterOperation* referenceFilterOperation = static_cast&lt;ReferenceFilterOperation*&gt;(filterOperation.get());
</del><ins>+        ReferenceFilterOperation* referenceFilterOperation = toReferenceFilterOperation(filterOperation.get());
</ins><span class="cx">         CachedSVGDocumentReference* documentReference = referenceFilterOperation-&gt;cachedSVGDocumentReference();
</span><span class="cx">         CachedSVGDocument* cachedSVGDocument = documentReference ? documentReference-&gt;document() : 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari53777branchSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp (169224 => 169225)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2014-05-22 22:08:28 UTC (rev 169224)
+++ branches/safari-537.77-branch/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2014-05-22 22:43:07 UTC (rev 169225)
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx">             Length length;
</span><span class="cx">             if (!ArgumentCoder&lt;Length&gt;::decode(decoder, length))
</span><span class="cx">                 return false;
</span><del>-            filter = BlurFilterOperation::create(length, type);
</del><ins>+            filter = BlurFilterOperation::create(length);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case FilterOperation::DROP_SHADOW: {
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">             if (!ArgumentCoder&lt;Color&gt;::decode(decoder, color))
</span><span class="cx">                 return false;
</span><del>-            filter = DropShadowFilterOperation::create(location, stdDeviation, color, type);
</del><ins>+            filter = DropShadowFilterOperation::create(location, stdDeviation, color);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> #if ENABLE(CSS_SHADERS)
</span></span></pre>
</div>
</div>

</body>
</html>