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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSUnparsedValue.cpp

Issue 2873943002: Ensure original parser context is used when parsing resolved var() references (Closed)
Patch Set: g cl set-commit Created 3 years, 7 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/css/cssom/CSSUnparsedValue.h" 5 #include "core/css/cssom/CSSUnparsedValue.h"
6 6
7 #include "core/css/cssom/CSSStyleVariableReferenceValue.h" 7 #include "core/css/cssom/CSSStyleVariableReferenceValue.h"
8 #include "core/css/parser/CSSTokenizer.h" 8 #include "core/css/parser/CSSTokenizer.h"
9 #include "platform/wtf/text/StringBuilder.h" 9 #include "platform/wtf/text/StringBuilder.h"
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (fragments_[i].isString()) { 80 if (fragments_[i].isString()) {
81 tokens.Append(fragments_[i].getAsString()); 81 tokens.Append(fragments_[i].getAsString());
82 } else if (fragments_[i].isCSSVariableReferenceValue()) { 82 } else if (fragments_[i].isCSSVariableReferenceValue()) {
83 tokens.Append(fragments_[i].getAsCSSVariableReferenceValue()->variable()); 83 tokens.Append(fragments_[i].getAsCSSVariableReferenceValue()->variable());
84 } else { 84 } else {
85 NOTREACHED(); 85 NOTREACHED();
86 } 86 }
87 } 87 }
88 88
89 CSSTokenizer tokenizer(tokens.ToString()); 89 CSSTokenizer tokenizer(tokens.ToString());
90 return CSSVariableReferenceValue::Create(CSSVariableData::Create( 90 // TODO(alancutter): This should be using a real parser context instead of
91 tokenizer.TokenRange(), false /* isAnimationTainted */, 91 // StrictCSSParserContext.
92 true /* needsVariableResolution */)); 92 return CSSVariableReferenceValue::Create(
93 CSSVariableData::Create(tokenizer.TokenRange(),
94 false /* isAnimationTainted */,
95 true /* needsVariableResolution */),
96 *StrictCSSParserContext());
93 } 97 }
94 98
95 } // namespace blink 99 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698