Commit 32c5f6b3 authored by Eddy Mead's avatar Eddy Mead Committed by Commit Bot

Fix segfault in AtRuleCSSStyleDeclaration::getPropertyValue

Bug: 803453, 803520
Change-Id: I3870ea56cd8349704621f3a72b64b69a24624680
Reviewed-on: https://chromium-review.googlesource.com/874981Reviewed-by: default avatarnainar <nainar@chromium.org>
Commit-Queue: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530434}
parent 91243b3f
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style id="styleElement">
@font-face {}
</style>
<script>
test(() => {
let fontFaceRule = styleElement.sheet.rules[0];
assert_equals(fontFaceRule.style.getPropertyValue('font-display'), "");
}, "This test should not crash");
</script>
...@@ -51,7 +51,11 @@ String AtRuleCSSStyleDeclaration::getPropertyValue( ...@@ -51,7 +51,11 @@ String AtRuleCSSStyleDeclaration::getPropertyValue(
if (id == AtRuleDescriptorID::Invalid) if (id == AtRuleDescriptorID::Invalid)
return g_empty_string; return g_empty_string;
return descriptor_value_set_->GetPropertyCSSValue(id)->CssText(); const CSSValue* value = descriptor_value_set_->GetPropertyCSSValue(id);
if (value)
return value->CssText();
return g_empty_string;
} }
String AtRuleCSSStyleDeclaration::getPropertyPriority( String AtRuleCSSStyleDeclaration::getPropertyPriority(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment