Bug 1290276 Part 3 - Move nsStyleSet's call to SetBindingManager to PresShell::Init().
Delete the NS_WARNING because it's not needed once this bug is fixed.
MozReview-Commit-ID: Ht3ayjSvYW8
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -966,16 +966,23 @@ PresShell::Init(nsIDocument* aDocument,
mPresContext->AttachShell(this, aStyleSet->BackendType());
// Now we can initialize the style set. Make sure to set the member before
// calling Init, since various subroutines need to find the style set off
// the PresContext during initialization.
mStyleSet = aStyleSet;
mStyleSet->Init(aPresContext);
+ // Set up our style rule observer. We don't need to inform a ServoStyleSet
+ // of the binding manager because it gets XBL style sheets from bindings
+ // in a different way.
+ if (mStyleSet->IsGecko()) {
+ mStyleSet->AsGecko()->SetBindingManager(mDocument->BindingManager());
+ }
+
// Notify our prescontext that it now has a compatibility mode. Note that
// this MUST happen after we set up our style set but before we create any
// frames.
mPresContext->CompatibilityModeChanged();
// Add the preference style sheet.
UpdatePreferenceStyles();
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2741,26 +2741,16 @@ nsCSSFrameConstructor::ConstructDocEleme
nsIFrame*
nsCSSFrameConstructor::ConstructRootFrame()
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
StyleSetHandle styleSet = mPresShell->StyleSet();
- // Set up our style rule observer.
- // XXXbz wouldn't this make more sense as part of presshell init?
- if (styleSet->IsGecko()) {
- // XXXheycam We don't support XBL bindings providing style to
- // ServoStyleSets yet.
- styleSet->AsGecko()->SetBindingManager(mDocument->BindingManager());
- } else {
- NS_WARNING("stylo: cannot get ServoStyleSheets from XBL bindings yet. See bug 1290276.");
- }
-
// --------- BUILD VIEWPORT -----------
RefPtr<nsStyleContext> viewportPseudoStyle =
styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::viewport,
nullptr);
ViewportFrame* viewportFrame =
NS_NewViewportFrame(mPresShell, viewportPseudoStyle);
// XXXbz do we _have_ to pass a null content pointer to that frame?