WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Followup patch to tidy up RenderBox::computeAbsoluteRepaintRect()
17840_cleanup.txt (text/plain), 5.58 KB, created by
Simon Fraser (smfr)
on 2008-11-11 23:32:18 PST
(
hide
)
Description:
Followup patch to tidy up RenderBox::computeAbsoluteRepaintRect()
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2008-11-11 23:32:18 PST
Size:
5.58 KB
patch
obsolete
>diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog >index 4f931eb..50be639 100644 >--- a/WebCore/ChangeLog >+++ b/WebCore/ChangeLog >@@ -2,6 +2,15 @@ > > Reviewed by NOBODY (OOPS!). > >+ Code cleanup in RenderBox::computeAbsoluteRepaintRect(). >+ >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::computeAbsoluteRepaintRect): >+ >+2008-11-11 Simon Fraser <simon.fraser@apple.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ > https://bugs.webkit.org/show_bug.cgi?id=17840 > > Fix repainting when the transform on a positioned element changes. >diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp >index ad42bf8..95a8026 100644 >--- a/WebCore/rendering/RenderBox.cpp >+++ b/WebCore/rendering/RenderBox.cpp >@@ -1180,62 +1180,63 @@ void RenderBox::computeAbsoluteRepaintRect(IntRect& rect, bool fixed) > invalidatingReflection = false; > } > >+ RenderObject* o = container(); >+ if (!o) >+ return; >+ > IntPoint topLeft = rect.location(); > topLeft.move(m_x, m_y); > > if (style()->position() == FixedPosition) > fixed = true; >- >- RenderObject* o = container(); >- if (o) { >- if (o->isBlockFlow() && style()->position() != AbsolutePosition && style()->position() != FixedPosition) { >- RenderBlock* cb = static_cast<RenderBlock*>(o); >- if (cb->hasColumns()) { >- IntRect repaintRect(topLeft, rect.size()); >- cb->adjustRectForColumns(repaintRect); >- topLeft = repaintRect.location(); >- rect = repaintRect; >- } >- } > >- // We are now in our parent container's coordinate space. Apply our transform to obtain a bounding box >- // in the parent's coordinate space that encloses us. >- if (m_layer && m_layer->transform()) { >- fixed = false; >- rect = m_layer->transform()->mapRect(rect); >- topLeft = rect.location(); >- topLeft.move(m_x, m_y); >+ if (o->isBlockFlow() && style()->position() != AbsolutePosition && style()->position() != FixedPosition) { >+ RenderBlock* cb = static_cast<RenderBlock*>(o); >+ if (cb->hasColumns()) { >+ IntRect repaintRect(topLeft, rect.size()); >+ cb->adjustRectForColumns(repaintRect); >+ topLeft = repaintRect.location(); >+ rect = repaintRect; > } >+ } > >- if (style()->position() == AbsolutePosition) >- topLeft += offsetForPositionedInContainer(o); >+ // We are now in our parent container's coordinate space. Apply our transform to obtain a bounding box >+ // in the parent's coordinate space that encloses us. >+ if (m_layer && m_layer->transform()) { >+ fixed = false; >+ rect = m_layer->transform()->mapRect(rect); >+ // FIXME: this clobbers topLeft adjustment done for multicol above >+ topLeft = rect.location(); >+ topLeft.move(m_x, m_y); >+ } > >+ if (style()->position() == AbsolutePosition) >+ topLeft += offsetForPositionedInContainer(o); >+ else if (style()->position() == RelativePosition && m_layer) { > // Apply the relative position offset when invalidating a rectangle. The layer > // is translated, but the render box isn't, so we need to do this to get the > // right dirty rect. Since this is called from RenderObject::setStyle, the relative position > // flag on the RenderObject has been cleared, so use the one on the style(). >- if (style()->position() == RelativePosition && m_layer) >- topLeft += m_layer->relativePositionOffset(); >- >- // FIXME: We ignore the lightweight clipping rect that controls use, since if |o| is in mid-layout, >- // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer. >- if (o->hasOverflowClip()) { >- // o->height() is inaccurate if we're in the middle of a layout of |o|, so use the >- // layer's size instead. Even if the layer's size is wrong, the layer itself will repaint >- // anyway if its size does change. >- IntRect boxRect(0, 0, o->layer()->width(), o->layer()->height()); >- int x = 0, y = 0; >- o->layer()->subtractScrolledContentOffset(x, y); // For overflow:auto/scroll/hidden. >- topLeft.move(x, y); >- IntRect repaintRect(topLeft, rect.size()); >- rect = intersection(repaintRect, boxRect); >- if (rect.isEmpty()) >- return; >- } else >- rect.setLocation(topLeft); >- >- o->computeAbsoluteRepaintRect(rect, fixed); >+ topLeft += m_layer->relativePositionOffset(); > } >+ >+ // FIXME: We ignore the lightweight clipping rect that controls use, since if |o| is in mid-layout, >+ // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer. >+ if (o->hasOverflowClip()) { >+ // o->height() is inaccurate if we're in the middle of a layout of |o|, so use the >+ // layer's size instead. Even if the layer's size is wrong, the layer itself will repaint >+ // anyway if its size does change. >+ topLeft -= o->layer()->scrolledContentOffset(); // For overflow:auto/scroll/hidden. >+ >+ IntRect repaintRect(topLeft, rect.size()); >+ IntRect boxRect(0, 0, o->layer()->width(), o->layer()->height()); >+ rect = intersection(repaintRect, boxRect); >+ if (rect.isEmpty()) >+ return; >+ } else >+ rect.setLocation(topLeft); >+ >+ o->computeAbsoluteRepaintRect(rect, fixed); > } > > void RenderBox::repaintDuringLayoutIfMoved(const IntRect& rect)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
hyatt
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 17840
:
19755
|
25084
|
25088
|
25089
| 25090