SVN commit 873587 by orlovich: DocumentImpl::unsubmittedChanges actually relied on modified things having 'M' at the end of their state serialization, which broke notification of changes when the N/null flag got added. Fix this by adding an appropriate abstraction. BUG:173159 M +3 -0 html/html_formimpl.h M +4 -2 xml/dom_docimpl.cpp --- branches/KDE/4.1/kdelibs/khtml/html/html_formimpl.h #873586:873587 @@ -175,6 +175,8 @@ virtual void defaultEventHandler(EventImpl *evt); virtual bool isEditable(); + virtual bool unsubmittedFormChanges() const { return false; } + protected: HTMLFormElementImpl *getForm() const; @@ -309,6 +311,7 @@ void activate(); void setUnsubmittedFormChange(bool unsubmitted) { m_unsubmittedFormChange = unsubmitted; } + virtual bool unsubmittedFormChanges() const { return m_unsubmittedFormChange; } //Mozilla extensions. long selectionStart(); --- branches/KDE/4.1/kdelibs/khtml/xml/dom_docimpl.cpp #873586:873587 @@ -1166,9 +1166,11 @@ bool DocumentImpl::unsubmittedFormChanges() { - for (QListIterator it(m_maintainsState); it.hasNext();) - if (it.next()->state().endsWith('M')) + for (QListIterator it(m_maintainsState); it.hasNext();) { + NodeImpl* node = it.next(); + if (node->isGenericFormElement() && static_cast(node)->unsubmittedFormChanges()) return true; + } return false; }