| OLD | NEW |
| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 50 #include "core/css/resolver/TransformBuilder.h" | 51 #include "core/css/resolver/TransformBuilder.h" |
| 51 #include "core/frame/LocalFrame.h" | 52 #include "core/frame/LocalFrame.h" |
| 52 #include "core/frame/UseCounter.h" | 53 #include "core/frame/UseCounter.h" |
| 53 #include "core/style/ClipPathOperation.h" | 54 #include "core/style/ClipPathOperation.h" |
| 54 #include "core/style/TextSizeAdjust.h" | 55 #include "core/style/TextSizeAdjust.h" |
| 55 #include "core/svg/SVGURIReference.h" | 56 #include "core/svg/SVGURIReference.h" |
| 56 #include "platform/fonts/FontCache.h" | 57 #include "platform/fonts/FontCache.h" |
| 57 #include "platform/transforms/RotateTransformOperation.h" | 58 #include "platform/transforms/RotateTransformOperation.h" |
| 58 #include "platform/transforms/ScaleTransformOperation.h" | 59 #include "platform/transforms/ScaleTransformOperation.h" |
| 59 #include "platform/transforms/TranslateTransformOperation.h" | 60 #include "platform/transforms/TranslateTransformOperation.h" |
| 60 #include <algorithm> | |
| 61 | 61 |
| 62 namespace blink { | 62 namespace blink { |
| 63 | 63 |
| 64 using namespace cssvalue; | 64 using namespace cssvalue; |
| 65 | 65 |
| 66 namespace { | 66 namespace { |
| 67 | 67 |
| 68 static GridLength ConvertGridTrackBreadth(const StyleResolverState& state, | 68 static GridLength ConvertGridTrackBreadth(const StyleResolverState& state, |
| 69 const CSSValue& value) { | 69 const CSSValue& value) { |
| 70 // Fractional unit. | 70 // Fractional unit. |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 | 1373 |
| 1374 PassRefPtr<StylePath> StyleBuilderConverter::ConvertPathOrNone( | 1374 PassRefPtr<StylePath> StyleBuilderConverter::ConvertPathOrNone( |
| 1375 StyleResolverState& state, | 1375 StyleResolverState& state, |
| 1376 const CSSValue& value) { | 1376 const CSSValue& value) { |
| 1377 if (value.IsPathValue()) | 1377 if (value.IsPathValue()) |
| 1378 return ToCSSPathValue(value).GetStylePath(); | 1378 return ToCSSPathValue(value).GetStylePath(); |
| 1379 DCHECK_EQ(ToCSSIdentifierValue(value).GetValueID(), CSSValueNone); | 1379 DCHECK_EQ(ToCSSIdentifierValue(value).GetValueID(), CSSValueNone); |
| 1380 return nullptr; | 1380 return nullptr; |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 PassRefPtr<BasicShape> StyleBuilderConverter::ConvertOffsetPath( |
| 1384 StyleResolverState& state, |
| 1385 const CSSValue& value) { |
| 1386 if (value.IsRayValue()) |
| 1387 return BasicShapeForValue(state, value); |
| 1388 return ConvertPathOrNone(state, value); |
| 1389 } |
| 1390 |
| 1383 static const CSSValue& ComputeRegisteredPropertyValue( | 1391 static const CSSValue& ComputeRegisteredPropertyValue( |
| 1384 const CSSToLengthConversionData& css_to_length_conversion_data, | 1392 const CSSToLengthConversionData& css_to_length_conversion_data, |
| 1385 const CSSValue& value) { | 1393 const CSSValue& value) { |
| 1386 // TODO(timloh): Images and transform-function values can also contain | 1394 // TODO(timloh): Images and transform-function values can also contain |
| 1387 // lengths. | 1395 // lengths. |
| 1388 if (value.IsValueList()) { | 1396 if (value.IsValueList()) { |
| 1389 CSSValueList* new_list = CSSValueList::CreateSpaceSeparated(); | 1397 CSSValueList* new_list = CSSValueList::CreateSpaceSeparated(); |
| 1390 for (const CSSValue* inner_value : ToCSSValueList(value)) { | 1398 for (const CSSValue* inner_value : ToCSSValueList(value)) { |
| 1391 new_list->Append(ComputeRegisteredPropertyValue( | 1399 new_list->Append(ComputeRegisteredPropertyValue( |
| 1392 css_to_length_conversion_data, *inner_value)); | 1400 css_to_length_conversion_data, *inner_value)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1416 } | 1424 } |
| 1417 | 1425 |
| 1418 const CSSValue& StyleBuilderConverter::ConvertRegisteredPropertyValue( | 1426 const CSSValue& StyleBuilderConverter::ConvertRegisteredPropertyValue( |
| 1419 const StyleResolverState& state, | 1427 const StyleResolverState& state, |
| 1420 const CSSValue& value) { | 1428 const CSSValue& value) { |
| 1421 return ComputeRegisteredPropertyValue(state.CssToLengthConversionData(), | 1429 return ComputeRegisteredPropertyValue(state.CssToLengthConversionData(), |
| 1422 value); | 1430 value); |
| 1423 } | 1431 } |
| 1424 | 1432 |
| 1425 } // namespace blink | 1433 } // namespace blink |
| OLD | NEW |