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

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

Issue 1541443002: Fix small bugs in new CSS Property parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V4 Created 4 years, 12 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
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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 void StyleBuilderFunctions::applyInheritCSSPropertyWillChange(StyleResolverState & state) 643 void StyleBuilderFunctions::applyInheritCSSPropertyWillChange(StyleResolverState & state)
644 { 644 {
645 state.style()->setWillChangeContents(state.parentStyle()->willChangeContents ()); 645 state.style()->setWillChangeContents(state.parentStyle()->willChangeContents ());
646 state.style()->setWillChangeScrollPosition(state.parentStyle()->willChangeSc rollPosition()); 646 state.style()->setWillChangeScrollPosition(state.parentStyle()->willChangeSc rollPosition());
647 state.style()->setWillChangeProperties(state.parentStyle()->willChangeProper ties()); 647 state.style()->setWillChangeProperties(state.parentStyle()->willChangeProper ties());
648 state.style()->setSubtreeWillChangeContents(state.parentStyle()->subtreeWill ChangeContents()); 648 state.style()->setSubtreeWillChangeContents(state.parentStyle()->subtreeWill ChangeContents());
649 } 649 }
650 650
651 void StyleBuilderFunctions::applyValueCSSPropertyWillChange(StyleResolverState& state, CSSValue* value) 651 void StyleBuilderFunctions::applyValueCSSPropertyWillChange(StyleResolverState& state, CSSValue* value)
652 { 652 {
653 ASSERT(value->isValueList());
654 bool willChangeContents = false; 653 bool willChangeContents = false;
655 bool willChangeScrollPosition = false; 654 bool willChangeScrollPosition = false;
656 Vector<CSSPropertyID> willChangeProperties; 655 Vector<CSSPropertyID> willChangeProperties;
657 656
658 for (auto& willChangeValue : toCSSValueList(*value)) { 657 if (value->isPrimitiveValue()) {
659 if (willChangeValue->isCustomIdentValue()) 658 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueAuto);
660 willChangeProperties.append(toCSSCustomIdentValue(*willChangeValue). valueAsPropertyID()); 659 } else {
661 else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSValueC ontents) 660 ASSERT(value->isValueList());
662 willChangeContents = true; 661 for (auto& willChangeValue : toCSSValueList(*value)) {
663 else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSValueS crollPosition) 662 if (willChangeValue->isCustomIdentValue())
664 willChangeScrollPosition = true; 663 willChangeProperties.append(toCSSCustomIdentValue(*willChangeVal ue).valueAsPropertyID());
665 else 664 else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSVa lueContents)
666 ASSERT_NOT_REACHED(); 665 willChangeContents = true;
666 else if (toCSSPrimitiveValue(*willChangeValue).getValueID() == CSSVa lueScrollPosition)
667 willChangeScrollPosition = true;
668 else
669 ASSERT_NOT_REACHED();
670 }
667 } 671 }
668 state.style()->setWillChangeContents(willChangeContents); 672 state.style()->setWillChangeContents(willChangeContents);
669 state.style()->setWillChangeScrollPosition(willChangeScrollPosition); 673 state.style()->setWillChangeScrollPosition(willChangeScrollPosition);
670 state.style()->setWillChangeProperties(willChangeProperties); 674 state.style()->setWillChangeProperties(willChangeProperties);
671 state.style()->setSubtreeWillChangeContents(willChangeContents || state.pare ntStyle()->subtreeWillChangeContents()); 675 state.style()->setSubtreeWillChangeContents(willChangeContents || state.pare ntStyle()->subtreeWillChangeContents());
672 } 676 }
673 677
674 void StyleBuilderFunctions::applyInitialCSSPropertyContent(StyleResolverState& s tate) 678 void StyleBuilderFunctions::applyInitialCSSPropertyContent(StyleResolverState& s tate)
675 { 679 {
676 state.style()->clearContent(); 680 state.style()->clearContent();
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 return; 867 return;
864 case CSSValueSuper: 868 case CSSValueSuper:
865 svgStyle.setBaselineShift(BS_SUPER); 869 svgStyle.setBaselineShift(BS_SUPER);
866 return; 870 return;
867 default: 871 default:
868 ASSERT_NOT_REACHED(); 872 ASSERT_NOT_REACHED();
869 } 873 }
870 } 874 }
871 875
872 } // namespace blink 876 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698