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

Side by Side Diff: Source/core/css/StyleResolver.cpp

Issue 13943004: Avoid reparsing keyframe selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 // Apply the declaration to the style. This is a simplified version of t he logic in styleForElement 1091 // Apply the declaration to the style. This is a simplified version of t he logic in styleForElement
1092 initElement(e); 1092 initElement(e);
1093 m_state.initForStyleResolve(document(), e); 1093 m_state.initForStyleResolve(document(), e);
1094 1094
1095 const StyleKeyframe* keyframe = keyframes[i].get(); 1095 const StyleKeyframe* keyframe = keyframes[i].get();
1096 1096
1097 KeyframeValue keyframeValue(0, 0); 1097 KeyframeValue keyframeValue(0, 0);
1098 keyframeValue.setStyle(styleForKeyframe(elementStyle, keyframe, keyframe Value)); 1098 keyframeValue.setStyle(styleForKeyframe(elementStyle, keyframe, keyframe Value));
1099 1099
1100 // Add this keyframe style to all the indicated key times 1100 // Add this keyframe style to all the indicated key times
1101 Vector<float> keys; 1101 Vector<float> keys = keyframe->getKeys();
1102 keyframe->getKeys(keys);
1103 for (size_t keyIndex = 0; keyIndex < keys.size(); ++keyIndex) { 1102 for (size_t keyIndex = 0; keyIndex < keys.size(); ++keyIndex) {
1104 keyframeValue.setKey(keys[keyIndex]); 1103 keyframeValue.setKey(keys[keyIndex]);
1105 list.insert(keyframeValue); 1104 list.insert(keyframeValue);
1106 } 1105 }
1107 } 1106 }
1108 1107
1109 // If the 0% keyframe is missing, create it (but only if there is at least o ne other keyframe) 1108 // If the 0% keyframe is missing, create it (but only if there is at least o ne other keyframe)
1110 int initialListSize = list.size(); 1109 int initialListSize = list.size();
1111 if (initialListSize > 0 && list[0].key()) { 1110 if (initialListSize > 0 && list[0].key()) {
1112 static StyleKeyframe* zeroPercentKeyframe; 1111 static StyleKeyframe* zeroPercentKeyframe;
(...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after
4418 info.addMember(m_state, "state"); 4417 info.addMember(m_state, "state");
4419 4418
4420 // FIXME: move this to a place where it would be called only once? 4419 // FIXME: move this to a place where it would be called only once?
4421 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); 4420 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle");
4422 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e"); 4421 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e");
4423 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle,"defaultPrintStyle") ; 4422 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle,"defaultPrintStyle") ;
4424 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle"); 4423 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle");
4425 } 4424 }
4426 4425
4427 } // namespace WebCore 4426 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698