Fix crash when setting invalid @font-face descriptors via CSSOM.
When @font-face rules are parsed normally (as part of a stylesheet), the descriptors are parsed with CSSParserToken::ParseAsAtRuleDescriptorID, which is allowed to return kInvalid. However, when using CSSOM, the parsing takes a different path that first creates a CSSPropertyID, then converts it to a AtRuleDescriptorID using CSSPropertyIDAsAtRuleDescriptor, which *isn't* allowed to return kInvalid. Fix by allowing kInvalid, and gracefully handling this in CSSPropertyParser::ParseFontFaceDescriptor. Note that this is the only callsite for CSSPropertyIDAsAtRuleDescriptor. BUG=977953 Change-Id: I42081dd4bae3c828843be3ca994ff4f48d06a7f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1676629Reviewed-by:Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#673262}
Showing
Please register or sign in to comment