mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
XTF doesn't properly handle readonly and readwrite. Bug 391905, r=olli sr=peterv a=jonas
This commit is contained in:
parent
a8ab6d3130
commit
9b3a9e0110
@ -527,7 +527,14 @@ nsXTFElementWrapper::GetExistingAttrNameFromQName(const nsAString& aStr) const
|
||||
PRInt32
|
||||
nsXTFElementWrapper::IntrinsicState() const
|
||||
{
|
||||
return nsXTFElementWrapperBase::IntrinsicState() | mIntrinsicState;
|
||||
PRInt32 retState = nsXTFElementWrapperBase::IntrinsicState();
|
||||
if (mIntrinsicState & NS_EVENT_STATE_MOZ_READONLY) {
|
||||
retState &= ~NS_EVENT_STATE_MOZ_READWRITE;
|
||||
} else if (mIntrinsicState & NS_EVENT_STATE_MOZ_READWRITE) {
|
||||
retState &= ~NS_EVENT_STATE_MOZ_READONLY;
|
||||
}
|
||||
|
||||
return retState | mIntrinsicState;
|
||||
}
|
||||
|
||||
void
|
||||
@ -879,6 +886,10 @@ nsXTFElementWrapper::SetIntrinsicState(PRInt32 aNewState)
|
||||
if (!doc || !bits)
|
||||
return NS_OK;
|
||||
|
||||
NS_WARN_IF_FALSE(!((aNewState & NS_EVENT_STATE_MOZ_READONLY) &&
|
||||
(aNewState & NS_EVENT_STATE_MOZ_READWRITE)),
|
||||
"Both READONLY and READWRITE are being set. Yikes!!!");
|
||||
|
||||
mIntrinsicState = aNewState;
|
||||
mozAutoDocUpdate upd(doc, UPDATE_CONTENT_STATE, PR_TRUE);
|
||||
doc->ContentStatesChanged(this, nsnull, bits);
|
||||
|
Loading…
Reference in New Issue
Block a user