Backed out 4 changesets (bug 1390694) for failing crash test and in reftest/tests/layout/reftests/xul/mac-tab-toolbar.xul r=backout on a CLOSED TREE.

Backed out changeset b9cff3469bfd (bug 1390694)
Backed out changeset e13dd2a3651f (bug 1390694)
Backed out changeset 83ff9e245757 (bug 1390694)
Backed out changeset 484a2644318f (bug 1390694)
This commit is contained in:
Attila Craciun 2017-10-20 14:49:52 +03:00
Родитель e4f49fb3e9
Коммит 03687d95f5
6 изменённых файлов: 18 добавлений и 71 удалений

Просмотреть файл

@ -708,12 +708,12 @@ nsBindingManager::WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc,
return NS_OK;
}
bool
void
nsBindingManager::EnumerateBoundContentBindings(
const BoundContentBindingCallback& aCallback) const
{
if (!mBoundContentSet) {
return true;
return;
}
for (auto iter = mBoundContentSet->Iter(); !iter.Done(); iter.Next()) {
@ -721,13 +721,9 @@ nsBindingManager::EnumerateBoundContentBindings(
for (nsXBLBinding* binding = boundContent->GetXBLBinding();
binding;
binding = binding->GetBaseBinding()) {
if (!aCallback(binding)) {
return false;
}
aCallback(binding);
}
}
return true;
}
void
@ -740,7 +736,6 @@ nsBindingManager::WalkAllRules(nsIStyleRuleProcessor::EnumFunc aFunc,
if (ruleProcessor) {
(*(aFunc))(ruleProcessor, aData);
}
return true;
});
}
@ -780,7 +775,6 @@ nsBindingManager::MediumFeaturesChanged(nsPresContext* aPresContext)
rulesChanged = rulesChanged || thisChanged;
}
}
return true;
});
return rulesChanged;
@ -800,7 +794,6 @@ nsBindingManager::UpdateBoundContentBindingsForServo(nsPresContext* aPresContext
if (styleSet && styleSet->StyleSheetsHaveChanged()) {
protoBinding->ComputeServoStyleSet(presContext);
}
return true;
});
}
@ -809,7 +802,6 @@ nsBindingManager::AppendAllSheets(nsTArray<StyleSheet*>& aArray)
{
EnumerateBoundContentBindings([&aArray](nsXBLBinding* aBinding) {
aBinding->PrototypeBinding()->AppendStyleSheetsTo(aArray);
return true;
});
}
@ -1169,20 +1161,3 @@ nsBindingManager::FindNestedSingleInsertionPoint(nsIContent* aContainer,
return parent;
}
bool
nsBindingManager::AnyBindingHasDocumentStateDependency(EventStates aStateMask)
{
MOZ_ASSERT(mDocument->IsStyledByServo());
bool result = false;
EnumerateBoundContentBindings([&](nsXBLBinding* aBinding) {
ServoStyleSet* styleSet = aBinding->PrototypeBinding()->GetServoStyleSet();
if (styleSet && styleSet->HasDocumentStateDependency(aStateMask)) {
result = true;
return false;
}
return true;
});
return result;
}

Просмотреть файл

@ -19,7 +19,6 @@
#include "nsTArray.h"
#include "nsThreadUtils.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/EventStates.h"
struct ElementDependentRuleProcessorData;
class nsIXPConnectWrappedJS;
@ -176,8 +175,6 @@ public:
nsIContent* FindNestedSingleInsertionPoint(nsIContent* aContainer, bool* aMulti);
bool AnyBindingHasDocumentStateDependency(mozilla::EventStates aStateMask);
protected:
nsIXPConnectWrappedJS* GetWrappedJS(nsIContent* aContent);
nsresult SetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS* aResult);
@ -199,9 +196,9 @@ protected:
static void PostPAQEventCallback(nsITimer* aTimer, void* aClosure);
// Enumerate each bound content's bindings (including its base bindings)
// in mBoundContentSet. Return false from the callback to stop enumeration.
using BoundContentBindingCallback = std::function<bool (nsXBLBinding*)>;
bool EnumerateBoundContentBindings(
// in mBoundContentSet.
using BoundContentBindingCallback = std::function<void (nsXBLBinding*)>;
void EnumerateBoundContentBindings(
const BoundContentBindingCallback& aCallback) const;
// MEMBER VARIABLES

Просмотреть файл

@ -4265,29 +4265,20 @@ PresShell::DocumentStatesChanged(nsIDocument* aDocument,
NS_PRECONDITION(!mIsDocumentGone, "Unexpected DocumentStatesChanged");
NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
if (!mDidInitialize) {
return;
nsStyleSet* geckoSet = mStyleSet->GetAsGecko();
if (!geckoSet) {
// XXXheycam ServoStyleSets don't support document state selectors,
// but these are only used in chrome documents, which we are not
// aiming to support yet.
} else if (mDidInitialize &&
geckoSet->HasDocumentStateDependentStyle(mDocument->GetRootElement(),
aStateMask)) {
mPresContext->RestyleManager()->PostRestyleEvent(mDocument->GetRootElement(),
eRestyle_Subtree,
nsChangeHint(0));
VERIFY_STYLE_TREE;
}
if (mStyleSet->IsServo()) {
if (!mStyleSet->AsServo()->HasDocumentStateDependency(aStateMask) &&
!aDocument->BindingManager()->
AnyBindingHasDocumentStateDependency(aStateMask)) {
return;
}
} else {
if (!mStyleSet->AsGecko()->
HasDocumentStateDependentStyle(mDocument->GetRootElement(),
aStateMask)) {
return;
}
}
mPresContext->RestyleManager()->PostRestyleEvent(mDocument->GetRootElement(),
eRestyle_Subtree,
nsChangeHint(0));
VERIFY_STYLE_TREE;
if (aStateMask.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE)) {
nsIFrame* root = mFrameConstructor->GetRootFrame();
if (root) {

Просмотреть файл

@ -158,9 +158,6 @@ SERVO_BINDING_FUNC(Servo_StyleSet_HasStateDependency, bool,
RawServoStyleSetBorrowed set,
RawGeckoElementBorrowed element,
uint64_t state)
SERVO_BINDING_FUNC(Servo_StyleSet_HasDocumentStateDependency, bool,
RawServoStyleSetBorrowed set,
uint64_t state)
// CSSRuleList
SERVO_BINDING_FUNC(Servo_CssRules_ListTypes, void,

Просмотреть файл

@ -1603,13 +1603,6 @@ ServoStyleSet::HasStateDependency(const Element& aElement,
mRawSet.get(), &aElement, aState.ServoValue());
}
bool
ServoStyleSet::HasDocumentStateDependency(EventStates aState) const
{
return Servo_StyleSet_HasDocumentStateDependency(
mRawSet.get(), aState.ServoValue());
}
already_AddRefed<ServoStyleContext>
ServoStyleSet::ReparentStyleContext(ServoStyleContext* aStyleContext,
ServoStyleContext* aNewParent,

Просмотреть файл

@ -486,12 +486,6 @@ public:
bool HasStateDependency(const dom::Element& aElement,
EventStates aState) const;
/**
* Returns true if a change in document state might require us to restyle the
* document.
*/
bool HasDocumentStateDependency(EventStates aState) const;
/**
* Get a new style context that uses the same rules as the given style context
* but has a different parent.