Bug 557087 (3/6) - Make layout aware of the new disabled state rule. r=dbaron a=sicking

This commit is contained in:
Mounir Lamouri
2010-09-19 03:43:15 +02:00
parent 5a90929c2c
commit f531ea25f8
18 changed files with 101 additions and 73 deletions

View File

@@ -91,6 +91,7 @@
#include "nsICapturePicker.h"
#include "nsIFileURL.h"
#include "nsDOMFile.h"
#include "nsIEventStateManager.h"
#define SYNC_TEXT 0x1
#define SYNC_BUTTON 0x2
@@ -679,8 +680,8 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Disabled file controls don't pass mouse events to their children, so we
// put an invisible item in the display list above the children
// just to catch events
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled) &&
IsVisibleForPainting(aBuilder)) {
PRInt32 eventStates = mContent->IntrinsicState();
if ((eventStates & NS_EVENT_STATE_DISABLED) && IsVisibleForPainting(aBuilder)) {
rv = aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayEventReceiver(aBuilder, this));
if (NS_FAILED(rv))