-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSSParserLocalContext represents local context for each property. Currently it only has one boolean field (use_alias_parsing), but it will be later extended to contain other info, such as whether the property is a longhand of a shorthand. BUG=668012 Review-Url: https://codereview.chromium.org/2901393002 Cr-Commit-Position: refs/heads/master@{#474897}
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
third_party/WebKit/Source/core/css/parser/CSSParserLocalContext.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "core/css/parser/CSSParserLocalContext.h" | ||
|
||
namespace blink { | ||
|
||
CSSParserLocalContext::CSSParserLocalContext() : use_alias_parsing_(false) {} | ||
|
||
CSSParserLocalContext::CSSParserLocalContext(bool use_alias_parsing) | ||
: use_alias_parsing_(use_alias_parsing) {} | ||
|
||
bool CSSParserLocalContext::GetUseAliasParsing() { | ||
return use_alias_parsing_; | ||
} | ||
|
||
} // namespace blink |
29 changes: 29 additions & 0 deletions
29
third_party/WebKit/Source/core/css/parser/CSSParserLocalContext.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CSSParserLocalContext_h | ||
#define CSSParserLocalContext_h | ||
|
||
#include "platform/wtf/Allocator.h" | ||
|
||
namespace blink { | ||
|
||
// A wrapper class containing all local context when parsing a property. | ||
// TODO(jiameng): add info for shorthand properties into this class. | ||
|
||
class CSSParserLocalContext { | ||
STACK_ALLOCATED(); | ||
|
||
public: | ||
CSSParserLocalContext(); | ||
explicit CSSParserLocalContext(bool use_alias_parsing); | ||
bool GetUseAliasParsing(); | ||
|
||
private: | ||
bool use_alias_parsing_; | ||
}; | ||
|
||
} // namespace blink | ||
|
||
#endif // CSSParserLocalContext_h |