Title: [277662] branches/safari-612.1.12-branch/Source/WebCore
Revision
277662
Author
alanc...@apple.com
Date
2021-05-18 10:55:16 -0700 (Tue, 18 May 2021)

Log Message

Cherry-pick r276796. rdar://problem/78162377

    Unreviewed, fix crashloop after r276744
    <rdar://problem/77333886>

    * dom/Document.cpp:
    (WebCore::Document::determineSampledPageTopColor):
    Don't attempt to get the value from the `Optional<Lab<float>>` unless we know for sure that
    it's valid. This amounts to always making sure we either `continue` (or `return` if that
    snapshot is not an outlier) instead of only doing it if the snapshot is an outlier.

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

Modified Paths

Diff

Modified: branches/safari-612.1.12-branch/Source/WebCore/ChangeLog (277661 => 277662)


--- branches/safari-612.1.12-branch/Source/WebCore/ChangeLog	2021-05-18 17:42:19 UTC (rev 277661)
+++ branches/safari-612.1.12-branch/Source/WebCore/ChangeLog	2021-05-18 17:55:16 UTC (rev 277662)
@@ -1,3 +1,29 @@
+2021-05-18  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r276796. rdar://problem/78162377
+
+    Unreviewed, fix crashloop after r276744
+    <rdar://problem/77333886>
+    
+    * dom/Document.cpp:
+    (WebCore::Document::determineSampledPageTopColor):
+    Don't attempt to get the value from the `Optional<Lab<float>>` unless we know for sure that
+    it's valid. This amounts to always making sure we either `continue` (or `return` if that
+    snapshot is not an outlier) instead of only doing it if the snapshot is an outlier.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-29  Devin Rousso  <drou...@apple.com>
+
+            Unreviewed, fix crashloop after r276744
+            <rdar://problem/77333886>
+
+            * dom/Document.cpp:
+            (WebCore::Document::determineSampledPageTopColor):
+            Don't attempt to get the value from the `Optional<Lab<float>>` unless we know for sure that
+            it's valid. This amounts to always making sure we either `continue` (or `return` if that
+            snapshot is not an outlier) instead of only doing it if the snapshot is an outlier.
+
 2021-05-13  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r277453. rdar://problem/77996171

Modified: branches/safari-612.1.12-branch/Source/WebCore/dom/Document.cpp (277661 => 277662)


--- branches/safari-612.1.12-branch/Source/WebCore/dom/Document.cpp	2021-05-18 17:42:19 UTC (rev 277661)
+++ branches/safari-612.1.12-branch/Source/WebCore/dom/Document.cpp	2021-05-18 17:55:16 UTC (rev 277662)
@@ -3963,8 +3963,11 @@
 
     for (size_t i = 0; i < numSnapshots; ++i) {
         auto snapshot = pixelColorAtTopX(frameWidth * i / (numSnapshots - 1));
-        if (!snapshot && !shouldStopAfterFindingNonMatchingColor(i))
-            return;
+        if (!snapshot) {
+            if (shouldStopAfterFindingNonMatchingColor(i))
+                return;
+            continue;
+        }
 
         snapshots[i] = *snapshot;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to