diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 06:41:00 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 06:41:00 -0400 |
commit | ed7faf3fde0000b139414648269d2ff82846bac1 (patch) | |
tree | ad0bf172f0f3332bf42f09f7644f568924f48a3b /dom/html | |
parent | 3758434680616e91edf696e546fe3cc3b1d4da9c (diff) | |
download | UXP-ed7faf3fde0000b139414648269d2ff82846bac1.tar UXP-ed7faf3fde0000b139414648269d2ff82846bac1.tar.gz UXP-ed7faf3fde0000b139414648269d2ff82846bac1.tar.lz UXP-ed7faf3fde0000b139414648269d2ff82846bac1.tar.xz UXP-ed7faf3fde0000b139414648269d2ff82846bac1.zip |
Bug 1404789 - Stop reconstructing frames for the whole shadow root each time content is inserted in a shadow tree
* Cleanup a bit the ShadowRoot code
* Privatize ShadowRoot methods
* When the shadow tree distribution changes, post a restyle + reframe
* Simplify ShadowRoot::IsPooledNode
* Be a bit better at detecting distribution changes
Tag #1375
Diffstat (limited to 'dom/html')
-rw-r--r-- | dom/html/HTMLContentElement.cpp | 6 | ||||
-rw-r--r-- | dom/html/HTMLContentElement.h | 9 |
2 files changed, 3 insertions, 12 deletions
diff --git a/dom/html/HTMLContentElement.cpp b/dom/html/HTMLContentElement.cpp index 158f8d0ce..15d79c761 100644 --- a/dom/html/HTMLContentElement.cpp +++ b/dom/html/HTMLContentElement.cpp @@ -248,8 +248,7 @@ HTMLContentElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, } } - ShadowRoot* containingShadow = GetContainingShadow(); - if (containingShadow) { + if (ShadowRoot* containingShadow = GetContainingShadow()) { containingShadow->DistributeAllNodes(); } } else { @@ -258,8 +257,7 @@ HTMLContentElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, mValidSelector = true; mSelectorList = nullptr; - ShadowRoot* containingShadow = GetContainingShadow(); - if (containingShadow) { + if (ShadowRoot* containingShadow = GetContainingShadow()) { containingShadow->DistributeAllNodes(); } } diff --git a/dom/html/HTMLContentElement.h b/dom/html/HTMLContentElement.h index d2491a792..630e26d17 100644 --- a/dom/html/HTMLContentElement.h +++ b/dom/html/HTMLContentElement.h @@ -29,14 +29,7 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLContentElement, nsGenericHTMLElement) - static HTMLContentElement* FromContent(nsIContent* aContent) - { - if (aContent->IsHTMLContentElement()) { - return static_cast<HTMLContentElement*>(aContent); - } - - return nullptr; - } + NS_IMPL_FROMCONTENT_HELPER(HTMLContentElement, IsHTMLContentElement()) virtual bool IsHTMLContentElement() const override { return true; } |