Bug 676387 - XUL elements with -moz-appearance should ignore clicks in their overflow. r=roc

This commit is contained in:
Markus Stange 2011-08-08 20:31:52 +02:00
Родитель 9059d8ade3
Коммит af84afa5c3
4 изменённых файлов: 29 добавлений и 6 удалений

Просмотреть файл

@ -1023,12 +1023,15 @@ nsDisplayBackground::HitTest(nsDisplayListBuilder* aBuilder,
HitTestState* aState,
nsTArray<nsIFrame*> *aOutFrames)
{
// For theme backgrounds, assume that any point in our bounds is a hit.
// We don't know the true hit region of the theme background.
if (!mIsThemed &&
!RoundedBorderIntersectsRect(mFrame, ToReferenceFrame(), aRect)) {
// aRect doesn't intersect our border-radius curve.
return;
if (mIsThemed) {
// For theme backgrounds, assume that any point in our border rect is a hit.
if (!nsRect(ToReferenceFrame(), mFrame->GetSize()).Intersects(aRect))
return;
} else {
if (!RoundedBorderIntersectsRect(mFrame, ToReferenceFrame(), aRect)) {
// aRect doesn't intersect our border-radius curve.
return;
}
}
aOutFrames->AppendElement(mFrame);

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="window676387-1-ref"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox><button id="button" label="SUCCESS"/></hbox>
</window>

Просмотреть файл

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="window676387-1"
class="reftest-wait"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="var button = document.getElementById('button');
var r = button.getBoundingClientRect();
if (document.elementFromPoint(r.right, r.top) == button.parentNode)
button.label = 'SUCCESS';
document.documentElement.className = '';">
<hbox><button id="button" label="FAIL"/></hbox>
</window>

Просмотреть файл

@ -78,3 +78,5 @@ skip-if(!winWidget) == scroll-thumb-minimum-size-notheme.html scroll-thumb-minim
# animated progress bars.
skip-if(cocoaWidget) skip-if(winWidget) == progress-overflow.html progress-overflow-ref.html
skip-if(cocoaWidget) skip-if(winWidget) != progress-overflow-small.html progress-nobar.html
== 676387-1.xul 676387-1-ref.xul