Commit 627b1374 authored by darin's avatar darin

LayoutTests:

        Reviewed by Hyatt.

        - pixel test for http://bugzilla.opendarwin.org/show_bug.cgi?id=4334
          REGRESSION: Flickering when css-hover should change opacity on floating elements

        * fast/block/float/nopaint-after-layer-destruction-expected.checksum: Added.
        * fast/block/float/nopaint-after-layer-destruction-expected.png: Added.
        * fast/block/float/nopaint-after-layer-destruction-expected.txt: Added.
        * fast/block/float/nopaint-after-layer-destruction.html: Added.

WebCore:

        Reviewed by Hyatt (concept) and Darin (some coding details).

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4334
          REGRESSION: Flickering when css-hover should change opacity on floating elements

        Pixel test: fast/block/float/nopaint-after-layer-destruction.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::setPaintsFloatingObject): Added. Changes the noPaint flag
        in the block's FloatingObject for the given float and calls setChildNeedsLayout.
        * rendering/RenderBlock.h:
        * rendering/RenderBox.cpp:
        (WebCore::blockThatPaintsFloat): Added this helper function.
        (WebCore::RenderBox::setStyle): Added. Calls to setPaintsFloatingObject when a float
        gains or loses its layer.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b7fb94bc
2006-06-07 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
- pixel test for http://bugzilla.opendarwin.org/show_bug.cgi?id=4334
REGRESSION: Flickering when css-hover should change opacity on floating elements
* fast/block/float/nopaint-after-layer-destruction-expected.checksum: Added.
* fast/block/float/nopaint-after-layer-destruction-expected.png: Added.
* fast/block/float/nopaint-after-layer-destruction-expected.txt: Added.
* fast/block/float/nopaint-after-layer-destruction.html: Added.
2006-06-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
aa772cd531e0c23cd2bf793e07a00add
\ 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 139x18
text run at (0,0) width 139: "This is a pixel test for "
RenderInline {I} at (0,0) size 763x36
RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
RenderText {#text} at (139,0) size 348x18
text run at (139,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=4334"
RenderText {#text} at (487,0) size 763x36
text run at (487,0) width 4: " "
text run at (491,0) width 272: "REGRESSION: Flickering when css-hover"
text run at (0,18) width 273: "should change opacity on floating elements"
RenderText {#text} at (273,18) size 4x18
text run at (273,18) width 4: "."
RenderBlock {P} at (0,52) size 784x18
RenderText {#text} at (0,0) size 278x18
text run at (0,0) width 278: "There should be a solid green square below."
RenderBlock {HR} at (0,86) size 784x2 [border: (1px inset #000000)]
RenderBlock (floating) {DIV} at (0,96) size 100x100 [bgcolor=#008000]
<html>
<head>
<title></title>
</head>
<body>
<p>
This is a pixel test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=4334">http://bugzilla.opendarwin.org/show_bug.cgi?id=4334</a>
REGRESSION: Flickering when css-hover should change opacity on floating elements</i>.
</p>
<p>
There should be a solid green square below.
</p>
<hr>
<div id="t" style="opacity: 0.5; float: left; width: 100px; height: 100px; background: green;"></div>
<script type="text/javascript">
document.body.offsetTop; // force layout
document.getElementById("t").style.opacity = "1";
</script>
</body>
</html>
2006-06-07 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt (concept) and Darin (some coding details).
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4334
REGRESSION: Flickering when css-hover should change opacity on floating elements
Pixel test: fast/block/float/nopaint-after-layer-destruction.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::setPaintsFloatingObject): Added. Changes the noPaint flag
in the block's FloatingObject for the given float and calls setChildNeedsLayout.
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::blockThatPaintsFloat): Added this helper function.
(WebCore::RenderBox::setStyle): Added. Calls to setPaintsFloatingObject when a float
gains or loses its layer.
2006-06-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
......
......@@ -1852,6 +1852,22 @@ void RenderBlock::removeFloatingObject(RenderObject *o)
}
}
void RenderBlock::setPaintsFloatingObject(RenderObject* o, bool b)
{
if (!m_floatingObjects)
return;
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
while (it.current()) {
if (it.current()->node == o) {
it.current()->noPaint = !b;
setChildNeedsLayout(true);
return;
}
++it;
}
}
void RenderBlock::positionNewFloats()
{
if(!m_floatingObjects) return;
......
......@@ -158,6 +158,7 @@ public:
void insertFloatingObject(RenderObject *o);
void removeFloatingObject(RenderObject *o);
void setPaintsFloatingObject(RenderObject*, bool);
// called from lineWidth, to position the floats added in the last line.
void positionNewFloats();
......
......@@ -69,8 +69,22 @@ RenderBox::RenderBox(WebCore::Node* node)
m_inlineBoxWrapper = 0;
}
static RenderBlock* blockThatPaintsFloat(RenderObject* f)
{
RenderBlock* lastBlock = 0;
for (RenderObject* o = f->parent(); o; o = o->parent()) {
if (lastBlock && o->layer())
break;
if (o->isRenderBlock())
lastBlock = static_cast<RenderBlock*>(o);
}
return lastBlock;
}
void RenderBox::setStyle(RenderStyle *_style)
{
bool wasFloating = isFloating();
RenderObject::setStyle(_style);
// The root always paints its background/border.
......@@ -79,20 +93,19 @@ void RenderBox::setStyle(RenderStyle *_style)
setInline(_style->isDisplayInlineType());
switch(_style->position())
{
case AbsolutePosition:
case FixedPosition:
setPositioned(true);
break;
default:
setPositioned(false);
switch (_style->position()) {
case AbsolutePosition:
case FixedPosition:
setPositioned(true);
break;
default:
setPositioned(false);
if (_style->isFloating())
setFloating(true);
if (_style->isFloating())
setFloating(true);
if (_style->position() == RelativePosition)
setRelPositioned(true);
if (_style->position() == RelativePosition)
setRelPositioned(true);
}
// We also handle <body> and <html>, whose overflow applies to the viewport.
......@@ -102,17 +115,24 @@ void RenderBox::setStyle(RenderStyle *_style)
if (requiresLayer()) {
if (!m_layer) {
if (wasFloating && isFloating()) {
if (RenderBlock* b = blockThatPaintsFloat(this))
b->setPaintsFloatingObject(this, false);
}
m_layer = new (renderArena()) RenderLayer(this);
m_layer->insertOnlyThisLayer();
if (parent() && containingBlock())
m_layer->updateLayerPositions();
}
}
else if (m_layer && !isRoot() && !isRenderView()) {
} else if (m_layer && !isRoot() && !isRenderView()) {
assert(m_layer->parent());
RenderLayer *layer = m_layer;
RenderLayer* layer = m_layer;
m_layer = 0;
layer->removeOnlyThisLayer();
if (wasFloating && isFloating()) {
if (RenderBlock* b = blockThatPaintsFloat(this))
b->setPaintsFloatingObject(this, true);
}
}
if (m_layer)
......
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