Commit 5b1b7704 authored by darin's avatar darin

LayoutTests:

        Reviewed by Hyatt.

        - repaint test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9121
          REGRESSION: [Incremental Repaint] DHTML movement test failures

        * fast/repaint/containing-block-position-change-expected.checksum: Added.
        * fast/repaint/containing-block-position-change-expected.png: Added.
        * fast/repaint/containing-block-position-change-expected.txt: Added.
        * fast/repaint/containing-block-position-change.html: Added.

WebCore:

        Reviewed by Hyatt.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9121
          REGRESSION: [Incremental Repaint] DHTML movement test failures

        Test (repaint): fast/repaint/containing-block-position-change.html

        * manual-tests/containing-block-position-chage.html: Added.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::layoutBlock): Unrelated change: fixed typo from
        the RenderCanvas to RenderView rename.
        (WebCore::RenderBlock::removePositionedObject): Added a return immediately
        after removing the object.
        (WebCore::RenderBlock::removePositionedObjects): Added.
        * rendering/RenderBlock.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::setStyle): Added code to remove absolutely positioned
        descendants from the positioned objects list of their current containing block
        when they are going to have a new one as a result of this block's position
        property changing. 
        * rendering/RenderObject.h:
        (WebCore::RenderObject::removePositionedObjects):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ffa253c8
