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 |
(...skipping 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/css/resolver/StyleBuilderConverter.h" | 28 #include "core/css/resolver/StyleBuilderConverter.h" |
29 | 29 |
30 #include "core/css/CSSFontFeatureValue.h" | 30 #include "core/css/CSSFontFeatureValue.h" |
31 #include "core/css/CSSFunctionValue.h" | 31 #include "core/css/CSSFunctionValue.h" |
32 #include "core/css/CSSGridLineNamesValue.h" | 32 #include "core/css/CSSGridLineNamesValue.h" |
33 #include "core/css/CSSPrimitiveValueMappings.h" | 33 #include "core/css/CSSPrimitiveValueMappings.h" |
34 #include "core/css/CSSReflectValue.h" | 34 #include "core/css/CSSReflectValue.h" |
35 #include "core/css/CSSShadowValue.h" | 35 #include "core/css/CSSShadowValue.h" |
36 #include "core/css/CSSValuePool.h" | |
36 #include "core/css/Pair.h" | 37 #include "core/css/Pair.h" |
37 #include "core/css/Rect.h" | 38 #include "core/css/Rect.h" |
38 #include "core/svg/SVGURIReference.h" | 39 #include "core/svg/SVGURIReference.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 namespace { | 43 namespace { |
43 | 44 |
44 static GridLength convertGridTrackBreadth(const StyleResolverState& state, CSSPr imitiveValue* primitiveValue) | 45 static GridLength convertGridTrackBreadth(const StyleResolverState& state, CSSPr imitiveValue* primitiveValue) |
45 { | 46 { |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 return primitiveValue->getRGBA32Value(); | 605 return primitiveValue->getRGBA32Value(); |
605 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor); | 606 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor); |
606 return state.style()->color(); | 607 return state.style()->color(); |
607 } | 608 } |
608 | 609 |
609 PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState &, CSSValue* value) | 610 PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState &, CSSValue* value) |
610 { | 611 { |
611 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value)); | 612 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value)); |
612 } | 613 } |
613 | 614 |
615 StyleNavigationValue StyleBuilderConverter::convertStyleNavigationValue(StyleRes olverState&, CSSValue* value) | |
616 { | |
617 if (!value->isValueList()) | |
618 return RenderStyle::initialStyleNavigation(); | |
619 | |
620 CSSValueList* valueList = toCSSValueList(value); | |
621 ASSERT(valueList->length() == 1 || valueList->length() == 2); | |
622 | |
623 String idSelector = toCSSPrimitiveValue(valueList->item(0))->getStringValue( ); | |
624 if (idSelector.startsWith('#')) | |
fs
2014/10/01 10:52:14
When does this string _not_ start with '#' when yo
| |
625 idSelector.remove(0); | |
626 | |
627 if (valueList->length() == 1) | |
628 return StyleNavigationValue(idSelector); | |
629 | |
630 CSSPrimitiveValue* targetValue = toCSSPrimitiveValue(valueList->item(1)); | |
631 if (targetValue->isString()) | |
632 return StyleNavigationValue(idSelector, targetValue->getStringValue()); | |
633 | |
634 const CSSValueID targetValueID = targetValue->getValueID(); | |
635 return StyleNavigationValue(idSelector, targetValueID == CSSValueRoot ? Root : Current); | |
636 } | |
637 | |
614 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value) | 638 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value) |
615 { | 639 { |
616 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 640 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
617 if (primitiveValue->getValueID()) { | 641 if (primitiveValue->getValueID()) { |
618 float multiplier = convertLineWidth<float>(state, value); | 642 float multiplier = convertLineWidth<float>(state, value); |
619 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData()); | 643 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData()); |
620 } | 644 } |
621 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( )); | 645 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( )); |
622 } | 646 } |
623 | 647 |
624 } // namespace blink | 648 } // namespace blink |
OLD | NEW |