Bug 1554571 - Part 1: Remove unused argument from Servo_ResolveStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33121
This commit is contained in:
@@ -2431,7 +2431,7 @@ struct RestyleManager::TextPostTraversalState {
|
|||||||
ComputedStyle& ParentStyle() {
|
ComputedStyle& ParentStyle() {
|
||||||
if (!mParentContext) {
|
if (!mParentContext) {
|
||||||
mLazilyResolvedParentContext =
|
mLazilyResolvedParentContext =
|
||||||
mParentRestyleState.StyleSet().ResolveServoStyle(mParentElement);
|
ServoStyleSet::ResolveServoStyle(mParentElement);
|
||||||
mParentContext = mLazilyResolvedParentContext;
|
mParentContext = mLazilyResolvedParentContext;
|
||||||
}
|
}
|
||||||
return *mParentContext;
|
return *mParentContext;
|
||||||
@@ -2668,8 +2668,7 @@ bool RestyleManager::ProcessPostTraversal(Element* aElement,
|
|||||||
static_cast<nsChangeHint>(Servo_TakeChangeHint(aElement, &wasRestyled));
|
static_cast<nsChangeHint>(Servo_TakeChangeHint(aElement, &wasRestyled));
|
||||||
|
|
||||||
RefPtr<ComputedStyle> upToDateStyleIfRestyled =
|
RefPtr<ComputedStyle> upToDateStyleIfRestyled =
|
||||||
wasRestyled ? aRestyleState.StyleSet().ResolveServoStyle(*aElement)
|
wasRestyled ? ServoStyleSet::ResolveServoStyle(*aElement) : nullptr;
|
||||||
: nullptr;
|
|
||||||
|
|
||||||
// We should really fix the weird primary frame mapping for image maps
|
// We should really fix the weird primary frame mapping for image maps
|
||||||
// (bug 135040)...
|
// (bug 135040)...
|
||||||
@@ -2767,8 +2766,7 @@ bool RestyleManager::ProcessPostTraversal(Element* aElement,
|
|||||||
const bool isDisplayContents = !styleFrame && aElement->HasServoData() &&
|
const bool isDisplayContents = !styleFrame && aElement->HasServoData() &&
|
||||||
Servo_Element_IsDisplayContents(aElement);
|
Servo_Element_IsDisplayContents(aElement);
|
||||||
if (isDisplayContents) {
|
if (isDisplayContents) {
|
||||||
oldOrDisplayContentsStyle =
|
oldOrDisplayContentsStyle = ServoStyleSet::ResolveServoStyle(*aElement);
|
||||||
aRestyleState.StyleSet().ResolveServoStyle(*aElement);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Maybe<ServoRestyleState> thisFrameRestyleState;
|
Maybe<ServoRestyleState> thisFrameRestyleState;
|
||||||
|
|||||||
@@ -1761,7 +1761,7 @@ void nsCSSFrameConstructor::CreateGeneratedContentItem(
|
|||||||
// above. We need to grab style with animations from the pseudo element and
|
// above. We need to grab style with animations from the pseudo element and
|
||||||
// replace old one.
|
// replace old one.
|
||||||
mPresShell->StyleSet()->StyleNewSubtree(container);
|
mPresShell->StyleSet()->StyleNewSubtree(container);
|
||||||
pseudoStyle = styleSet->ResolveServoStyle(*container);
|
pseudoStyle = ServoStyleSet::ResolveServoStyle(*container);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t contentCount = pseudoStyle->StyleContent()->ContentCount();
|
uint32_t contentCount = pseudoStyle->StyleContent()->ContentCount();
|
||||||
@@ -2253,7 +2253,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<ComputedStyle> computedStyle =
|
RefPtr<ComputedStyle> computedStyle =
|
||||||
mPresShell->StyleSet()->ResolveServoStyle(*aDocElement);
|
ServoStyleSet::ResolveServoStyle(*aDocElement);
|
||||||
|
|
||||||
const nsStyleDisplay* display = computedStyle->StyleDisplay();
|
const nsStyleDisplay* display = computedStyle->StyleDisplay();
|
||||||
|
|
||||||
@@ -4621,10 +4621,8 @@ void nsCSSFrameConstructor::InitAndRestoreFrame(
|
|||||||
|
|
||||||
already_AddRefed<ComputedStyle> nsCSSFrameConstructor::ResolveComputedStyle(
|
already_AddRefed<ComputedStyle> nsCSSFrameConstructor::ResolveComputedStyle(
|
||||||
nsIContent* aContent) {
|
nsIContent* aContent) {
|
||||||
ServoStyleSet* styleSet = mPresShell->StyleSet();
|
|
||||||
|
|
||||||
if (auto* element = Element::FromNode(aContent)) {
|
if (auto* element = Element::FromNode(aContent)) {
|
||||||
return styleSet->ResolveServoStyle(*element);
|
return ServoStyleSet::ResolveServoStyle(*element);
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(aContent->IsText(),
|
MOZ_ASSERT(aContent->IsText(),
|
||||||
@@ -4646,7 +4644,7 @@ already_AddRefed<ComputedStyle> nsCSSFrameConstructor::ResolveComputedStyle(
|
|||||||
// out.
|
// out.
|
||||||
RefPtr<ComputedStyle> parentStyle =
|
RefPtr<ComputedStyle> parentStyle =
|
||||||
Servo_Element_GetPrimaryComputedValues(parent).Consume();
|
Servo_Element_GetPrimaryComputedValues(parent).Consume();
|
||||||
return styleSet->ResolveStyleForText(aContent, parentStyle);
|
return mPresShell->StyleSet()->ResolveStyleForText(aContent, parentStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MathML Mod - RBS
|
// MathML Mod - RBS
|
||||||
|
|||||||
@@ -10044,12 +10044,12 @@ ComputedStyle* nsLayoutUtils::StyleForScrollbar(nsIFrame* aScrollbarPart) {
|
|||||||
// from the element directly. This can happen on viewport, because
|
// from the element directly. This can happen on viewport, because
|
||||||
// the scrollbar of viewport may be shown when the root element has
|
// the scrollbar of viewport may be shown when the root element has
|
||||||
// > display: none; overflow: scroll;
|
// > display: none; overflow: scroll;
|
||||||
nsPresContext* pc = aScrollbarPart->PresContext();
|
MOZ_ASSERT(
|
||||||
MOZ_ASSERT(content == pc->Document()->GetRootElement(),
|
content == aScrollbarPart->PresContext()->Document()->GetRootElement(),
|
||||||
"Root element is the only case for this fallback "
|
"Root element is the only case for this fallback "
|
||||||
"path to be triggered");
|
"path to be triggered");
|
||||||
RefPtr<ComputedStyle> style =
|
RefPtr<ComputedStyle> style =
|
||||||
pc->StyleSet()->ResolveServoStyle(*content->AsElement());
|
ServoStyleSet::ResolveServoStyle(*content->AsElement());
|
||||||
// Dropping the strong reference is fine because the style should be
|
// Dropping the strong reference is fine because the style should be
|
||||||
// held strongly by the element.
|
// held strongly by the element.
|
||||||
return style.get();
|
return style.get();
|
||||||
|
|||||||
@@ -9738,7 +9738,7 @@ ComputedStyle* nsFrame::DoGetParentComputedStyle(
|
|||||||
pseudo == PseudoStyleType::tableWrapper) {
|
pseudo == PseudoStyleType::tableWrapper) {
|
||||||
if (Servo_Element_IsDisplayContents(parentElement)) {
|
if (Servo_Element_IsDisplayContents(parentElement)) {
|
||||||
RefPtr<ComputedStyle> style =
|
RefPtr<ComputedStyle> style =
|
||||||
PresShell()->StyleSet()->ResolveServoStyle(*parentElement);
|
ServoStyleSet::ResolveServoStyle(*parentElement);
|
||||||
// NOTE(emilio): we return a weak reference because the element also
|
// NOTE(emilio): we return a weak reference because the element also
|
||||||
// holds the style context alive. This is a bit silly (we could've
|
// holds the style context alive. This is a bit silly (we could've
|
||||||
// returned a weak ref directly), but it's probably not worth
|
// returned a weak ref directly), but it's probably not worth
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ void nsHTMLFramesetFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|||||||
//
|
//
|
||||||
// Maybe we should change that though.
|
// Maybe we should change that though.
|
||||||
RefPtr<ComputedStyle> kidStyle =
|
RefPtr<ComputedStyle> kidStyle =
|
||||||
presShell->StyleSet()->ResolveServoStyle(*child->AsElement());
|
ServoStyleSet::ResolveServoStyle(*child->AsElement());
|
||||||
nsIFrame* frame;
|
nsIFrame* frame;
|
||||||
if (child->IsHTMLElement(nsGkAtoms::frameset)) {
|
if (child->IsHTMLElement(nsGkAtoms::frameset)) {
|
||||||
frame = NS_NewHTMLFramesetFrame(presShell, kidStyle);
|
frame = NS_NewHTMLFramesetFrame(presShell, kidStyle);
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ ComputedStyle* nsPlaceholderFrame::GetParentComputedStyleForOutOfFlow(
|
|||||||
mContent ? mContent->GetFlattenedTreeParentElement() : nullptr;
|
mContent ? mContent->GetFlattenedTreeParentElement() : nullptr;
|
||||||
if (parentElement && Servo_Element_IsDisplayContents(parentElement)) {
|
if (parentElement && Servo_Element_IsDisplayContents(parentElement)) {
|
||||||
RefPtr<ComputedStyle> style =
|
RefPtr<ComputedStyle> style =
|
||||||
PresShell()->StyleSet()->ResolveServoStyle(*parentElement);
|
ServoStyleSet::ResolveServoStyle(*parentElement);
|
||||||
*aProviderFrame = nullptr;
|
*aProviderFrame = nullptr;
|
||||||
// See the comment in GetParentComputedStyle to see why returning this as a
|
// See the comment in GetParentComputedStyle to see why returning this as a
|
||||||
// weak ref is fine.
|
// weak ref is fine.
|
||||||
|
|||||||
@@ -322,7 +322,8 @@ class ServoStyleSet {
|
|||||||
*
|
*
|
||||||
* FIXME(emilio): Is there a point in this after bug 1367904?
|
* FIXME(emilio): Is there a point in this after bug 1367904?
|
||||||
*/
|
*/
|
||||||
inline already_AddRefed<ComputedStyle> ResolveServoStyle(const dom::Element&);
|
static inline already_AddRefed<ComputedStyle> ResolveServoStyle(
|
||||||
|
const dom::Element&);
|
||||||
|
|
||||||
bool GetKeyframesForName(const dom::Element&, const ComputedStyle&,
|
bool GetKeyframesForName(const dom::Element&, const ComputedStyle&,
|
||||||
nsAtom* aName,
|
nsAtom* aName,
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ nscoord ServoStyleSet::EvaluateSourceSizeList(
|
|||||||
|
|
||||||
already_AddRefed<ComputedStyle> ServoStyleSet::ResolveServoStyle(
|
already_AddRefed<ComputedStyle> ServoStyleSet::ResolveServoStyle(
|
||||||
const dom::Element& aElement) {
|
const dom::Element& aElement) {
|
||||||
// TODO(emilio): mRawSet isn't used by this function, remove.
|
return Servo_ResolveStyle(&aElement).Consume();
|
||||||
return Servo_ResolveStyle(&aElement, mRawSet.get()).Consume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
@@ -5089,7 +5089,6 @@ pub extern "C" fn Servo_TakeChangeHint(
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ResolveStyle(
|
pub extern "C" fn Servo_ResolveStyle(
|
||||||
element: &RawGeckoElement,
|
element: &RawGeckoElement,
|
||||||
_raw_data: &RawServoStyleSet,
|
|
||||||
) -> Strong<ComputedValues> {
|
) -> Strong<ComputedValues> {
|
||||||
let element = GeckoElement(element);
|
let element = GeckoElement(element);
|
||||||
debug!("Servo_ResolveStyle: {:?}", element);
|
debug!("Servo_ResolveStyle: {:?}", element);
|
||||||
|
|||||||
Reference in New Issue
Block a user