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

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 167603002: Implement 'will-change' parsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 857
858 unsigned t = 0; 858 unsigned t = 0;
859 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { 859 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
860 CSSValue* item = i.value(); 860 CSSValue* item = i.value();
861 TextUnderlinePosition t2 = *toCSSPrimitiveValue(item); 861 TextUnderlinePosition t2 = *toCSSPrimitiveValue(item);
862 t |= t2; 862 t |= t2;
863 } 863 }
864 state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t )); 864 state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t ));
865 } 865 }
866 866
867 void StyleBuilderFunctions::applyInitialCSSPropertyWillChange(StyleResolverState & state)
868 {
869 state.style()->setWillChangeContents(false);
870 state.style()->setWillChangeScrollPosition(false);
871 state.style()->setWillChangeProperties(Vector<CSSPropertyID>());
872 }
873
874 void StyleBuilderFunctions::applyInheritCSSPropertyWillChange(StyleResolverState & state)
875 {
876 state.style()->setWillChangeContents(state.parentStyle()->willChangeContents ());
877 state.style()->setWillChangeScrollPosition(state.parentStyle()->willChangeSc rollPosition());
878 state.style()->setWillChangeProperties(state.parentStyle()->willChangeProper ties());
879 }
880
881 void StyleBuilderFunctions::applyValueCSSPropertyWillChange(StyleResolverState& state, CSSValue* value)
882 {
883 ASSERT(value->isValueList());
884 bool willChangeContents = false;
885 bool willChangeScrollPosition = false;
886 Vector<CSSPropertyID> willChangeProperties;
887
888 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
889 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(i.value());
890 if (CSSPropertyID propertyID = primitiveValue->getPropertyID())
891 willChangeProperties.append(propertyID);
892 else if (primitiveValue->getValueID() == CSSValueContents)
893 willChangeContents = true;
894 else if (primitiveValue->getValueID() == CSSValueScrollPosition)
895 willChangeScrollPosition = true;
896 else
897 ASSERT_NOT_REACHED();
898 }
899 state.style()->setWillChangeContents(willChangeContents);
900 state.style()->setWillChangeScrollPosition(willChangeScrollPosition);
901 state.style()->setWillChangeProperties(willChangeProperties);
902 }
903
867 // Everything below this line is from the old StyleResolver::applyProperty 904 // Everything below this line is from the old StyleResolver::applyProperty
868 // and eventually needs to move into new StyleBuilderFunctions calls intead. 905 // and eventually needs to move into new StyleBuilderFunctions calls intead.
869 906
870 #define HANDLE_INHERIT(prop, Prop) \ 907 #define HANDLE_INHERIT(prop, Prop) \
871 if (isInherit) { \ 908 if (isInherit) { \
872 state.style()->set##Prop(state.parentStyle()->prop()); \ 909 state.style()->set##Prop(state.parentStyle()->prop()); \
873 return; \ 910 return; \
874 } 911 }
875 912
876 #define HANDLE_INHERIT_AND_INITIAL(prop, Prop) \ 913 #define HANDLE_INHERIT_AND_INITIAL(prop, Prop) \
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 case CSSPropertyWebkitWrapFlow: 1974 case CSSPropertyWebkitWrapFlow:
1938 case CSSPropertyShapeMargin: 1975 case CSSPropertyShapeMargin:
1939 case CSSPropertyShapePadding: 1976 case CSSPropertyShapePadding:
1940 case CSSPropertyShapeImageThreshold: 1977 case CSSPropertyShapeImageThreshold:
1941 case CSSPropertyWebkitWrapThrough: 1978 case CSSPropertyWebkitWrapThrough:
1942 case CSSPropertyShapeInside: 1979 case CSSPropertyShapeInside:
1943 case CSSPropertyShapeOutside: 1980 case CSSPropertyShapeOutside:
1944 case CSSPropertyWhiteSpace: 1981 case CSSPropertyWhiteSpace:
1945 case CSSPropertyWidows: 1982 case CSSPropertyWidows:
1946 case CSSPropertyWidth: 1983 case CSSPropertyWidth:
1984 case CSSPropertyWillChange:
1947 case CSSPropertyWordBreak: 1985 case CSSPropertyWordBreak:
1948 case CSSPropertyWordSpacing: 1986 case CSSPropertyWordSpacing:
1949 case CSSPropertyWordWrap: 1987 case CSSPropertyWordWrap:
1950 case CSSPropertyZIndex: 1988 case CSSPropertyZIndex:
1951 case CSSPropertyZoom: 1989 case CSSPropertyZoom:
1952 case CSSPropertyFontFamily: 1990 case CSSPropertyFontFamily:
1953 case CSSPropertyGridAutoFlow: 1991 case CSSPropertyGridAutoFlow:
1954 case CSSPropertyMarker: 1992 case CSSPropertyMarker:
1955 case CSSPropertyAlignmentBaseline: 1993 case CSSPropertyAlignmentBaseline:
1956 case CSSPropertyBufferedRendering: 1994 case CSSPropertyBufferedRendering:
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 break; 2171 break;
2134 } 2172 }
2135 case CSSPropertyEnableBackground: 2173 case CSSPropertyEnableBackground:
2136 // Silently ignoring this property for now 2174 // Silently ignoring this property for now
2137 // http://bugs.webkit.org/show_bug.cgi?id=6022 2175 // http://bugs.webkit.org/show_bug.cgi?id=6022
2138 break; 2176 break;
2139 } 2177 }
2140 } 2178 }
2141 2179
2142 } // namespace WebCore 2180 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698