| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 willChangeScrollPosition = true; | 800 willChangeScrollPosition = true; |
| 801 else | 801 else |
| 802 ASSERT_NOT_REACHED(); | 802 ASSERT_NOT_REACHED(); |
| 803 } | 803 } |
| 804 state.style()->setWillChangeContents(willChangeContents); | 804 state.style()->setWillChangeContents(willChangeContents); |
| 805 state.style()->setWillChangeScrollPosition(willChangeScrollPosition); | 805 state.style()->setWillChangeScrollPosition(willChangeScrollPosition); |
| 806 state.style()->setWillChangeProperties(willChangeProperties); | 806 state.style()->setWillChangeProperties(willChangeProperties); |
| 807 state.style()->setSubtreeWillChangeContents(willChangeContents || state.pare
ntStyle()->subtreeWillChangeContents()); | 807 state.style()->setSubtreeWillChangeContents(willChangeContents || state.pare
ntStyle()->subtreeWillChangeContents()); |
| 808 } | 808 } |
| 809 | 809 |
| 810 void StyleBuilderFunctions::applyInitialCSSPropertyContent(StyleResolverState& s
tate) | |
| 811 { | |
| 812 state.style()->clearContent(); | |
| 813 } | |
| 814 | |
| 815 void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&) | |
| 816 { | |
| 817 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not
. This | |
| 818 // note is a reminder that eventually "inherit" needs to be supported. | |
| 819 } | |
| 820 | |
| 821 void StyleBuilderFunctions::applyValueCSSPropertyContent(StyleResolverState& sta
te, CSSValue* value) | |
| 822 { | |
| 823 // list of string, uri, counter, attr, i | |
| 824 | |
| 825 if (!value->isValueList()) | |
| 826 return; | |
| 827 | |
| 828 bool didSet = false; | |
| 829 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) { | |
| 830 CSSValue* item = i.value(); | |
| 831 if (item->isImageGeneratorValue()) { | |
| 832 if (item->isGradientValue()) | |
| 833 state.style()->setContent(StyleGeneratedImage::create(toCSSGradi
entValue(item)->gradientWithStylesResolved(state.document().textLinkColors(), st
ate.style()->color()).get()), didSet); | |
| 834 else | |
| 835 state.style()->setContent(StyleGeneratedImage::create(toCSSImage
GeneratorValue(item)), didSet); | |
| 836 didSet = true; | |
| 837 } else if (item->isImageSetValue()) { | |
| 838 state.style()->setContent(state.elementStyleResources().setOrPending
FromValue(CSSPropertyContent, toCSSImageSetValue(item)), didSet); | |
| 839 didSet = true; | |
| 840 } | |
| 841 | |
| 842 if (item->isImageValue()) { | |
| 843 state.style()->setContent(state.elementStyleResources().cachedOrPend
ingFromValue(state.document(), CSSPropertyContent, toCSSImageValue(item)), didSe
t); | |
| 844 didSet = true; | |
| 845 continue; | |
| 846 } | |
| 847 | |
| 848 if (!item->isPrimitiveValue()) | |
| 849 continue; | |
| 850 | |
| 851 CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item); | |
| 852 | |
| 853 if (contentValue->isString()) { | |
| 854 state.style()->setContent(contentValue->getStringValue().impl(), did
Set); | |
| 855 didSet = true; | |
| 856 } else if (contentValue->isAttr()) { | |
| 857 // FIXME: Can a namespace be specified for an attr(foo)? | |
| 858 if (state.style()->styleType() == NOPSEUDO) | |
| 859 state.style()->setUnique(); | |
| 860 else | |
| 861 state.parentStyle()->setUnique(); | |
| 862 QualifiedName attr(AtomicString(contentValue->getStringValue())); | |
| 863 const AtomicString& value = state.element()->getAttribute(attr); | |
| 864 state.style()->setContent(value.isNull() ? emptyString() : value.str
ing(), didSet); | |
| 865 didSet = true; | |
| 866 // register the fact that the attribute value affects the style | |
| 867 state.contentAttrValues().append(attr.localName()); | |
| 868 } else { | |
| 869 switch (contentValue->getValueID()) { | |
| 870 default: | |
| 871 // normal and none do not have any effect. | |
| 872 { } | |
| 873 } | |
| 874 } | |
| 875 } | |
| 876 if (!didSet) | |
| 877 state.style()->clearContent(); | |
| 878 } | |
| 879 | |
| 880 void StyleBuilderFunctions::applyInitialCSSPropertyFont(StyleResolverState&) | 810 void StyleBuilderFunctions::applyInitialCSSPropertyFont(StyleResolverState&) |
| 881 { | 811 { |
| 882 ASSERT_NOT_REACHED(); | 812 ASSERT_NOT_REACHED(); |
| 883 } | 813 } |
| 884 | 814 |
| 885 void StyleBuilderFunctions::applyInheritCSSPropertyFont(StyleResolverState&) | 815 void StyleBuilderFunctions::applyInheritCSSPropertyFont(StyleResolverState&) |
| 886 { | 816 { |
| 887 ASSERT_NOT_REACHED(); | 817 ASSERT_NOT_REACHED(); |
| 888 } | 818 } |
| 889 | 819 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 state.style()->setPerspective(perspectiveValue); | 882 state.style()->setPerspective(perspectiveValue); |
| 953 } | 883 } |
| 954 | 884 |
| 955 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextOrientation(StyleReso
lverState& state, CSSValue* value) | 885 void StyleBuilderFunctions::applyValueCSSPropertyWebkitTextOrientation(StyleReso
lverState& state, CSSValue* value) |
| 956 { | 886 { |
| 957 if (value->isPrimitiveValue()) | 887 if (value->isPrimitiveValue()) |
| 958 state.setTextOrientation(*toCSSPrimitiveValue(value)); | 888 state.setTextOrientation(*toCSSPrimitiveValue(value)); |
| 959 } | 889 } |
| 960 | 890 |
| 961 } // namespace blink | 891 } // namespace blink |
| OLD | NEW |