CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: WTF::match...
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Dec 2016 09:58:06 +0000 (09:58 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Dec 2016 09:58:06 +0000 (09:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165652
rdar://problem/28465278

Reviewed by Darin Adler.

No, test don't know how to get here.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertContentAlignmentData):

Add type checks.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209659 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/StyleBuilderConverter.h

index e9a1e22..d524066 100644 (file)
@@ -1,3 +1,18 @@
+2016-12-10  Antti Koivisto  <antti@apple.com>
+
+        CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: WTF::match_constness<WebCore::CSSValue, WebCore::CSSContentDistributionValue>::type& WTF::downcast<WebCore::CSSContentDistributionValue, WebCore::CSSValue> + 65
+        https://bugs.webkit.org/show_bug.cgi?id=165652
+        rdar://problem/28465278
+
+        Reviewed by Darin Adler.
+
+        No, test don't know how to get here.
+
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertContentAlignmentData):
+
+        Add type checks.
+
 2016-12-10  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebCrypto] RSA algorithms should allow importing keys without usages
index 1ea883c..de9a767 100644 (file)
@@ -1356,6 +1356,8 @@ inline StyleContentAlignmentData StyleBuilderConverter::convertContentAlignmentD
     StyleContentAlignmentData alignmentData = RenderStyle::initialContentAlignment();
 #if ENABLE(CSS_GRID_LAYOUT)
     if (RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled()) {
+        if (!is<CSSContentDistributionValue>(value))
+            return alignmentData;
         auto& contentValue = downcast<CSSContentDistributionValue>(value);
         if (contentValue.distribution()->valueID() != CSSValueInvalid)
             alignmentData.setDistribution(contentValue.distribution().get());
@@ -1366,6 +1368,8 @@ inline StyleContentAlignmentData StyleBuilderConverter::convertContentAlignmentD
         return alignmentData;
     }
 #endif
+    if (!is<CSSPrimitiveValue>(value))
+        return alignmentData;
     auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     switch (primitiveValue.valueID()) {
     case CSSValueStretch: