Changeset 274675 in webkit
- Timestamp:
- Mar 18, 2021, 3:09:49 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
page/PrintContext.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r274673 r274675 1 2021-03-18 Rob Buis <rbuis@igalia.com> 2 3 Protect frame before calling setPrinting 4 https://bugs.webkit.org/show_bug.cgi?id=222664 5 6 Reviewed by Ryosuke Niwa. 7 8 Protect frame before calling setPrinting 9 since it could potentially delete the frame 10 through event handling. 11 12 * page/PrintContext.cpp: 13 (WebCore::PrintContext::begin): 14 1 15 2021-03-18 Antti Koivisto <antti@apple.com> 2 16 -
trunk/Source/WebCore/page/PrintContext.cpp
r264565 r274675 192 192 return; 193 193 194 auto & frame = *this->frame();194 auto frame = makeRef(*this->frame()); 195 195 // This function can be called multiple times to adjust printing parameters without going back to screen mode. 196 196 m_isPrinting = true; 197 197 198 198 FloatSize originalPageSize = FloatSize(width, height); 199 FloatSize minLayoutSize = frame .resizePageRectsKeepingRatio(originalPageSize, FloatSize(width * minimumShrinkFactor(), height * minimumShrinkFactor()));199 FloatSize minLayoutSize = frame->resizePageRectsKeepingRatio(originalPageSize, FloatSize(width * minimumShrinkFactor(), height * minimumShrinkFactor())); 200 200 201 201 // This changes layout, so callers need to make sure that they don't paint to screen while in printing mode. 202 frame .setPrinting(true, minLayoutSize, originalPageSize, maximumShrinkFactor() / minimumShrinkFactor(), AdjustViewSize);202 frame->setPrinting(true, minLayoutSize, originalPageSize, maximumShrinkFactor() / minimumShrinkFactor(), AdjustViewSize); 203 203 } 204 204
Note:
See TracChangeset
for help on using the changeset viewer.