diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 10:22:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:36:28 +0000 |
commit | 271a6c3487a14599023a9106329505597638d793 (patch) | |
tree | e040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/third_party/blink/renderer/core/css/parser/css_property_parser.cc | |
parent | 7b2ffa587235a47d4094787d72f38102089f402a (diff) | |
download | qtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz |
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/css/parser/css_property_parser.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/css/parser/css_property_parser.cc | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/chromium/third_party/blink/renderer/core/css/parser/css_property_parser.cc b/chromium/third_party/blink/renderer/core/css/parser/css_property_parser.cc index 1da570e0fc8..db6b8898d6d 100644 --- a/chromium/third_party/blink/renderer/core/css/parser/css_property_parser.cc +++ b/chromium/third_party/blink/renderer/core/css/parser/css_property_parser.cc @@ -168,9 +168,16 @@ bool CSSPropertyParser::ParseValueStart(CSSPropertyID unresolved_property, return false; } +static inline bool IsExposedInMode(const CSSProperty& property, + CSSParserMode mode) { + return mode == kUASheetMode ? property.IsUAExposed() + : property.IsWebExposed(); +} + template <typename CharacterType> static CSSPropertyID UnresolvedCSSPropertyID(const CharacterType* property_name, - unsigned length) { + unsigned length, + CSSParserMode mode) { if (length == 0) return CSSPropertyID::kInvalid; if (length >= 2 && property_name[0] == '-' && property_name[1] == '-') @@ -192,24 +199,26 @@ static CSSPropertyID UnresolvedCSSPropertyID(const CharacterType* property_name, const Property* hash_table_entry = FindProperty(name, length); if (!hash_table_entry) return CSSPropertyID::kInvalid; - CSSPropertyID property = static_cast<CSSPropertyID>(hash_table_entry->id); - if (!CSSProperty::Get(resolveCSSPropertyID(property)).IsEnabled()) - return CSSPropertyID::kInvalid; - return property; + CSSPropertyID property_id = static_cast<CSSPropertyID>(hash_table_entry->id); + const CSSProperty& property = + CSSProperty::Get(resolveCSSPropertyID(property_id)); + bool exposed = IsExposedInMode(property, mode); + return exposed ? property_id : CSSPropertyID::kInvalid; } CSSPropertyID unresolvedCSSPropertyID(const String& string) { unsigned length = string.length(); + CSSParserMode mode = kHTMLStandardMode; return string.Is8Bit() - ? UnresolvedCSSPropertyID(string.Characters8(), length) - : UnresolvedCSSPropertyID(string.Characters16(), length); + ? UnresolvedCSSPropertyID(string.Characters8(), length, mode) + : UnresolvedCSSPropertyID(string.Characters16(), length, mode); } -CSSPropertyID UnresolvedCSSPropertyID(StringView string) { +CSSPropertyID UnresolvedCSSPropertyID(StringView string, CSSParserMode mode) { unsigned length = string.length(); return string.Is8Bit() - ? UnresolvedCSSPropertyID(string.Characters8(), length) - : UnresolvedCSSPropertyID(string.Characters16(), length); + ? UnresolvedCSSPropertyID(string.Characters8(), length, mode) + : UnresolvedCSSPropertyID(string.Characters16(), length, mode); } template <typename CharacterType> @@ -379,7 +388,8 @@ bool CSSPropertyParser::ParseFontFaceDescriptor( // TODO(meade): This function should eventually take an AtRuleDescriptorID. const AtRuleDescriptorID id = CSSPropertyIDAsAtRuleDescriptor(resolved_property); - DCHECK_NE(id, AtRuleDescriptorID::Invalid); + if (id == AtRuleDescriptorID::Invalid) + return false; CSSValue* parsed_value = AtRuleDescriptorParser::ParseFontFaceDescriptor(id, range_, *context_); if (!parsed_value) |