Always create nsDisplayTableBorderBackground when we're doing event delivery. (Bug 541668) r=roc
This commit is contained in:
Родитель
1b6144f1fd
Коммит
81e531d099
|
@ -1325,10 +1325,13 @@ nsTableFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
nsDisplayTableItem* item = nsnull;
|
||||
// This background is created if any of the table parts are visible.
|
||||
// This background is created if any of the table parts are visible,
|
||||
// or if we're doing event handling (since DisplayGenericTablePart
|
||||
// needs the item for the |sortEventBackgrounds|-dependent code).
|
||||
// Specific visibility decisions are delegated to the table background
|
||||
// painter, which handles borders and backgrounds for the table.
|
||||
if (AnyTablePartHasBorderOrBackground(this)) {
|
||||
if (aBuilder->IsForEventDelivery() ||
|
||||
AnyTablePartHasBorderOrBackground(this)) {
|
||||
item = new (aBuilder) nsDisplayTableBorderBackground(this);
|
||||
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -46,6 +46,7 @@ include $(topsrcdir)/config/rules.mk
|
|||
|
||||
_TEST_FILES = \
|
||||
test_bug337124.html \
|
||||
test_bug541668_table_event_delivery.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=541668
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 541668</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=541668">Mozilla Bug 541668</a>
|
||||
<table id="display">
|
||||
<tr>
|
||||
<td rowspan="2">
|
||||
<div id="target" style="background:fuchsia;height:200px;width:200px"></div>
|
||||
</td>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cell</td>
|
||||
</tr>
|
||||
</table>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 541668 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(run_test);
|
||||
|
||||
function run_test()
|
||||
{
|
||||
var target = document.getElementById("target");
|
||||
|
||||
var got_mousemove = false;
|
||||
target.addEventListener("mousemove",
|
||||
function(event) { got_mousemove = true },
|
||||
false);
|
||||
synthesizeMouse(target, 150, 150, { type: "mousemove" });
|
||||
is(got_mousemove, true, "should get mousemove on block");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче