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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp

Issue 1427973004: Fix crash when combining text-emphasis with CSS variables (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/variables/webkit-text-emphasis-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSParserImpl.h" 6 #include "core/css/parser/CSSParserImpl.h"
7 7
8 #include "core/css/CSSCustomPropertyDeclaration.h" 8 #include "core/css/CSSCustomPropertyDeclaration.h"
9 #include "core/css/CSSKeyframesRule.h" 9 #include "core/css/CSSKeyframesRule.h"
10 #include "core/css/CSSStyleSheet.h" 10 #include "core/css/CSSStyleSheet.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return declaration->addParsedProperties(parser.m_parsedProperties); 51 return declaration->addParsedProperties(parser.m_parsedProperties);
52 } 52 }
53 53
54 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties) 54 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties)
55 { 55 {
56 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found. 56 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
57 for (size_t i = input.size(); i--; ) { 57 for (size_t i = input.size(); i--; ) {
58 const CSSProperty& property = input[i]; 58 const CSSProperty& property = input[i];
59 if (property.isImportant() != important) 59 if (property.isImportant() != important)
60 continue; 60 continue;
61 const unsigned propertyIDIndex = property.id(); 61 const unsigned propertyIDIndex = property.id() - firstCSSProperty;
62 // All custom properties use the same CSSPropertyID so we can't remove r epeated definitions 62 // All custom properties use the same CSSPropertyID so we can't remove r epeated definitions
63 if (property.id() != CSSPropertyVariable) { 63 if (property.id() != CSSPropertyVariable) {
64 if (seenProperties.get(propertyIDIndex)) 64 if (seenProperties.get(propertyIDIndex))
65 continue; 65 continue;
66 seenProperties.set(propertyIDIndex); 66 seenProperties.set(propertyIDIndex);
67 } 67 }
68 output[--unusedEntries] = property; 68 output[--unusedEntries] = property;
69 } 69 }
70 } 70 }
71 71
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 else 747 else
748 return nullptr; // Parser error, invalid value in keyframe selector 748 return nullptr; // Parser error, invalid value in keyframe selector
749 if (range.atEnd()) 749 if (range.atEnd())
750 return result.release(); 750 return result.release();
751 if (range.consume().type() != CommaToken) 751 if (range.consume().type() != CommaToken)
752 return nullptr; // Parser error 752 return nullptr; // Parser error
753 } 753 }
754 } 754 }
755 755
756 } // namespace blink 756 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/variables/webkit-text-emphasis-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698