Skip to content

Commit

Permalink
Backed out changeset 6e4ccddb5c4b (bug 1350671) for build bustage
Browse files Browse the repository at this point in the history
  • Loading branch information
IrisHsiao committed Mar 28, 2017
1 parent 5e41f90 commit 4c1b7d3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 45 deletions.
4 changes: 0 additions & 4 deletions layout/base/PresShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2953,10 +2953,6 @@ PresShell::RecreateFramesFor(nsIContent* aContent)
nsStyleChangeList changeList(mPresContext->StyleSet()->BackendType());
changeList.AppendChange(nullptr, aContent, nsChangeHint_ReconstructFrame);

// We might have restyles pending when we're asked to recreate frames.
// Record that we're OK with stale styles being returned, to avoid assertions.
ServoStyleSet::AutoAllowStaleStyles guard(mStyleSet->GetAsServo());

// Mark ourselves as not safe to flush while we're doing frame construction.
++mChangeNestCount;
RestyleManager* restyleManager = mPresContext->RestyleManager();
Expand Down
3 changes: 1 addition & 2 deletions layout/style/ServoBindingList.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ SERVO_BINDING_FUNC(Servo_NoteExplicitHints, void, RawGeckoElementBorrowed elemen
SERVO_BINDING_FUNC(Servo_TakeChangeHint, nsChangeHint, RawGeckoElementBorrowed element)
SERVO_BINDING_FUNC(Servo_ResolveStyle, ServoComputedValuesStrong,
RawGeckoElementBorrowed element,
RawServoStyleSetBorrowed set,
bool allow_stale)
RawServoStyleSetBorrowed set)
SERVO_BINDING_FUNC(Servo_ResolvePseudoStyle, ServoComputedValuesStrong,
RawGeckoElementBorrowed element, nsIAtom* pseudo_tag,
bool is_probe, RawServoStyleSetBorrowed set)
Expand Down
4 changes: 1 addition & 3 deletions layout/style/ServoStyleSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ using namespace mozilla::dom;
ServoStyleSet::ServoStyleSet()
: mPresContext(nullptr)
, mBatching(0)
, mAllowResolveStaleStyles(false)
{
}

Expand Down Expand Up @@ -784,8 +783,7 @@ ServoStyleSet::RebuildData()
already_AddRefed<ServoComputedValues>
ServoStyleSet::ResolveServoStyle(Element* aElement)
{
return Servo_ResolveStyle(aElement, mRawSet.get(),
mAllowResolveStaleStyles).Consume();
return Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
}

void
Expand Down
24 changes: 0 additions & 24 deletions layout/style/ServoStyleSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,6 @@ class ServoStyleSet
{
friend class ServoRestyleManager;
public:
class AutoAllowStaleStyles
{
public:
AutoAllowStaleStyles(ServoStyleSet* aStyleSet)
: mStyleSet(aStyleSet)
{
if (mStyleSet) {
MOZ_ASSERT(!mStyleSet->mAllowResolveStaleStyles);
mStyleSet->mAllowResolveStaleStyles = true;
}
}

~AutoAllowStaleStyles()
{
if (mStyleSet) {
mStyleSet->mAllowResolveStaleStyles = false;
}
}

private:
ServoStyleSet* mStyleSet;
};

static bool IsInServoTraversal()
{
// The callers of this function are generally main-thread-only _except_
Expand Down Expand Up @@ -319,7 +296,6 @@ class ServoStyleSet
EnumeratedArray<SheetType, SheetType::Count,
nsTArray<RefPtr<ServoStyleSheet>>> mSheets;
int32_t mBatching;
bool mAllowResolveStaleStyles;

// Stores pointers to our cached style contexts for non-inheriting anonymous
// boxes.
Expand Down
3 changes: 1 addition & 2 deletions servo/components/style/gecko_bindings/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1812,8 +1812,7 @@ extern "C" {
}
extern "C" {
pub fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
set: RawServoStyleSetBorrowed,
allow_stale: bool)
set: RawServoStyleSetBorrowed)
-> ServoComputedValuesStrong;
}
extern "C" {
Expand Down
13 changes: 3 additions & 10 deletions servo/ports/geckolib/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,22 +1473,15 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed) -> nsCh

#[no_mangle]
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
raw_data: RawServoStyleSetBorrowed,
allow_stale: bool)
raw_data: RawServoStyleSetBorrowed)
-> ServoComputedValuesStrong
{
let element = GeckoElement(element);
debug!("Servo_ResolveStyle: {:?}", element);
let data = unsafe { element.ensure_data() }.borrow_mut();

let valid_styles = if allow_stale {
data.has_styles()
} else {
data.has_current_styles()
};

if !valid_styles {
warn!("Resolving style on element without current styles with lazy computation forbidden.");
if !data.has_current_styles() {
warn!("Resolving style on unstyled element with lazy computation forbidden.");
let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
return per_doc_data.default_computed_values().clone().into_strong();
}
Expand Down

0 comments on commit 4c1b7d3

Please sign in to comment.