Commit f5dea500 authored by bdakin@apple.com's avatar bdakin@apple.com

WebCore:

2009-04-27  Beth Dakin  <bdakin@apple.com>

        Reviewed by Dave Hyatt.

        Fix for <rdar://problem/6709057> REGRESSION (4PB-TOT): http://www.winway.com/main3/support/faq.aspx selector doesn't look right or work

        The problem here is that we had a self-painting layer nested inside 
        a non-self-painting layer. We ended up ignoring the self-painting 
        layer both during painting and hit-testing. This patch corrects 
        that. 

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayer):
        (WebCore::RenderLayer::hitTestLayer):

LayoutTests:

2009-04-27  Beth Dakin  <bdakin@apple.com>

        Reviewed by Dave Hyatt.

        Test for <rdar://problem/6709057> REGRESSION (4PB-TOT): http://www.winway.com/main3/support/faq.aspx selector doesn't look right or work

        * fast/css/nested-layers-with-hover.html: Added.
        * platform/mac/fast/css/nested-layers-with-hover-expected.checksum: Added.
        * platform/mac/fast/css/nested-layers-with-hover-expected.png: Added.
        * platform/mac/fast/css/nested-layers-with-hover-expected.txt: Added.



git-svn-id: svn://svn.chromium.org/blink/trunk@42917 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 54de65ce
2009-04-27 Beth Dakin <bdakin@apple.com>
Reviewed by Dave Hyatt.
Test for <rdar://problem/6709057> REGRESSION (4PB-TOT): http://www.winway.com/main3/support/faq.aspx selector doesn't look right or work
* fast/css/nested-layers-with-hover.html: Added.
* platform/mac/fast/css/nested-layers-with-hover-expected.checksum: Added.
* platform/mac/fast/css/nested-layers-with-hover-expected.png: Added.
* platform/mac/fast/css/nested-layers-with-hover-expected.txt: Added.
2009-04-23 Simon Fraser <simon.fraser@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=22242
<html>
<head>
<style>
#table-row:hover {
background-color:blue;
}
</style>
<script>
function log(msg) {
var console = document.getElementById('console');
console.innerText = msg;
}
var testedHoverState = false;
function testHoverState() {
if (testedHoverState)
return;
testedHoverState = true;
var tableRow = document.getElementById('table-row');
var calculatedStyle = window.getComputedStyle(tableRow);
if (calculatedStyle.getPropertyValue('background-color') == "rgb(0, 0, 255)")
log("PASSED: The hover effect works!");
else
log("FAILED: The hover effect did not correctly propagate down the layer chain.");
}
function runTest() {
if (!window.layoutTestController)
return;
var targetElem = document.getElementById('table-row');
eventSender.mouseMoveTo(targetElem.offsetLeft + targetElem.offsetWidth / 2,
targetElem.offsetTop + targetElem.offsetHeight / 2);
}
</script>
</head>
<body onload="runTest()">
<div style="overflow:hidden">
<div id="table-row" onmousemove="testHoverState()" style="overflow:hidden; display:table-row">To test this manually, first make sure you can see this text at all, and then hover over it and make sure the background turns blue.</div>
</div>
<div id="console"></div>
</body>
</html>
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 {DIV} at (0,36) size 784x18
RenderText {#text} at (0,0) size 221x18
text run at (0,0) width 221: "PASSED: The hover effect works!"
layer at (8,8) size 784x36
RenderBlock {DIV} at (0,0) size 784x36
RenderTable at (0,0) size 784x36
RenderTableSection (anonymous) at (0,0) size 784x36
layer at (8,8) size 784x36
RenderTableRow {DIV} at (0,0) size 784x36 [bgcolor=#0000FF]
RenderTableCell (anonymous) at (0,0) size 784x36 [r=0 c=0 rs=1 cs=1]
RenderText {#text} at (0,0) size 774x36
text run at (0,0) width 774: "To test this manually, first make sure you can see this text at all, and then hover over it and make sure the background turns"
text run at (0,18) width 31: "blue."
2009-04-27 Beth Dakin <bdakin@apple.com>
Reviewed by Dave Hyatt.
Fix for <rdar://problem/6709057> REGRESSION (4PB-TOT): http://www.winway.com/main3/support/faq.aspx selector doesn't look right or work
The problem here is that we had a self-painting layer nested inside
a non-self-painting layer. We ended up ignoring the self-painting
layer both during painting and hit-testing. This patch corrects
that.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::hitTestLayer):
2009-04-27 Ada Chan <adachan@apple.com>
If it has been set to allow any HTTPS certificates for this host, set
......@@ -2031,7 +2031,7 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p,
performOverlapTests(*overlapTestRequests, layerBounds);
// We want to paint our layer, but only if we intersect the damage rect.
bool shouldPaint = intersectsDamageRect(layerBounds, damageRect, rootLayer) && m_hasVisibleContent;
bool shouldPaint = intersectsDamageRect(layerBounds, damageRect, rootLayer) && m_hasVisibleContent && isSelfPaintingLayer();
if (shouldPaint && !selectionOnly && !damageRect.isEmpty()) {
// Begin transparency layers lazily now that we know we have to paint something.
if (haveTransparency)
......@@ -2090,10 +2090,8 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p,
// Paint any child layers that have overflow.
if (m_normalFlowList)
for (Vector<RenderLayer*>::iterator it = m_normalFlowList->begin(); it != m_normalFlowList->end(); ++it) {
if (it[0]->isSelfPaintingLayer())
it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, overlapTestRequests, false, temporaryClipRects);
}
for (Vector<RenderLayer*>::iterator it = m_normalFlowList->begin(); it != m_normalFlowList->end(); ++it)
it[0]->paintLayer(rootLayer, p, paintDirtyRect, haveTransparency, paintRestriction, paintingRoot, overlapTestRequests, false, temporaryClipRects);
// Now walk the sorted list of children with positive z-indices.
if (m_posZOrderList)
......@@ -2387,9 +2385,6 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
if (m_normalFlowList) {
for (int i = m_normalFlowList->size() - 1; i >= 0; --i) {
RenderLayer* currLayer = m_normalFlowList->at(i);
if (!currLayer->isSelfPaintingLayer())
continue;
HitTestResult tempResult(result.point());
RenderLayer* hitLayer = currLayer->hitTestLayer(rootLayer, this, request, tempResult, hitTestRect, hitTestPoint, false, localTransformState.get(), zOffsetForDescendantsPtr);
if (isHitCandidate(hitLayer, depthSortDescendants, zOffset, unflattenedTransformState.get())) {
......@@ -2403,7 +2398,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
}
// Next we want to see if the mouse pos is inside the child RenderObjects of the layer.
if (fgRect.contains(hitTestPoint)) {
if (fgRect.contains(hitTestPoint) && isSelfPaintingLayer()) {
// Hit test with a temporary HitTestResult, because we onlyl want to commit to 'result' if we know we're frontmost.
HitTestResult tempResult(result.point());
if (hitTestContents(request, tempResult, layerBounds, hitTestPoint, HitTestDescendants) &&
......@@ -2435,7 +2430,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
if (candidateLayer)
return candidateLayer;
if (bgRect.contains(hitTestPoint)) {
if (bgRect.contains(hitTestPoint) && isSelfPaintingLayer()) {
HitTestResult tempResult(result.point());
if (hitTestContents(request, tempResult, layerBounds, hitTestPoint, HitTestSelf) &&
isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
......
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