<!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>[161209] trunk</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/161209">161209</a></dd>
<dt>Author</dt> <dd>krit@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-02 10:11:51 -0800 (Thu, 02 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Support <box> values computed style for 'clip-path' property
https://bugs.webkit.org/show_bug.cgi?id=126148
Reviewed by Simon Fraser.
Source/WebCore:
Calculate computed style for 'clip-path' property.
Updated tests to check for computed style.
* css/BasicShapeFunctions.cpp: Add box value bounding-box.
(WebCore::valueForBox):
(WebCore::boxForValue):
* css/CSSComputedStyleDeclaration.cpp: Return the computed style
for 'clip-path'.
(WebCore::ComputedStyleExtractor::propertyValue):
* css/DeprecatedStyleBuilder.cpp: Create CSSValueLists for 'clip-th'.
(WebCore::ApplyPropertyClipPath::applyValue):
* rendering/ClipPathOperation.h: Add bounding-box value.
(WebCore::ShapeClipPathOperation::pathForReferenceRect):
(WebCore::ShapeClipPathOperation::setReferenceBox):
(WebCore::ShapeClipPathOperation::referenceBox):
(WebCore::BoxClipPathOperation::create):
(WebCore::BoxClipPathOperation::pathForReferenceRect):
(WebCore::BoxClipPathOperation::referenceBox):
(WebCore::BoxClipPathOperation::BoxClipPathOperation):
* rendering/shapes/ShapeInfo.h: Add bounding-box value.
(WebCore::ShapeInfo::setShapeSize):
(WebCore::ShapeInfo::logicalTopOffset):
(WebCore::ShapeInfo::logicalLeftOffset):
* rendering/style/BasicShapes.cpp: Add bounding-box value.
(WebCore::BasicShape::referenceBoxSize):
* rendering/style/BasicShapes.h:
LayoutTests:
Test computed style of 'clip-path' property.
* fast/masking/parsing-clip-path-shape.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmaskingparsingclippathshapeexpectedtxt">trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmaskingparsingclippathshapehtml">trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssBasicShapeFunctionscpp">trunk/Source/WebCore/css/BasicShapeFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingClipPathOperationh">trunk/Source/WebCore/rendering/ClipPathOperation.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapeInfoh">trunk/Source/WebCore/rendering/shapes/ShapeInfo.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleBasicShapescpp">trunk/Source/WebCore/rendering/style/BasicShapes.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleBasicShapesh">trunk/Source/WebCore/rendering/style/BasicShapes.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderingContextcpp">trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/LayoutTests/ChangeLog        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-01-02 Dirk Schulze <krit@webkit.org>
+
+ Support <box> values computed style for 'clip-path' property
+ https://bugs.webkit.org/show_bug.cgi?id=126148
+
+ Reviewed by Simon Fraser.
+
+ Test computed style of 'clip-path' property.
+
+ * fast/masking/parsing-clip-path-shape.html:
+
</ins><span class="cx"> 2014-01-01 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Do less synchronous render tree construction
</span></span></pre></div>
<a id="trunkLayoutTestsfastmaskingparsingclippathshapeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -58,6 +58,16 @@
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "margin-box circle(50% at 50% 50%)") is "margin-box circle(50% at 50% 50%)"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "border-box circle(50% at 50% 50%)") is "border-box circle(50% at 50% 50%)"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box") is "circle(50% at 50% 50%) bounding-box"
</span><ins>+PASS computedStyle("-webkit-clip-path", "content-box") is "content-box"
+PASS computedStyle("-webkit-clip-path", "padding-box") is "padding-box"
+PASS computedStyle("-webkit-clip-path", "border-box") is "border-box"
+PASS computedStyle("-webkit-clip-path", "margin-box") is "margin-box"
+PASS computedStyle("-webkit-clip-path", "bounding-box") is "bounding-box"
+PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box") is "circle(50% at 50% 50%) content-box"
+PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) padding-box") is "circle(50% at 50% 50%) padding-box"
+PASS computedStyle("-webkit-clip-path", "margin-box circle(50% at 50% 50%)") is "circle(50% at 50% 50%) margin-box"
+PASS computedStyle("-webkit-clip-path", "border-box circle(50% at 50% 50%)") is "circle(50% at 50% 50%) border-box"
+PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box") is "circle(50% at 50% 50%) bounding-box"
</ins><span class="cx"> PASS innerStyle("-webkit-clip-path", "circle(1px, 1px, 1)") is null
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "circle(1px, 1px, 1)") is "none"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "circle(1px, 1px, px)") is null
</span></span></pre></div>
<a id="trunkLayoutTestsfastmaskingparsingclippathshapehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -118,6 +118,17 @@
</span><span class="cx"> testInner("-webkit-clip-path", "border-box circle(50% at 50% 50%)", "border-box circle(50% at 50% 50%)");
</span><span class="cx"> testInner("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box", "circle(50% at 50% 50%) bounding-box");
</span><span class="cx">
</span><ins>+testComputed("-webkit-clip-path", "content-box", "content-box");
+testComputed("-webkit-clip-path", "padding-box", "padding-box");
+testComputed("-webkit-clip-path", "border-box", "border-box");
+testComputed("-webkit-clip-path", "margin-box", "margin-box");
+testComputed("-webkit-clip-path", "bounding-box", "bounding-box");
+testComputed("-webkit-clip-path", "circle(50% at 50% 50%) content-box", "circle(50% at 50% 50%) content-box");
+testComputed("-webkit-clip-path", "circle(50% at 50% 50%) padding-box", "circle(50% at 50% 50%) padding-box");
+testComputed("-webkit-clip-path", "margin-box circle(50% at 50% 50%)", "circle(50% at 50% 50%) margin-box");
+testComputed("-webkit-clip-path", "border-box circle(50% at 50% 50%)", "circle(50% at 50% 50%) border-box");
+testComputed("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box", "circle(50% at 50% 50%) bounding-box");
+
</ins><span class="cx"> // reject non-lengths
</span><span class="cx"> negativeTest("-webkit-clip-path", "circle(1px, 1px, 1)");
</span><span class="cx"> negativeTest("-webkit-clip-path", "circle(1px, 1px, px)");
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/ChangeLog        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2014-01-02 Dirk Schulze <krit@webkit.org>
+
+ Support <box> values computed style for 'clip-path' property
+ https://bugs.webkit.org/show_bug.cgi?id=126148
+
+ Reviewed by Simon Fraser.
+
+ Calculate computed style for 'clip-path' property.
+
+ Updated tests to check for computed style.
+
+ * css/BasicShapeFunctions.cpp: Add box value bounding-box.
+ (WebCore::valueForBox):
+ (WebCore::boxForValue):
+ * css/CSSComputedStyleDeclaration.cpp: Return the computed style
+ for 'clip-path'.
+ (WebCore::ComputedStyleExtractor::propertyValue):
+ * css/DeprecatedStyleBuilder.cpp: Create CSSValueLists for 'clip-th'.
+ (WebCore::ApplyPropertyClipPath::applyValue):
+ * rendering/ClipPathOperation.h: Add bounding-box value.
+ (WebCore::ShapeClipPathOperation::pathForReferenceRect):
+ (WebCore::ShapeClipPathOperation::setReferenceBox):
+ (WebCore::ShapeClipPathOperation::referenceBox):
+ (WebCore::BoxClipPathOperation::create):
+ (WebCore::BoxClipPathOperation::pathForReferenceRect):
+ (WebCore::BoxClipPathOperation::referenceBox):
+ (WebCore::BoxClipPathOperation::BoxClipPathOperation):
+ * rendering/shapes/ShapeInfo.h: Add bounding-box value.
+ (WebCore::ShapeInfo::setShapeSize):
+ (WebCore::ShapeInfo::logicalTopOffset):
+ (WebCore::ShapeInfo::logicalLeftOffset):
+ * rendering/style/BasicShapes.cpp: Add bounding-box value.
+ (WebCore::BasicShape::referenceBoxSize):
+ * rendering/style/BasicShapes.h:
+
</ins><span class="cx"> 2014-01-02 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Always resolve style from root
</span></span></pre></div>
<a id="trunkSourceWebCorecssBasicShapeFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/BasicShapeFunctions.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx"> return cssValuePool().createIdentifierValue(CSSValueBorderBox);
</span><span class="cx"> case BasicShape::MarginBox:
</span><span class="cx"> return cssValuePool().createIdentifierValue(CSSValueMarginBox);
</span><ins>+ case BasicShape::BoundingBox:
+ return cssValuePool().createIdentifierValue(CSSValueBoundingBox);
</ins><span class="cx"> case BasicShape::None:
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -71,6 +73,8 @@
</span><span class="cx"> return BasicShape::BorderBox;
</span><span class="cx"> case CSSValueMarginBox:
</span><span class="cx"> return BasicShape::MarginBox;
</span><ins>+ case CSSValueBoundingBox:
+ return BasicShape::BoundingBox;
</ins><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return BasicShape::None;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -4,6 +4,7 @@
</span><span class="cx"> * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
</span><span class="cx"> * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
</span><span class="cx"> * Copyright (C) 2011 Sencha, Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Lesser General Public
</span><span class="lines">@@ -2859,18 +2860,29 @@
</span><span class="cx"> return counterToCSSValue(style.get(), propertyID);
</span><span class="cx"> case CSSPropertyCounterReset:
</span><span class="cx"> return counterToCSSValue(style.get(), propertyID);
</span><del>- case CSSPropertyWebkitClipPath:
- if (ClipPathOperation* operation = style->clipPath()) {
- if (operation->type() == ClipPathOperation::SHAPE)
- return valueForBasicShape(style.get(), static_cast<ShapeClipPathOperation*>(operation)->basicShape());
</del><ins>+ case CSSPropertyWebkitClipPath: {
+ ClipPathOperation* operation = style->clipPath();
+ if (!operation)
+ return cssValuePool().createIdentifierValue(CSSValueNone);
</ins><span class="cx"> #if ENABLE(SVG)
</span><del>- if (operation->type() == ClipPathOperation::REFERENCE) {
- ReferenceClipPathOperation* referenceOperation = static_cast<ReferenceClipPathOperation*>(operation);
- return CSSPrimitiveValue::create(referenceOperation->url(), CSSPrimitiveValue::CSS_URI);
- }
</del><ins>+ if (operation->type() == ClipPathOperation::Reference) {
+ ReferenceClipPathOperation& referenceOperation = toReferenceClipPathOperation(*operation);
+ return CSSPrimitiveValue::create(referenceOperation.url(), CSSPrimitiveValue::CSS_URI);
+ }
</ins><span class="cx"> #endif
</span><ins>+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ if (operation->type() == ClipPathOperation::Shape) {
+ ShapeClipPathOperation& shapeOperation = toShapeClipPathOperation(*operation);
+ list->append(valueForBasicShape(style.get(), shapeOperation.basicShape()));
+ if (shapeOperation.referenceBox() != BasicShape::ReferenceBox::None)
+ list->append(valueForBox(shapeOperation.referenceBox()));
</ins><span class="cx"> }
</span><del>- return cssValuePool().createIdentifierValue(CSSValueNone);
</del><ins>+ if (operation->type() == ClipPathOperation::Box) {
+ BoxClipPathOperation& boxOperation = toBoxClipPathOperation(*operation);
+ list->append(valueForBox(boxOperation.referenceBox()));
+ }
+ return list.release();
+ }
</ins><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx"> case CSSPropertyWebkitFlowInto:
</span><span class="cx"> if (style->flowThread().isNull())
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="cx"> * Copyright (C) 2013 Apple Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -2062,16 +2063,30 @@
</span><span class="cx"> }
</span><span class="cx"> if (!value->isValueList())
</span><span class="cx"> return;
</span><ins>+ BasicShape::ReferenceBox referenceBox = BasicShape::ReferenceBox::None;
+ RefPtr<ClipPathOperation> operation;
</ins><span class="cx"> auto& valueList = toCSSValueList(*value);
</span><span class="cx"> for (unsigned i = 0; i < valueList.length(); ++i) {
</span><del>- // FIXME: <box> values are not supported yet.
- // https://bugs.webkit.org/show_bug.cgi?id=126148
</del><span class="cx"> auto& primitiveValue = toCSSPrimitiveValue(*valueList.itemWithoutBoundsCheck(i));
</span><del>- if (!primitiveValue.isShape())
- continue;
- setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue.getShapeValue())));
- break;
</del><ins>+ if (primitiveValue.isShape() && !operation)
+ operation = ShapeClipPathOperation::create(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue.getShapeValue()));
+ else if ((primitiveValue.getValueID() == CSSValueContentBox
+ || primitiveValue.getValueID() == CSSValueBorderBox
+ || primitiveValue.getValueID() == CSSValuePaddingBox
+ || primitiveValue.getValueID() == CSSValueMarginBox
+ || primitiveValue.getValueID() == CSSValueBoundingBox)
+ && referenceBox == BasicShape::ReferenceBox::None)
+ referenceBox = boxForValue(&primitiveValue);
+ else
+ return;
</ins><span class="cx"> }
</span><ins>+ if (!operation) {
+ if (referenceBox == BasicShape::ReferenceBox::None)
+ return;
+ operation = BoxClipPathOperation::create(referenceBox);
+ } else
+ toShapeClipPathOperation(operation.get())->setReferenceBox(referenceBox);
+ setValue(styleResolver->style(), operation.release());
</ins><span class="cx"> }
</span><span class="cx"> static PropertyHandler createHandler()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx"> return to;
</span><span class="cx">
</span><span class="cx"> // Other clip-path operations than BasicShapes can not be animated.
</span><del>- if (from->type() != ClipPathOperation::SHAPE || to->type() != ClipPathOperation::SHAPE)
</del><ins>+ if (from->type() != ClipPathOperation::Shape || to->type() != ClipPathOperation::Shape)
</ins><span class="cx"> return to;
</span><span class="cx">
</span><span class="cx"> const BasicShape* fromShape = static_cast<ShapeClipPathOperation*>(from)->basicShape();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingClipPathOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/ClipPathOperation.h (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/ClipPathOperation.h        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/ClipPathOperation.h        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
</del><ins>+ * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -42,8 +42,9 @@
</span><span class="cx"> class ClipPathOperation : public RefCounted<ClipPathOperation> {
</span><span class="cx"> public:
</span><span class="cx"> enum OperationType {
</span><del>- REFERENCE,
- SHAPE
</del><ins>+ Reference,
+ Shape,
+ Box
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> virtual ~ClipPathOperation() { }
</span><span class="lines">@@ -83,7 +84,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ReferenceClipPathOperation(const String& url, const String& fragment)
</span><del>- : ClipPathOperation(REFERENCE)
</del><ins>+ : ClipPathOperation(Reference)
</ins><span class="cx"> , m_url(url)
</span><span class="cx"> , m_fragment(fragment)
</span><span class="cx"> {
</span><span class="lines">@@ -102,15 +103,19 @@
</span><span class="cx">
</span><span class="cx"> const BasicShape* basicShape() const { return m_shape.get(); }
</span><span class="cx"> WindRule windRule() const { return m_shape->windRule(); }
</span><del>- const Path& path(const FloatRect& boundingRect)
</del><ins>+ const Path pathForReferenceRect(const FloatRect& boundingRect) const
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_shape);
</span><del>- m_path.clear();
- m_path = adoptPtr(new Path);
- m_shape->path(*m_path, boundingRect);
- return *m_path;
</del><ins>+ // FIXME: Make clipping path from basic-shapes relative to <box> value.
+ // https://bugs.webkit.org/show_bug.cgi?id=126206
+ Path path;
+ m_shape->path(path, boundingRect);
+ return path;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ void setReferenceBox(BasicShape::ReferenceBox referenceBox) { m_referenceBox = referenceBox; }
+ BasicShape::ReferenceBox referenceBox() const { return m_referenceBox; }
+
</ins><span class="cx"> private:
</span><span class="cx"> virtual bool operator==(const ClipPathOperation& o) const OVERRIDE
</span><span class="cx"> {
</span><span class="lines">@@ -121,14 +126,57 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> explicit ShapeClipPathOperation(PassRefPtr<BasicShape> shape)
</span><del>- : ClipPathOperation(SHAPE)
</del><ins>+ : ClipPathOperation(Shape)
</ins><span class="cx"> , m_shape(shape)
</span><ins>+ , m_referenceBox(BasicShape::ReferenceBox::None)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<BasicShape> m_shape;
</span><del>- OwnPtr<Path> m_path;
</del><ins>+ BasicShape::ReferenceBox m_referenceBox;
</ins><span class="cx"> };
</span><del>-}
</del><span class="cx">
</span><ins>+class BoxClipPathOperation : public ClipPathOperation {
+public:
+ static PassRefPtr<BoxClipPathOperation> create(BasicShape::ReferenceBox referenceBox)
+ {
+ return adoptRef(new BoxClipPathOperation(referenceBox));
+ }
+
+ const Path pathForReferenceRect(const FloatRect&) const
+ {
+ Path path;
+ // FIXME: Create clipping path from <box>.
+ // https://bugs.webkit.org/show_bug.cgi?id=126205
+ return path;
+ }
+ BasicShape::ReferenceBox referenceBox() const { return m_referenceBox; }
+
+private:
+ virtual bool operator==(const ClipPathOperation& o) const OVERRIDE
+ {
+ if (!isSameType(o))
+ return false;
+ const BoxClipPathOperation* other = static_cast<const BoxClipPathOperation*>(&o);
+ return m_referenceBox == other->m_referenceBox;
+ }
+
+ explicit BoxClipPathOperation(BasicShape::ReferenceBox referenceBox)
+ : ClipPathOperation(Box)
+ , m_referenceBox(referenceBox)
+ {
+ }
+
+ BasicShape::ReferenceBox m_referenceBox;
+};
+
+#define CLIP_PATH_OPERATION_CASTS(ToValueTypeName, predicate) \
+ TYPE_CASTS_BASE(ToValueTypeName, ClipPathOperation, operation, operation->type() == ClipPathOperation::predicate, operation.type() == ClipPathOperation::predicate)
+
+CLIP_PATH_OPERATION_CASTS(ReferenceClipPathOperation, Reference)
+CLIP_PATH_OPERATION_CASTS(ShapeClipPathOperation, Shape)
+CLIP_PATH_OPERATION_CASTS(BoxClipPathOperation, Box)
+
+} // namespace WebCore
+
</ins><span class="cx"> #endif // ClipPathOperation_h
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -3916,7 +3916,7 @@
</span><span class="cx"> RenderStyle& style = renderer().style();
</span><span class="cx">
</span><span class="cx"> ASSERT(style.clipPath());
</span><del>- if (style.clipPath()->type() == ClipPathOperation::SHAPE) {
</del><ins>+ if (style.clipPath()->type() == ClipPathOperation::Shape) {
</ins><span class="cx"> ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(style.clipPath());
</span><span class="cx">
</span><span class="cx"> if (!rootRelativeBoundsComputed) {
</span><span class="lines">@@ -3925,12 +3925,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> context->save();
</span><del>- context->clipPath(clipPath->path(rootRelativeBounds), clipPath->windRule());
</del><ins>+ context->clipPath(clipPath->pathForReferenceRect(rootRelativeBounds), clipPath->windRule());
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SVG)
</span><del>- if (style.clipPath()->type() == ClipPathOperation::REFERENCE) {
</del><ins>+ if (style.clipPath()->type() == ClipPathOperation::Reference) {
</ins><span class="cx"> ReferenceClipPathOperation* referenceClipPathOperation = static_cast<ReferenceClipPathOperation*>(style.clipPath());
</span><span class="cx"> Element* element = renderer().document().getElementById(referenceClipPathOperation->fragment());
</span><span class="cx"> if (element && element->hasTagName(SVGNames::clipPathTag) && element->renderer()) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapeInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/ShapeInfo.h (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/ShapeInfo.h        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInfo.h        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx"> logicalHeight -= m_renderer.borderAndPaddingLogicalHeight();
</span><span class="cx"> logicalWidth -= m_renderer.borderAndPaddingLogicalWidth();
</span><span class="cx"> break;
</span><ins>+ case BasicShape::BoundingBox:
</ins><span class="cx"> case BasicShape::None:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> break;
</span><span class="lines">@@ -175,6 +176,7 @@
</span><span class="cx"> case BasicShape::BorderBox: return LayoutUnit();
</span><span class="cx"> case BasicShape::PaddingBox: return m_renderer.borderBefore();
</span><span class="cx"> case BasicShape::ContentBox: return m_renderer.borderAndPaddingBefore();
</span><ins>+ case BasicShape::BoundingBox: break;
</ins><span class="cx"> case BasicShape::None: break;
</span><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -191,6 +193,7 @@
</span><span class="cx"> case BasicShape::BorderBox: return LayoutUnit();
</span><span class="cx"> case BasicShape::PaddingBox: return m_renderer.borderStart();
</span><span class="cx"> case BasicShape::ContentBox: return m_renderer.borderAndPaddingStart();
</span><ins>+ case BasicShape::BoundingBox: break;
</ins><span class="cx"> case BasicShape::None: break;
</span><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -86,6 +86,8 @@
</span><span class="cx"> case MarginBox:
</span><span class="cx"> return FloatSize(renderer.marginLeft() + renderer.width() + renderer.marginRight(),
</span><span class="cx"> renderer.marginTop() + renderer.height() + renderer.marginBottom());
</span><ins>+ case BoundingBox:
+ break;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.h (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.h        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.h        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -63,7 +63,8 @@
</span><span class="cx"> ContentBox,
</span><span class="cx"> PaddingBox,
</span><span class="cx"> BorderBox,
</span><del>- MarginBox
</del><ins>+ MarginBox,
+ BoundingBox
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> bool canBlend(const BasicShape*) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -123,9 +123,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ClipPathOperation* clipPathOperation = style.clipPath();
</span><del>- if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::SHAPE) {
</del><ins>+ if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::Shape) {
</ins><span class="cx"> ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(clipPathOperation);
</span><del>- m_paintInfo->context->clipPath(clipPath->path(renderer.objectBoundingBox()), clipPath->windRule());
</del><ins>+ m_paintInfo->context->clipPath(clipPath->pathForReferenceRect(renderer.objectBoundingBox()), clipPath->windRule());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(*m_renderer);
</span></span></pre>
</div>
</div>
</body>
</html>