2006-06-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
- repaint test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9121
REGRESSION: [Incremental Repaint] DHTML movement test failures
* fast/repaint/containing-block-position-change-expected.checksum: Added.
* fast/repaint/containing-block-position-change-expected.png: Added.
* fast/repaint/containing-block-position-change-expected.txt: Added.
* fast/repaint/containing-block-position-change.html: Added.
2006-06-06 Darin Adler <darin@apple.com>
* fast/repaint/table-extra-bottom-grow.html: Removed unneeded line of code.
0d579996e21fefc513669fe5b7172d9b
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x36
RenderText {#text} at (0,0) size 151x18
text run at (0,0) width 151: "This is a repaint test for "
RenderInline {I} at (0,0) size 749x36
RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
RenderText {#text} at (151,0) size 348x18
text run at (151,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9121"
RenderText {#text} at (499,0) size 749x36
text run at (499,0) width 4: " "
text run at (503,0) width 246: "REGRESSION: [Incremental Repaint]"
text run at (0,18) width 200: "DHTML movement test failures"
RenderText {#text} at (200,18) size 4x18
text run at (200,18) width 4: "."
RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
layer at (158,70) size 50x50
RenderBlock (positioned) {DIV} at (100,0) size 50x50 [bgcolor=#0000FF]
<html>
<head>
<script src="repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function repaintTest()
{
document.getElementById('t').style.position = 'relative';
}
</script>
</head>
<body onload="runRepaintTest();">
<p>
This is a repaint test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=9121">http://bugzilla.opendarwin.org/show_bug.cgi?id=9121</a>
REGRESSION: [Incremental Repaint] DHTML movement test failures</i>.
</p>
<hr>
<div id="t" style="position: static; left: 50px;">
<div style="width: 50px; height: 50px; background: blue; position: absolute; left: 100px;"></div>
</div>
</body>
</html>
2006-06-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9121
REGRESSION: [Incremental Repaint] DHTML movement test failures
Test (repaint): fast/repaint/containing-block-position-change.html
* manual-tests/containing-block-position-chage.html: Added.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock): Unrelated change: fixed typo from
the RenderCanvas to RenderView rename.
(WebCore::RenderBlock::removePositionedObject): Added a return immediately
after removing the object.
(WebCore::RenderBlock::removePositionedObjects): Added.
* rendering/RenderBlock.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setStyle): Added code to remove absolutely positioned
descendants from the positioned objects list of their current containing block
when they are going to have a new one as a result of this block's position
property changing.
* rendering/RenderObject.h:
(WebCore::RenderObject::removePositionedObjects):
2006-06-06 Justin Garcia <justin.garcia@apple.com>
Reviewed by levi
......
......@@ -199,18 +199,13 @@ CSSGrammar.cpp : css/CSSGrammar.y
rm -f CSSGrammar.cpp.h CSSGrammar.hpp
# XPath grammar
ifeq ($(findstring XPATH_SUPPORT,$(FEATURE_DEFINES)), XPATH_SUPPORT)
XPathGrammar.cpp : xpath/impl/XPathGrammar.y $(PROJECT_FILE)
bison -d -p xpathyy $< -o $@
touch XPathGrammar.cpp.h
touch XPathGrammar.hpp
cat XPathGrammar.cpp.h XPathGrammar.hpp > XPathGrammar.h
rm -f XPathGrammar.cpp.h XPathGrammar.hpp
else
XPathGrammar.cpp : $(PROJECT_FILE)
echo > XPathGrammar.cpp
echo > XPathGrammar.h
endif
# user agent style sheets
......
<html>
<head>
<title></title>
<style type="text/css">
#t { position: absolute; width: 100px; height: 100px; background: green; left: -120px; }
</style>
<script type="text/javascript">
function test()
{
var container = document.getElementById("rel");
var target = document.getElementById("t");
document.body.offsetTop; // force layout
container.style.position = "relative";
document.body.offsetTop; // force layout
target.style.left = "0";
}
</script>
</head>
<body onload="test()">
<p>
This is a test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=9121">http://bugzilla.opendarwin.org/show_bug.cgi?id=9121</a>
REGRESSION: [Incremental Repaint] DHTML movement test failures</i>.
</p>
<p>
Do not resize the window. If you did, reload the test.
</p>
<p>
There should be a green square below, aligned with the left margin of the page.
</p>
<hr>
<div id="rel" style="position: static;">
<span id="t"></span>
</div>
</body>
</html>
......@@ -553,7 +553,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
didFullRepaint = repaintAfterLayoutIfNeeded(oldBounds, oldFullBounds);
if (!didFullRepaint && !repaintRect.isEmpty()) {
RenderView* v = view();
if (v && v->view()) {
if (v && v->frameView()) {
repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
v->frameView()->addRepaintInfo(this, repaintRect); // We need to do a partial repaint of our content.
}
......@@ -1767,13 +1767,33 @@ void RenderBlock::removePositionedObject(RenderObject *o)
if (m_positionedObjects) {
DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
while (it.current()) {
if (it.current() == o)
if (it.current() == o) {
m_positionedObjects->removeRef(it.current());
return;
}
++it;
}
}
}
void RenderBlock::removePositionedObjects(RenderBlock* o)
{
if (!m_positionedObjects)
return;
DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
while (it.current()) {
if (!o || it.current()->hasAncestor(o)) {
if (o) {
it.current()->setChildNeedsLayout(true, false);
it.current()->layer()->computeRepaintRects();
}
m_positionedObjects->removeRef(it.current());
} else
++it;
}
}
void RenderBlock::insertFloatingObject(RenderObject *o)
{
// Create the list of special objects if we don't aleady have one
......
......@@ -120,6 +120,7 @@ public:
void layoutPositionedObjects( bool relayoutChildren );
void insertPositionedObject(RenderObject *o);
void removePositionedObject(RenderObject *o);
virtual void removePositionedObjects(RenderBlock*);
virtual void positionListMarker() { }
......
......@@ -2057,8 +2057,28 @@ void RenderObject::setStyle(RenderStyle *style)
// When a layout hint happens and an object's position style changes, we have to do a layout
// to dirty the render tree using the old position value now.
if (d == RenderStyle::Layout && m_parent && m_style->position() != style->position())
if (d == RenderStyle::Layout && m_parent && m_style->position() != style->position()) {
markContainingBlocksForLayout();
if (isRenderBlock()) {
if (style->position() == StaticPosition) {
// Clear our positioned objects list. Our absolutely positioned descendants will be
// inserted into our containing block's positioned objects list during layout.
removePositionedObjects(0);
} else if (m_style->position() == StaticPosition) {
// Remove our absolutely positioned descendants from their current containing block.
// They will be inserted into our positioned objects list during layout.
RenderObject* cb = parent();
while (cb && (cb->style()->position() == StaticPosition || (cb->isInline() && !cb->isReplaced())) && !cb->isRoot() && !cb->isRenderView()) {
if (cb->style()->position() == RelativePosition && cb->isInline() && !cb->isReplaced()) {
cb = cb->containingBlock();
break;
}
cb = cb->parent();
}
cb->removePositionedObjects(static_cast<RenderBlock*>(this));
}
}
}
if (isFloating() && (m_style->floating() != style->floating()))
// For changes in float styles, we need to conceivably remove ourselves
......
......@@ -747,6 +747,8 @@ public:
virtual bool hasOverhangingFloats() { return false; }
virtual IntRect floatRect() const { return borderBox(); }
virtual void removePositionedObjects(RenderBlock*) { }
bool avoidsFloats() const;
bool usesLineWidth() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment