Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2881673003: CSS Motion Path: Support parsing of ray(<angle>) paths (Closed)
Patch Set: CSS values in BasicShapeFunctions not StyleRay Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
11 * contributors may be used to endorse or promote products derived from 11 * contributors may be used to endorse or promote products derived from
12 * this software without specific prior written permission. 12 * this software without specific prior written permission.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "core/css/resolver/StyleBuilderConverter.h" 27 #include "core/css/resolver/StyleBuilderConverter.h"
28 28
29 #include <algorithm>
29 #include "core/css/BasicShapeFunctions.h" 30 #include "core/css/BasicShapeFunctions.h"
30 #include "core/css/CSSBasicShapeValues.h" 31 #include "core/css/CSSBasicShapeValues.h"
31 #include "core/css/CSSColorValue.h" 32 #include "core/css/CSSColorValue.h"
32 #include "core/css/CSSContentDistributionValue.h" 33 #include "core/css/CSSContentDistributionValue.h"
33 #include "core/css/CSSCustomIdentValue.h" 34 #include "core/css/CSSCustomIdentValue.h"
34 #include "core/css/CSSFontFamilyValue.h" 35 #include "core/css/CSSFontFamilyValue.h"
35 #include "core/css/CSSFontFeatureValue.h" 36 #include "core/css/CSSFontFeatureValue.h"
36 #include "core/css/CSSFontVariationValue.h" 37 #include "core/css/CSSFontVariationValue.h"
37 #include "core/css/CSSFunctionValue.h" 38 #include "core/css/CSSFunctionValue.h"
38 #include "core/css/CSSGridAutoRepeatValue.h" 39 #include "core/css/CSSGridAutoRepeatValue.h"
39 #include "core/css/CSSGridLineNamesValue.h" 40 #include "core/css/CSSGridLineNamesValue.h"
40 #include "core/css/CSSIdentifierValue.h" 41 #include "core/css/CSSIdentifierValue.h"
41 #include "core/css/CSSPathValue.h" 42 #include "core/css/CSSPathValue.h"
42 #include "core/css/CSSPrimitiveValueMappings.h" 43 #include "core/css/CSSPrimitiveValueMappings.h"
43 #include "core/css/CSSQuadValue.h" 44 #include "core/css/CSSQuadValue.h"
45 #include "core/css/CSSRayValue.h"
fs 2017/05/15 11:05:39 Nit: No longer needed I think?
Eric Willigers 2017/05/15 11:12:12 Removed.
44 #include "core/css/CSSReflectValue.h" 46 #include "core/css/CSSReflectValue.h"
45 #include "core/css/CSSShadowValue.h" 47 #include "core/css/CSSShadowValue.h"
46 #include "core/css/CSSStringValue.h" 48 #include "core/css/CSSStringValue.h"
47 #include "core/css/CSSURIValue.h" 49 #include "core/css/CSSURIValue.h"
48 #include "core/css/CSSValuePair.h" 50 #include "core/css/CSSValuePair.h"
49 #include "core/css/resolver/FilterOperationResolver.h" 51 #include "core/css/resolver/FilterOperationResolver.h"
50 #include "core/css/resolver/TransformBuilder.h" 52 #include "core/css/resolver/TransformBuilder.h"
51 #include "core/frame/LocalFrame.h" 53 #include "core/frame/LocalFrame.h"
52 #include "core/frame/UseCounter.h" 54 #include "core/frame/UseCounter.h"
53 #include "core/style/ClipPathOperation.h" 55 #include "core/style/ClipPathOperation.h"
56 #include "core/style/StyleRay.h"
fs 2017/05/15 11:05:39 Ditto.
Eric Willigers 2017/05/15 11:12:12 Removed.
54 #include "core/style/TextSizeAdjust.h" 57 #include "core/style/TextSizeAdjust.h"
55 #include "core/svg/SVGURIReference.h" 58 #include "core/svg/SVGURIReference.h"
56 #include "platform/fonts/FontCache.h" 59 #include "platform/fonts/FontCache.h"
57 #include "platform/transforms/RotateTransformOperation.h" 60 #include "platform/transforms/RotateTransformOperation.h"
58 #include "platform/transforms/ScaleTransformOperation.h" 61 #include "platform/transforms/ScaleTransformOperation.h"
59 #include "platform/transforms/TranslateTransformOperation.h" 62 #include "platform/transforms/TranslateTransformOperation.h"
60 #include <algorithm>
61 63
62 namespace blink { 64 namespace blink {
63 65
64 using namespace cssvalue; 66 using namespace cssvalue;
65 67
66 namespace { 68 namespace {
67 69
68 static GridLength ConvertGridTrackBreadth(const StyleResolverState& state, 70 static GridLength ConvertGridTrackBreadth(const StyleResolverState& state,
69 const CSSValue& value) { 71 const CSSValue& value) {
70 // Fractional unit. 72 // Fractional unit.
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 1375
1374 PassRefPtr<StylePath> StyleBuilderConverter::ConvertPathOrNone( 1376 PassRefPtr<StylePath> StyleBuilderConverter::ConvertPathOrNone(
1375 StyleResolverState& state, 1377 StyleResolverState& state,
1376 const CSSValue& value) { 1378 const CSSValue& value) {
1377 if (value.IsPathValue()) 1379 if (value.IsPathValue())
1378 return ToCSSPathValue(value).GetStylePath(); 1380 return ToCSSPathValue(value).GetStylePath();
1379 DCHECK_EQ(ToCSSIdentifierValue(value).GetValueID(), CSSValueNone); 1381 DCHECK_EQ(ToCSSIdentifierValue(value).GetValueID(), CSSValueNone);
1380 return nullptr; 1382 return nullptr;
1381 } 1383 }
1382 1384
1385 PassRefPtr<BasicShape> StyleBuilderConverter::ConvertOffsetPath(
1386 StyleResolverState& state,
1387 const CSSValue& value) {
1388 if (value.IsRayValue())
1389 return BasicShapeForValue(state, value);
1390 return ConvertPathOrNone(state, value);
1391 }
1392
1383 static const CSSValue& ComputeRegisteredPropertyValue( 1393 static const CSSValue& ComputeRegisteredPropertyValue(
1384 const CSSToLengthConversionData& css_to_length_conversion_data, 1394 const CSSToLengthConversionData& css_to_length_conversion_data,
1385 const CSSValue& value) { 1395 const CSSValue& value) {
1386 // TODO(timloh): Images and transform-function values can also contain 1396 // TODO(timloh): Images and transform-function values can also contain
1387 // lengths. 1397 // lengths.
1388 if (value.IsValueList()) { 1398 if (value.IsValueList()) {
1389 CSSValueList* new_list = CSSValueList::CreateSpaceSeparated(); 1399 CSSValueList* new_list = CSSValueList::CreateSpaceSeparated();
1390 for (const CSSValue* inner_value : ToCSSValueList(value)) { 1400 for (const CSSValue* inner_value : ToCSSValueList(value)) {
1391 new_list->Append(ComputeRegisteredPropertyValue( 1401 new_list->Append(ComputeRegisteredPropertyValue(
1392 css_to_length_conversion_data, *inner_value)); 1402 css_to_length_conversion_data, *inner_value));
(...skipping 23 matching lines...) Expand all
1416 } 1426 }
1417 1427
1418 const CSSValue& StyleBuilderConverter::ConvertRegisteredPropertyValue( 1428 const CSSValue& StyleBuilderConverter::ConvertRegisteredPropertyValue(
1419 const StyleResolverState& state, 1429 const StyleResolverState& state,
1420 const CSSValue& value) { 1430 const CSSValue& value) {
1421 return ComputeRegisteredPropertyValue(state.CssToLengthConversionData(), 1431 return ComputeRegisteredPropertyValue(state.CssToLengthConversionData(),
1422 value); 1432 value);
1423 } 1433 }
1424 1434
1425 } // namespace blink 1435 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698