Skip to content

Commit

Permalink
[REV] Reverted layout speed-ups until we find a way to make them work…
Browse files Browse the repository at this point in the history
… with headers and footers
  • Loading branch information
sleepy-monax committed Feb 22, 2024
1 parent 962cc77 commit 38c9770
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
13 changes: 12 additions & 1 deletion qt/src/3rdparty/webkit/Source/WebCore/dom/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2119,7 +2119,18 @@ void Document::implicitClose()

frame()->loader()->checkCallImplicitClose();
RenderObject* renderObject = renderer();


// We used to force a synchronous display and flush here. This really isn't
// necessary and can in fact be actively harmful if pages are loading at a rate of > 60fps
// (if your platform is syncing flushes and limiting them to 60fps).
m_overMinimumLayoutThreshold = true;
if (!ownerElement() || (ownerElement()->renderer() && !ownerElement()->renderer()->needsLayout())) {
updateStyleIfNeeded();

// Always do a layout after loading if needed.
if (view() && renderObject && (!renderObject->firstChild() || renderObject->needsLayout()))
view()->layout();
}

#if PLATFORM(MAC) || PLATFORM(CHROMIUM)
if (f && renderObject && this == topDocument() && AXObjectCache::accessibilityEnabled()) {
Expand Down
13 changes: 9 additions & 4 deletions qt/src/3rdparty/webkit/Source/WebCore/page/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,16 @@ void Frame::setPrinting(bool printing, const FloatSize& pageSize, float maximumS
m_doc->setPrinting(printing);
view()->adjustMediaTypeForPrinting(printing);

if (not printing)
return;

m_doc->styleSelectorChanged(RecalcStyleImmediately);
view()->forceLayoutForPagination(pageSize, maximumShrinkRatio, shouldAdjustViewSize);
if (printing)
view()->forceLayoutForPagination(pageSize, maximumShrinkRatio, shouldAdjustViewSize);
else {
view()->forceLayout();
if (shouldAdjustViewSize == AdjustViewSize)
view()->adjustViewSize();
}

// Subframes of the one we're printing don't lay out to the page size.
for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
child->setPrinting(printing, IntSize(), 0, shouldAdjustViewSize);
}
Expand Down
4 changes: 1 addition & 3 deletions qt/src/3rdparty/webkit/Source/WebCore/page/FrameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ void FrameView::layout(bool allowSubtree)
m_size.setWidth(layoutWidth());
return;
}

// we shouldn't enter layout() while painting
ASSERT(!isPainting());
if (isPainting())
Expand All @@ -832,8 +832,6 @@ void FrameView::layout(bool allowSubtree)
ASSERT(m_frame->view() == this);

Document* document = m_frame->document();
if (!document->printing())
return;

m_layoutSchedulingEnabled = false;

Expand Down

0 comments on commit 38c9770

Please sign in to comment.