mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 1587767 - Assert that link flag handling is correct, and that NodeInfoChanged is only called on disconnected nodes. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D48830 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
02a9637658
commit
ca0bd9ef74
@ -21,6 +21,7 @@
|
||||
#include "mozilla/dom/BindContext.h"
|
||||
#include "mozilla/dom/Flex.h"
|
||||
#include "mozilla/dom/Grid.h"
|
||||
#include "mozilla/dom/Link.h"
|
||||
#include "mozilla/dom/ScriptLoader.h"
|
||||
#include "mozilla/dom/Text.h"
|
||||
#include "mozilla/gfx/Matrix.h"
|
||||
@ -4380,5 +4381,14 @@ double Element::FirstLineBoxBSize() const {
|
||||
: 0.0;
|
||||
}
|
||||
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
void Element::AssertInvariantsOnNodeInfoChange() {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!IsInComposedDoc());
|
||||
if (nsCOMPtr<Link> link = do_QueryInterface(this)) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!link->HasPendingLinkUpdate());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -1468,7 +1468,11 @@ class Element : public FragmentOrElement {
|
||||
*
|
||||
* If you change this, change also the similar method in Link.
|
||||
*/
|
||||
virtual void NodeInfoChanged(Document* aOldDoc) {}
|
||||
virtual void NodeInfoChanged(Document* aOldDoc) {
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
AssertInvariantsOnNodeInfoChange();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a string into an nsAttrValue for a CORS attribute. This
|
||||
@ -1917,6 +1921,10 @@ class Element : public FragmentOrElement {
|
||||
ReparseAttributes = ReparseAttributes::Yes);
|
||||
|
||||
private:
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
void AssertInvariantsOnNodeInfoChange();
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Slow path for GetClasses, this should only be called for SVG elements.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user