зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
fe2cdfe8d4
Коммит
5bf528676e
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче