зеркало из https://github.com/mozilla/pjs.git
XTF doesn't properly handle readonly and readwrite. Bug 391905, r=olli sr=peterv a=jonas
This commit is contained in:
Родитель
2e540ca417
Коммит
d7a4a949ed
|
@ -527,7 +527,14 @@ nsXTFElementWrapper::GetExistingAttrNameFromQName(const nsAString& aStr) const
|
||||||
PRInt32
|
PRInt32
|
||||||
nsXTFElementWrapper::IntrinsicState() const
|
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
|
void
|
||||||
|
@ -879,6 +886,10 @@ nsXTFElementWrapper::SetIntrinsicState(PRInt32 aNewState)
|
||||||
if (!doc || !bits)
|
if (!doc || !bits)
|
||||||
return NS_OK;
|
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;
|
mIntrinsicState = aNewState;
|
||||||
mozAutoDocUpdate upd(doc, UPDATE_CONTENT_STATE, PR_TRUE);
|
mozAutoDocUpdate upd(doc, UPDATE_CONTENT_STATE, PR_TRUE);
|
||||||
doc->ContentStatesChanged(this, nsnull, bits);
|
doc->ContentStatesChanged(this, nsnull, bits);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче