Title: [207988] branches/safari-602-branch/Source/WebCore

Diff

Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (207987 => 207988)


--- branches/safari-602-branch/Source/WebCore/ChangeLog	2016-10-27 11:01:06 UTC (rev 207987)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog	2016-10-27 11:18:52 UTC (rev 207988)
@@ -1,3 +1,16 @@
+2016-10-27  David Kilzer  <ddkil...@apple.com>
+
+        Fix merge r207708. rdar://problem/28962914
+
+        * html/MediaElementSession.cpp:
+        (WebCore::isElementRectMostlyInMainFrame): Call unsafeGet().
+        * platform/graphics/ImageSource.cpp:
+        (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Call unsafeGet().
+        * platform/graphics/IntRect.h:
+        (WebCore::IntRect::area): Replace non-template area() method with template version.
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createRasterShape): Call unsafeGet().
+
 2016-10-27  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r207930. rdar://problem/28811881

Modified: branches/safari-602-branch/Source/WebCore/html/MediaElementSession.cpp (207987 => 207988)


--- branches/safari-602-branch/Source/WebCore/html/MediaElementSession.cpp	2016-10-27 11:01:06 UTC (rev 207987)
+++ branches/safari-602-branch/Source/WebCore/html/MediaElementSession.cpp	2016-10-27 11:18:52 UTC (rev 207988)
@@ -657,10 +657,10 @@
 
     IntRect mainFrameRectAdjustedForScrollPosition = IntRect(-mainFrameView->documentScrollPositionRelativeToViewOrigin(), mainFrameView->contentsSize());
     IntRect elementRectInMainFrame = element.clientRect();
-    unsigned totalElementArea = elementRectInMainFrame.area();
+    unsigned totalElementArea = elementRectInMainFrame.area().unsafeGet();
     elementRectInMainFrame.intersect(mainFrameRectAdjustedForScrollPosition);
 
-    return elementRectInMainFrame.area() > totalElementArea / 2;
+    return elementRectInMainFrame.area().unsafeGet() > totalElementArea / 2;
 }
 
 static bool isElementLargeRelativeToMainFrame(const HTMLMediaElement& element)

Modified: branches/safari-602-branch/Source/WebCore/platform/graphics/ImageSource.cpp (207987 => 207988)


--- branches/safari-602-branch/Source/WebCore/platform/graphics/ImageSource.cpp	2016-10-27 11:01:06 UTC (rev 207987)
+++ branches/safari-602-branch/Source/WebCore/platform/graphics/ImageSource.cpp	2016-10-27 11:18:52 UTC (rev 207988)
@@ -103,7 +103,7 @@
     const SubsamplingLevel maxSubsamplingLevel = 3;
     
     for (SubsamplingLevel level = 0; level < maxSubsamplingLevel; ++level) {
-        if (frameSizeAtIndex(0, level).area() < maximumImageAreaBeforeSubsampling)
+        if (frameSizeAtIndex(0, level).area().unsafeGet() < maximumImageAreaBeforeSubsampling)
             return level;
     }
     

Modified: branches/safari-602-branch/Source/WebCore/platform/graphics/IntRect.h (207987 => 207988)


--- branches/safari-602-branch/Source/WebCore/platform/graphics/IntRect.h	2016-10-27 11:01:06 UTC (rev 207987)
+++ branches/safari-602-branch/Source/WebCore/platform/graphics/IntRect.h	2016-10-27 11:18:52 UTC (rev 207988)
@@ -85,9 +85,10 @@
     int maxY() const { return y() + height(); }
     int width() const { return m_size.width(); }
     int height() const { return m_size.height(); }
-    
-    unsigned area() const { return m_size.area().unsafeGet(); }
 
+    template <typename T = WTF::CrashOnOverflow>
+    Checked<unsigned, T> area() const { return m_size.area<T>(); }
+
     void setX(int x) { m_location.setX(x); }
     void setY(int y) { m_location.setY(y); }
     void setWidth(int width) { m_size.setWidth(width); }

Modified: branches/safari-602-branch/Source/WebCore/rendering/shapes/Shape.cpp (207987 => 207988)


--- branches/safari-602-branch/Source/WebCore/rendering/shapes/Shape.cpp	2016-10-27 11:01:06 UTC (rev 207987)
+++ branches/safari-602-branch/Source/WebCore/rendering/shapes/Shape.cpp	2016-10-27 11:18:52 UTC (rev 207988)
@@ -196,7 +196,7 @@
         int minBufferY = std::max(0, marginRect.y() - imageRect.y());
         int maxBufferY = std::min(imageRect.height(), marginRect.maxY() - imageRect.y());
 
-        if ((imageRect.area() * 4) == pixelArrayLength) {
+        if ((imageRect.area() * 4).unsafeGet() == pixelArrayLength) {
             for (int y = minBufferY; y < maxBufferY; ++y) {
                 int startX = -1;
                 for (int x = 0; x < imageRect.width(); ++x, pixelArrayOffset += 4) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to