Title: [119639] branches/safari-536-branch/Source/WebCore
Diff
Modified: branches/safari-536-branch/Source/WebCore/ChangeLog (119638 => 119639)
--- branches/safari-536-branch/Source/WebCore/ChangeLog 2012-06-07 00:01:24 UTC (rev 119638)
+++ branches/safari-536-branch/Source/WebCore/ChangeLog 2012-06-07 00:03:49 UTC (rev 119639)
@@ -1,5 +1,29 @@
2012-06-06 Mark Rowe <[email protected]>
+ Merge r119548.
+
+ 2012-06-05 Vitaly Buka <[email protected]>
+
+ Special layout handler should be done on top frame being printed.
+ https://bugs.webkit.org/show_bug.cgi?id=88201
+
+ Reviewed by Brady Eidson.
+
+ No new tests. Root case is already covered by tests.
+ Case described in the issue can be reproduced only by direct call
+ to Frame::setPrinting of subframe. Probably it's not possible with
+ layout tests.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::setPrinting):
+ Use shouldUsePrintingLayout to choose proper version of forceLayout().
+ (WebCore::Frame::shouldUsePrintingLayout):
+ Checks if current frame is the top frame being printed.
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::shouldUsePrintingLayout): Forward to Frame.
+
+2012-06-06 Mark Rowe <[email protected]>
+
Merge r119136.
2012-05-31 Brady Eidson <[email protected]>
Modified: branches/safari-536-branch/Source/WebCore/page/Frame.cpp (119638 => 119639)
--- branches/safari-536-branch/Source/WebCore/page/Frame.cpp 2012-06-07 00:01:24 UTC (rev 119638)
+++ branches/safari-536-branch/Source/WebCore/page/Frame.cpp 2012-06-07 00:03:49 UTC (rev 119639)
@@ -522,8 +522,7 @@
view()->adjustMediaTypeForPrinting(printing);
m_doc->styleResolverChanged(RecalcStyleImmediately);
- if (printing && !tree()->parent()) {
- // Only root frame should be fit to page size. Subframes should be constrained by parents only.
+ if (shouldUsePrintingLayout()) {
view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
} else {
view()->forceLayout();
@@ -536,6 +535,13 @@
child->setPrinting(printing, FloatSize(), FloatSize(), 0, shouldAdjustViewSize);
}
+bool Frame::shouldUsePrintingLayout() const
+{
+ // Only top frame being printed should be fit to page size.
+ // Subframes should be constrained by parents only.
+ return m_doc->printing() && (!tree()->parent() || !tree()->parent()->m_doc->printing());
+}
+
FloatSize Frame::resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize)
{
FloatSize resultSize;
Modified: branches/safari-536-branch/Source/WebCore/page/Frame.h (119638 => 119639)
--- branches/safari-536-branch/Source/WebCore/page/Frame.h 2012-06-07 00:01:24 UTC (rev 119638)
+++ branches/safari-536-branch/Source/WebCore/page/Frame.h 2012-06-07 00:03:49 UTC (rev 119639)
@@ -141,6 +141,7 @@
Settings* settings() const; // can be NULL
void setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot);
+ bool shouldUsePrintingLayout() const;
FloatSize resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize);
bool inViewSourceMode() const;
Modified: branches/safari-536-branch/Source/WebCore/rendering/RenderView.cpp (119638 => 119639)
--- branches/safari-536-branch/Source/WebCore/rendering/RenderView.cpp 2012-06-07 00:01:24 UTC (rev 119638)
+++ branches/safari-536-branch/Source/WebCore/rendering/RenderView.cpp 2012-06-07 00:03:49 UTC (rev 119639)
@@ -652,8 +652,7 @@
if (!printing() || !m_frameView)
return false;
Frame* frame = m_frameView->frame();
- // Only root frame should have special handling for printing.
- return frame && !frame->tree()->parent();
+ return frame && frame->shouldUsePrintingLayout();
}
size_t RenderView::getRetainedWidgets(Vector<RenderWidget*>& renderWidgets)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes