Bug 1554571 - Part 1: Remove unused argument from Servo_ResolveStyle. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D33121

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Cameron McCormack 2019-06-27 07:22:13 +00:00
Родитель fe2cdfe8d4
Коммит 5bf528676e
9 изменённых файлов: 18 добавлений и 23 удалений

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

@ -2431,7 +2431,7 @@ struct RestyleManager::TextPostTraversalState {
ComputedStyle& ParentStyle() {
if (!mParentContext) {
mLazilyResolvedParentContext =
mParentRestyleState.StyleSet().ResolveServoStyle(mParentElement);
ServoStyleSet::ResolveServoStyle(mParentElement);
mParentContext = mLazilyResolvedParentContext;
}
return *mParentContext;
@ -2668,8 +2668,7 @@ bool RestyleManager::ProcessPostTraversal(Element* aElement,
static_cast<nsChangeHint>(Servo_TakeChangeHint(aElement, &wasRestyled));
RefPtr<ComputedStyle> upToDateStyleIfRestyled =
wasRestyled ? aRestyleState.StyleSet().ResolveServoStyle(*aElement)
: nullptr;
wasRestyled ? ServoStyleSet::ResolveServoStyle(*aElement) : nullptr;
// We should really fix the weird primary frame mapping for image maps
// (bug 135040)...
@ -2767,8 +2766,7 @@ bool RestyleManager::ProcessPostTraversal(Element* aElement,
const bool isDisplayContents = !styleFrame && aElement->HasServoData() &&
Servo_Element_IsDisplayContents(aElement);
if (isDisplayContents) {
oldOrDisplayContentsStyle =
aRestyleState.StyleSet().ResolveServoStyle(*aElement);
oldOrDisplayContentsStyle = ServoStyleSet::ResolveServoStyle(*aElement);
}
Maybe<ServoRestyleState> thisFrameRestyleState;

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

@ -1761,7 +1761,7 @@ void nsCSSFrameConstructor::CreateGeneratedContentItem(
// above. We need to grab style with animations from the pseudo element and
// replace old one.
mPresShell->StyleSet()->StyleNewSubtree(container);
pseudoStyle = styleSet->ResolveServoStyle(*container);
pseudoStyle = ServoStyleSet::ResolveServoStyle(*container);
}
uint32_t contentCount = pseudoStyle->StyleContent()->ContentCount();
@ -2253,7 +2253,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
}
RefPtr<ComputedStyle> computedStyle =
mPresShell->StyleSet()->ResolveServoStyle(*aDocElement);
ServoStyleSet::ResolveServoStyle(*aDocElement);
const nsStyleDisplay* display = computedStyle->StyleDisplay();
@ -4621,10 +4621,8 @@ void nsCSSFrameConstructor::InitAndRestoreFrame(
already_AddRefed<ComputedStyle> nsCSSFrameConstructor::ResolveComputedStyle(
nsIContent* aContent) {
ServoStyleSet* styleSet = mPresShell->StyleSet();
if (auto* element = Element::FromNode(aContent)) {
return styleSet->ResolveServoStyle(*element);
return ServoStyleSet::ResolveServoStyle(*element);
}
MOZ_ASSERT(aContent->IsText(),
@ -4646,7 +4644,7 @@ already_AddRefed<ComputedStyle> nsCSSFrameConstructor::ResolveComputedStyle(
// out.
RefPtr<ComputedStyle> parentStyle =
Servo_Element_GetPrimaryComputedValues(parent).Consume();
return styleSet->ResolveStyleForText(aContent, parentStyle);
return mPresShell->StyleSet()->ResolveStyleForText(aContent, parentStyle);
}
// MathML Mod - RBS

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

@ -10044,12 +10044,12 @@ ComputedStyle* nsLayoutUtils::StyleForScrollbar(nsIFrame* aScrollbarPart) {
// from the element directly. This can happen on viewport, because
// the scrollbar of viewport may be shown when the root element has
// > display: none; overflow: scroll;
nsPresContext* pc = aScrollbarPart->PresContext();
MOZ_ASSERT(content == pc->Document()->GetRootElement(),
"Root element is the only case for this fallback "
"path to be triggered");
MOZ_ASSERT(
content == aScrollbarPart->PresContext()->Document()->GetRootElement(),
"Root element is the only case for this fallback "
"path to be triggered");
RefPtr<ComputedStyle> style =
pc->StyleSet()->ResolveServoStyle(*content->AsElement());
ServoStyleSet::ResolveServoStyle(*content->AsElement());
// Dropping the strong reference is fine because the style should be
// held strongly by the element.
return style.get();

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

@ -9738,7 +9738,7 @@ ComputedStyle* nsFrame::DoGetParentComputedStyle(
pseudo == PseudoStyleType::tableWrapper) {
if (Servo_Element_IsDisplayContents(parentElement)) {
RefPtr<ComputedStyle> style =
PresShell()->StyleSet()->ResolveServoStyle(*parentElement);
ServoStyleSet::ResolveServoStyle(*parentElement);
// NOTE(emilio): we return a weak reference because the element also
// holds the style context alive. This is a bit silly (we could've
// 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.
RefPtr<ComputedStyle> kidStyle =
presShell->StyleSet()->ResolveServoStyle(*child->AsElement());
ServoStyleSet::ResolveServoStyle(*child->AsElement());
nsIFrame* frame;
if (child->IsHTMLElement(nsGkAtoms::frameset)) {
frame = NS_NewHTMLFramesetFrame(presShell, kidStyle);

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

@ -207,7 +207,7 @@ ComputedStyle* nsPlaceholderFrame::GetParentComputedStyleForOutOfFlow(
mContent ? mContent->GetFlattenedTreeParentElement() : nullptr;
if (parentElement && Servo_Element_IsDisplayContents(parentElement)) {
RefPtr<ComputedStyle> style =
PresShell()->StyleSet()->ResolveServoStyle(*parentElement);
ServoStyleSet::ResolveServoStyle(*parentElement);
*aProviderFrame = nullptr;
// See the comment in GetParentComputedStyle to see why returning this as a
// weak ref is fine.

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

@ -322,7 +322,8 @@ class ServoStyleSet {
*
* 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&,
nsAtom* aName,

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

@ -19,8 +19,7 @@ nscoord ServoStyleSet::EvaluateSourceSizeList(
already_AddRefed<ComputedStyle> ServoStyleSet::ResolveServoStyle(
const dom::Element& aElement) {
// TODO(emilio): mRawSet isn't used by this function, remove.
return Servo_ResolveStyle(&aElement, mRawSet.get()).Consume();
return Servo_ResolveStyle(&aElement).Consume();
}
} // namespace mozilla

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

@ -5089,7 +5089,6 @@ pub extern "C" fn Servo_TakeChangeHint(
#[no_mangle]
pub extern "C" fn Servo_ResolveStyle(
element: &RawGeckoElement,
_raw_data: &RawServoStyleSet,
) -> Strong<ComputedValues> {
let element = GeckoElement(element);
debug!("Servo_ResolveStyle: {:?}", element);