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

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

Issue 298723011: Make 'will-change: contents' suppress compositing in subtree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 t |= t2; 1084 t |= t2;
1085 } 1085 }
1086 state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t )); 1086 state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t ));
1087 } 1087 }
1088 1088
1089 void StyleBuilderFunctions::applyInitialCSSPropertyWillChange(StyleResolverState & state) 1089 void StyleBuilderFunctions::applyInitialCSSPropertyWillChange(StyleResolverState & state)
1090 { 1090 {
1091 state.style()->setWillChangeContents(false); 1091 state.style()->setWillChangeContents(false);
1092 state.style()->setWillChangeScrollPosition(false); 1092 state.style()->setWillChangeScrollPosition(false);
1093 state.style()->setWillChangeProperties(Vector<CSSPropertyID>()); 1093 state.style()->setWillChangeProperties(Vector<CSSPropertyID>());
1094 state.style()->setSubtreeWillChangeContents(state.parentStyle()->subtreeWill ChangeContents());
1094 } 1095 }
1095 1096
1096 void StyleBuilderFunctions::applyInheritCSSPropertyWillChange(StyleResolverState & state) 1097 void StyleBuilderFunctions::applyInheritCSSPropertyWillChange(StyleResolverState & state)
1097 { 1098 {
1098 state.style()->setWillChangeContents(state.parentStyle()->willChangeContents ()); 1099 state.style()->setWillChangeContents(state.parentStyle()->willChangeContents ());
1099 state.style()->setWillChangeScrollPosition(state.parentStyle()->willChangeSc rollPosition()); 1100 state.style()->setWillChangeScrollPosition(state.parentStyle()->willChangeSc rollPosition());
1100 state.style()->setWillChangeProperties(state.parentStyle()->willChangeProper ties()); 1101 state.style()->setWillChangeProperties(state.parentStyle()->willChangeProper ties());
1102 state.style()->setSubtreeWillChangeContents(state.parentStyle()->subtreeWill ChangeContents());
1101 } 1103 }
1102 1104
1103 void StyleBuilderFunctions::applyValueCSSPropertyWillChange(StyleResolverState& state, CSSValue* value) 1105 void StyleBuilderFunctions::applyValueCSSPropertyWillChange(StyleResolverState& state, CSSValue* value)
1104 { 1106 {
1105 ASSERT(value->isValueList()); 1107 ASSERT(value->isValueList());
1106 bool willChangeContents = false; 1108 bool willChangeContents = false;
1107 bool willChangeScrollPosition = false; 1109 bool willChangeScrollPosition = false;
1108 Vector<CSSPropertyID> willChangeProperties; 1110 Vector<CSSPropertyID> willChangeProperties;
1109 1111
1110 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { 1112 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1111 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(i.value()); 1113 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(i.value());
1112 if (CSSPropertyID propertyID = primitiveValue->getPropertyID()) 1114 if (CSSPropertyID propertyID = primitiveValue->getPropertyID())
1113 willChangeProperties.append(propertyID); 1115 willChangeProperties.append(propertyID);
1114 else if (primitiveValue->getValueID() == CSSValueContents) 1116 else if (primitiveValue->getValueID() == CSSValueContents)
1115 willChangeContents = true; 1117 willChangeContents = true;
1116 else if (primitiveValue->getValueID() == CSSValueScrollPosition) 1118 else if (primitiveValue->getValueID() == CSSValueScrollPosition)
1117 willChangeScrollPosition = true; 1119 willChangeScrollPosition = true;
1118 else 1120 else
1119 ASSERT_NOT_REACHED(); 1121 ASSERT_NOT_REACHED();
1120 } 1122 }
1121 state.style()->setWillChangeContents(willChangeContents); 1123 state.style()->setWillChangeContents(willChangeContents);
1122 state.style()->setWillChangeScrollPosition(willChangeScrollPosition); 1124 state.style()->setWillChangeScrollPosition(willChangeScrollPosition);
1123 state.style()->setWillChangeProperties(willChangeProperties); 1125 state.style()->setWillChangeProperties(willChangeProperties);
1126 state.style()->setSubtreeWillChangeContents(willChangeContents || state.pare ntStyle()->subtreeWillChangeContents());
1124 } 1127 }
1125 1128
1126 void StyleBuilderFunctions::applyInitialCSSPropertyContent(StyleResolverState& s tate) 1129 void StyleBuilderFunctions::applyInitialCSSPropertyContent(StyleResolverState& s tate)
1127 { 1130 {
1128 state.style()->clearContent(); 1131 state.style()->clearContent();
1129 } 1132 }
1130 1133
1131 void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&) 1134 void StyleBuilderFunctions::applyInheritCSSPropertyContent(StyleResolverState&)
1132 { 1135 {
1133 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not . This 1136 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not . This
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 default: 1387 default:
1385 break; 1388 break;
1386 } 1389 }
1387 } else { 1390 } else {
1388 svgStyle->setBaselineShift(BS_LENGTH); 1391 svgStyle->setBaselineShift(BS_LENGTH);
1389 svgStyle->setBaselineShiftValue(SVGLength::fromCSSPrimitiveValue(primiti veValue)); 1392 svgStyle->setBaselineShiftValue(SVGLength::fromCSSPrimitiveValue(primiti veValue));
1390 } 1393 }
1391 } 1394 }
1392 1395
1393 } // namespace WebCore 1396 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698