mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1160724 - Part 1: Resolve a properly parented style context when looking up -moz-binding of a display:none XUL/plugin element. r=dbaron
This commit is contained in:
parent
246c8ec28f
commit
eacf3bc7dd
@ -139,6 +139,7 @@
|
||||
#include "mozilla/dom/WindowBinding.h"
|
||||
#include "mozilla/dom/ElementBinding.h"
|
||||
#include "mozilla/dom/VRDevice.h"
|
||||
#include "nsComputedDOMStyle.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@ -385,7 +386,7 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
|
||||
IsHTMLElement(nsGkAtoms::object) ||
|
||||
IsHTMLElement(nsGkAtoms::embed) ||
|
||||
IsHTMLElement(nsGkAtoms::applet));
|
||||
nsIPresShell *shell = aDocument->GetShell();
|
||||
nsCOMPtr<nsIPresShell> shell = aDocument->GetShell();
|
||||
if (!shell || GetPrimaryFrame() || !isXULorPluginElement) {
|
||||
*aResult = nullptr;
|
||||
|
||||
@ -393,11 +394,8 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
|
||||
}
|
||||
|
||||
// Get the computed -moz-binding directly from the style context
|
||||
nsPresContext *pctx = shell->GetPresContext();
|
||||
NS_ENSURE_TRUE(pctx, false);
|
||||
|
||||
nsRefPtr<nsStyleContext> sc = pctx->StyleSet()->ResolveStyleFor(this,
|
||||
nullptr);
|
||||
nsRefPtr<nsStyleContext> sc =
|
||||
nsComputedDOMStyle::GetStyleContextForElementNoFlush(this, nullptr, shell);
|
||||
NS_ENSURE_TRUE(sc, false);
|
||||
|
||||
*aResult = sc->StyleDisplay()->mBinding;
|
||||
|
Loading…
Reference in New Issue
Block a user