Title: [209226] trunk/Source/WebCore
Revision
209226
Author
bfulg...@apple.com
Date
2016-12-01 17:30:46 -0800 (Thu, 01 Dec 2016)

Log Message

Rare crash when preparing to print
https://bugs.webkit.org/show_bug.cgi?id=165280
<rdar://problem/28240254>

Reviewed by Dean Jackson.

* page/Frame.cpp:
(WebCore::Frame::setPrinting): Only manipulate the FrameView if it is non-null.
(WebCore::Frame::documentAtPoint): Drive-by fix to change a 0 return to nullptr.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209225 => 209226)


--- trunk/Source/WebCore/ChangeLog	2016-12-02 01:24:30 UTC (rev 209225)
+++ trunk/Source/WebCore/ChangeLog	2016-12-02 01:30:46 UTC (rev 209226)
@@ -1,3 +1,15 @@
+2016-12-01  Brent Fulgham  <bfulg...@apple.com>
+
+        Rare crash when preparing to print
+        https://bugs.webkit.org/show_bug.cgi?id=165280
+        <rdar://problem/28240254>
+
+        Reviewed by Dean Jackson.
+
+        * page/Frame.cpp:
+        (WebCore::Frame::setPrinting): Only manipulate the FrameView if it is non-null.
+        (WebCore::Frame::documentAtPoint): Drive-by fix to change a 0 return to nullptr.
+
 2016-12-01  Simon Fraser  <simon.fra...@apple.com>
 
         Put an obvious debug border on layers with backdrop filters

Modified: trunk/Source/WebCore/page/Frame.cpp (209225 => 209226)


--- trunk/Source/WebCore/page/Frame.cpp	2016-12-02 01:24:30 UTC (rev 209225)
+++ trunk/Source/WebCore/page/Frame.cpp	2016-12-02 01:30:46 UTC (rev 209226)
@@ -643,15 +643,17 @@
     ResourceCacheValidationSuppressor validationSuppressor(m_doc->cachedResourceLoader());
 
     m_doc->setPrinting(printing);
-    view()->adjustMediaTypeForPrinting(printing);
+    if (auto* frameView = view()) {
+        frameView->adjustMediaTypeForPrinting(printing);
 
-    m_doc->styleScope().didChangeStyleSheetEnvironment();
-    if (shouldUsePrintingLayout()) {
-        view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
-    } else {
-        view()->forceLayout();
-        if (shouldAdjustViewSize == AdjustViewSize)
-            view()->adjustViewSize();
+        m_doc->styleScope().didChangeStyleSheetEnvironment();
+        if (shouldUsePrintingLayout())
+            frameView->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
+        else {
+            frameView->forceLayout();
+            if (shouldAdjustViewSize == AdjustViewSize)
+                frameView->adjustViewSize();
+        }
     }
 
     // Subframes of the one we're printing don't lay out to the page size.
@@ -813,7 +815,7 @@
 Document* Frame::documentAtPoint(const IntPoint& point)
 {
     if (!view())
-        return 0;
+        return nullptr;
 
     IntPoint pt = view()->windowToContents(point);
     HitTestResult result = HitTestResult(pt);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to