Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio

This commit is contained in:
Jonathan Watt 2018-03-23 13:49:21 +00:00
parent ee48bf82e0
commit 82ebebe276
64 changed files with 188 additions and 184 deletions

View File

@ -244,7 +244,7 @@ private:
// When |aBackendType| is StyleBackendType::Gecko, we determine which
// properties are specified using the provided |aComputedStyle| and
// |aElement| and |aPseudoType| are ignored. If |aComputedStyle| is nullptr,
// we automatically look up the style context of primary frame of the
// we automatically look up the ComputedStyle of primary frame of the
// (pseudo-)element.
//
// When |aBackendType| is StyleBackendType::Servo, we use the |StrongRuleNode|

View File

@ -60,7 +60,7 @@ struct PropertyValuePair
* overlapping shorthands/longhands, convert specified CSS values to computed
* values, etc.
*
* When the target element or style context changes, however, we rebuild these
* When the target element or computed style changes, however, we rebuild these
* per-property arrays from the original list of keyframes objects. As a result,
* these objects represent the master definition of the effect's values.
*/

View File

@ -1019,7 +1019,7 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
// We should just store shorthands as-is (bug 1391537) and then return the
// variable references, but for now, since we don't do that, and in order to
// be consistent with Gecko, we just expand the variables (assuming we have
// enough context to do so). For that we need to grab the style context so we
// enough context to do so). For that we need to grab the ComputedStyle so we
// know what custom property values to provide.
RefPtr<ComputedStyle> computedStyle;
if (isCSSAnimation) {

View File

@ -320,10 +320,10 @@ protected:
// have changed, or when the target frame might have changed.
void MaybeUpdateFrameForCompositor();
// Looks up the style context associated with the target element, if any.
// Looks up the ComputedStyle associated with the target element, if any.
// We need to be careful to *not* call this when we are updating the style
// context. That's because calling GetComputedStyle when we are in the process
// of building a style context may trigger various forms of infinite
// of building a ComputedStyle may trigger various forms of infinite
// recursion.
already_AddRefed<ComputedStyle> GetTargetComputedStyle();

View File

@ -543,7 +543,7 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
return true;
}
// Get the computed -moz-binding directly from the style context
// Get the computed -moz-binding directly from the ComputedStyle
RefPtr<ComputedStyle> sc =
nsComputedDOMStyle::GetComputedStyleNoFlush(this, nullptr);
NS_ENSURE_TRUE(sc, false);
@ -581,7 +581,7 @@ Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
return obj;
}
// Make sure the style context goes away _before_ we load the binding
// Make sure the ComputedStyle goes away _before_ we load the binding
// since that can destroy the relevant presshell.
{

View File

@ -443,7 +443,7 @@ CollectWindowReports(nsGlobalWindowInner *aWindow,
"Memory used by CSS rule nodes within a window.");
REPORT_SIZE("/layout/style-contexts", mArenaSizes.mComputedStyles,
"Memory used by style contexts within a window.");
"Memory used by ComputedStyles within a window.");
// There are many different kinds of style structs, but it is likely that
// only a few matter. Implement a cutoff so we don't bloat about:memory with

View File

@ -2709,7 +2709,7 @@ GetFontStyleForServo(Element* aElement, const nsAString& aFont,
ServoStyleSet* styleSet = aPresShell->StyleSet()->AsServo();
RefPtr<ComputedStyle> parentStyle;
// have to get a parent style context for inherit-like relative
// have to get a parent ComputedStyle for inherit-like relative
// values (2em, bolder, etc.)
if (aElement && aElement->IsInComposedDoc()) {
parentStyle = nsComputedDOMStyle::GetComputedStyle(aElement, nullptr);
@ -3717,7 +3717,7 @@ CanvasRenderingContext2D::SetFontInternal(const nsAString& aFont,
{
/*
* If font is defined with relative units (e.g. ems) and the parent
* style context changes in between calls, setting the font to the
* ComputedStyle changes in between calls, setting the font to the
* same value as previous could result in a different computed value,
* so we cannot have the optimization where we check if the new font
* string is equal to the old one.
@ -4351,7 +4351,7 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
CanvasBidiProcessor processor;
// If we don't have a style context, we can't set up vertical-text flags
// If we don't have a ComputedStyle, we can't set up vertical-text flags
// (for now, at least; perhaps we need new Canvas API to control this).
processor.mTextRunFlags = canvasStyle
? nsLayoutUtils::GetTextRunFlagsForStyle(canvasStyle,

View File

@ -940,7 +940,7 @@ HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
// WalkContentStyleRules so that this happens.) This violates the
// nsIStyleRule contract, since it's the same style rule object doing
// the mapping in two different ways. It's also incorrect since it's
// testing the display type of the style context rather than checking
// testing the display type of the ComputedStyle rather than checking
// which *element* it's matching (style rules should not stop matching
// when the display type is changed).

View File

@ -732,7 +732,7 @@ ImageDocument::CreateSyntheticDocument()
nsresult
ImageDocument::CheckOverflowing(bool changeState)
{
/* Create a scope so that the style context gets destroyed before we might
/* Create a scope so that the ComputedStyle gets destroyed before we might
* call RebuildStyleData. Also, holding onto pointers to the
* presentation through style resolution is potentially dangerous.
*/

View File

@ -285,7 +285,7 @@
document.documentElement.appendChild(link);
navigator.serviceWorker.addEventListener("message", function onMessage(e) {
if (e.data.data == "style") {
is(e.data.context, "style", "Expected the style context on a request coming from a stylesheet");
is(e.data.context, "style", "Expected the ComputedStyle on a request coming from a stylesheet");
navigator.serviceWorker.removeEventListener("message", onMessage);
resolve();
}

View File

@ -44,7 +44,7 @@ nsSMILCSSProperty::GetBaseValue() const
// SPECIAL CASE: (a) Shorthands
// (b) 'display'
// (c) No base style context
// (c) No base ComputedStyle
if (nsCSSProps::IsShorthand(mPropID) ||
mPropID == eCSSProperty_display ||
!mBaseComputedStyle) {
@ -56,7 +56,7 @@ nsSMILCSSProperty::GetBaseValue() const
// doing so involves clearing and resetting the property which can cause
// frames to be recreated which we'd like to avoid.
//
// Furthermore, if we don't (yet) have a base style context we obviously
// Furthermore, if we don't (yet) have a base ComputedStyle we obviously
// can't resolve a base value.
//
// In any case, just return a dummy value (initialized with the right

View File

@ -35,7 +35,7 @@ public:
* Constructs a new nsSMILCSSProperty.
* @param aPropID The CSS property we're interested in animating.
* @param aElement The element whose CSS property is being animated.
* @param aBaseComputedStyle The style context to use when getting the base
* @param aBaseComputedStyle The ComputedStyle to use when getting the base
* value. If this is nullptr and GetBaseValue is
* called, an empty nsSMILValue initialized with
* the nsSMILCSSValueType will be returned.
@ -79,7 +79,7 @@ protected:
//
// As with mElement, since an nsISMILAttr only lives as long as the
// compositing step and since ComposeAttribute holds an owning reference to
// the base style context, we can use a non-owning reference here.
// the base ComputedStyle, we can use a non-owning reference here.
mozilla::ComputedStyle* mBaseComputedStyle;
};

View File

@ -55,7 +55,7 @@ nsSMILCompositor::ComposeAttribute(bool& aMightHavePendingStyleUpdates)
if (!mKey.mElement)
return;
// If we might need to resolve base styles, grab a suitable style context
// If we might need to resolve base styles, grab a suitable ComputedStyle
// for initializing our nsISMILAttr with.
RefPtr<ComputedStyle> baseComputedStyle;
if (MightNeedBaseStyle()) {

View File

@ -75,7 +75,7 @@ public:
private:
// Create a nsISMILAttr for my target, on the heap.
//
// @param aBaseComputedStyle An optional style context which, if set, will be
// @param aBaseComputedStyle An optional ComputedStyle which, if set, will be
// used when fetching the base style.
mozilla::UniquePtr<nsISMILAttr>
CreateSMILAttr(mozilla::ComputedStyle* aBaseComputedStyle);

View File

@ -279,7 +279,7 @@ SVGContentUtils::GetFontSize(Element *aElement)
nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
if (!computedStyle) {
// ReportToConsole
NS_WARNING("Couldn't get style context for content in GetFontStyle");
NS_WARNING("Couldn't get ComputedStyle for content in GetFontStyle");
return 1.0f;
}
@ -296,7 +296,7 @@ SVGContentUtils::GetFontSize(nsIFrame *aFrame)
float
SVGContentUtils::GetFontSize(ComputedStyle *aComputedStyle)
{
MOZ_ASSERT(aComputedStyle, "NULL style context in GetFontSize");
MOZ_ASSERT(aComputedStyle, "NULL ComputedStyle in GetFontSize");
nsPresContext *presContext = aComputedStyle->PresContext();
MOZ_ASSERT(presContext, "NULL pres context in GetFontSize");
@ -316,7 +316,7 @@ SVGContentUtils::GetFontXHeight(Element *aElement)
nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
if (!computedStyle) {
// ReportToConsole
NS_WARNING("Couldn't get style context for content in GetFontStyle");
NS_WARNING("Couldn't get ComputedStyle for content in GetFontStyle");
return 1.0f;
}
@ -333,7 +333,7 @@ SVGContentUtils::GetFontXHeight(nsIFrame *aFrame)
float
SVGContentUtils::GetFontXHeight(ComputedStyle *aComputedStyle)
{
MOZ_ASSERT(aComputedStyle, "NULL style context in GetFontXHeight");
MOZ_ASSERT(aComputedStyle, "NULL ComputedStyle in GetFontXHeight");
nsPresContext *presContext = aComputedStyle->PresContext();
MOZ_ASSERT(presContext, "NULL pres context in GetFontXHeight");

View File

@ -150,7 +150,7 @@ SVGGeometryElement::GetFillRule()
}
} else {
// ReportToConsole
NS_WARNING("Couldn't get style context for content in GetFillRule");
NS_WARNING("Couldn't get ComputedStyle for content in GetFillRule");
}
return fillRule;

View File

@ -4136,7 +4136,8 @@ EditorBase::IsPreformatted(nsIDOMNode* aNode,
nsCOMPtr<nsIPresShell> ps = GetPresShell();
NS_ENSURE_TRUE(ps, NS_ERROR_NOT_INITIALIZED);
// Look at the node (and its parent if it's not an element), and grab its style context
// Look at the node (and its parent if it's not an element), and grab its
// ComputedStyle.
RefPtr<ComputedStyle> elementStyle;
if (!content->IsElement()) {
content = content->GetParent();
@ -4147,9 +4148,9 @@ EditorBase::IsPreformatted(nsIDOMNode* aNode,
}
if (!elementStyle) {
// Consider nodes without a style context to be NOT preformatted:
// Consider nodes without a ComputedStyle to be NOT preformatted:
// For instance, this is true of JS tags inside the body (which show
// up as #text nodes but have no style context).
// up as #text nodes but have no ComputedStyle).
*aResult = false;
return NS_OK;
}

View File

@ -4268,7 +4268,7 @@ PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush)
// Now those constructors or events might have posted restyle
// events. At the same time, we still need up-to-date style data.
// In particular, reflow depends on style being completely up to
// date. If it's not, then style context reparenting, which can
// date. If it's not, then style reparenting, which can
// happen during reflow, might suddenly pick up the new rules and
// we'll end up with frames whose style doesn't match the frame
// type.
@ -9722,7 +9722,7 @@ PresShell::ListComputedStyles(FILE *out, int32_t aIndent)
rootFrame->Style()->List(out, aIndent);
}
// The root element's frame's style context is the root of a separate tree.
// The root element's frame's ComputedStyle is the root of a separate tree.
Element* rootElement = mDocument->GetRootElement();
if (rootElement) {
nsIFrame* rootElementFrame = rootElement->GetPrimaryFrame();

View File

@ -166,7 +166,7 @@ enum nsChangeHint : uint32_t {
/**
* A hint reflecting that style data changed with no change handling
* behavior. We need to return this, rather than nsChangeHint(0),
* so that certain optimizations that manipulate the style context tree are
* so that certain optimizations that manipulate the style tree are
* correct.
*
* nsChangeHint_NeutralChange must be returned by CalcDifference on a given
@ -542,19 +542,19 @@ NS_RemoveSubsumedHints(nsChangeHint aOurChange, nsChangeHint aHintsHandled)
* Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process
* can stop processing at a frame when it detects no style changes and it is
* known that the styles of the subtree beneath it will not change, leaving
* the old style context on the frame. eRestyle_Force can be used to skip this
* optimization on a frame, and to force its new style context to be used.
* the old ComputedStyle on the frame. eRestyle_Force can be used to skip this
* optimization on a frame, and to force its new ComputedStyle to be used.
*
* Similarly, eRestyle_ForceDescendants will cause the frame and all of its
* descendants to be traversed and for the new style contexts that are created
* descendants to be traversed and for the new ComputedStyles that are created
* to be set on the frames.
*
* NOTE: When adding new restyle hints, please also add them to
* RestyleManager::RestyleHintToString.
*/
enum nsRestyleHint : uint32_t {
// Rerun selector matching on the element. If a new style context
// results, update the style contexts of descendants. (Irrelevant if
// Rerun selector matching on the element. If a new ComputedStyle
// results, update the ComputedStyles of descendants. (Irrelevant if
// eRestyle_Subtree is also set, since that implies a superset of the
// work.)
eRestyle_Self = 1 << 0,
@ -574,24 +574,24 @@ enum nsRestyleHint : uint32_t {
eRestyle_LaterSiblings = 1 << 3,
// Replace the style data coming from CSS transitions without updating
// any other style data. If a new style context results, update style
// any other style data. If a new ComputedStyle results, update style
// contexts on the descendants. (Irrelevant if eRestyle_Self or
// eRestyle_Subtree is also set, since those imply a superset of the
// work.)
eRestyle_CSSTransitions = 1 << 4,
// Replace the style data coming from CSS animations without updating
// any other style data. If a new style context results, update style
// any other style data. If a new ComputedStyle results, update style
// contexts on the descendants. (Irrelevant if eRestyle_Self or
// eRestyle_Subtree is also set, since those imply a superset of the
// work.)
eRestyle_CSSAnimations = 1 << 5,
// Replace the style data coming from inline style without updating
// any other style data. If a new style context results, update style
// any other style data. If a new ComputedStyle results, update style
// contexts on the descendants. (Irrelevant if eRestyle_Self or
// eRestyle_Subtree is also set, since those imply a superset of the
// work.) Supported only for element style contexts and not for
// work.) Supported only for element ComputedStyles and not for
// pseudo-elements or anonymous boxes, on which it converts to
// eRestyle_Self.
// If the change is for the advance of a declarative animation, use

View File

@ -369,7 +369,7 @@ public:
/**
* Given a frame which is the primary frame for an element,
* return the frame that has the non-pseudoelement style context for
* return the frame that has the non-pseudoelement ComputedStyle for
* the content.
* This is aPrimaryFrame itself except for tableWrapper frames.
*
@ -381,7 +381,7 @@ public:
/**
* Given a content node,
* return the frame that has the non-pseudoelement style context for
* return the frame that has the non-pseudoelement ComputedStyle for
* the content. May return null.
* This is aContent->GetPrimaryFrame() except for tableWrapper frames.
*/
@ -677,7 +677,7 @@ public:
* attached to it; returns false otherwise.
*
* @param aContent the content node we're looking at
* @param aComputedStyle aContent's style context
* @param aComputedStyle aContent's ComputedStyle
* @param aPseudoElement the id of the pseudo style we care about
* @param aPresContext the presentation context
* @return whether aContent has aPseudoElement style attached to it
@ -1835,7 +1835,7 @@ public:
* @param aRenderingContext Where to draw the image, set up with an
* appropriate scale and transform for drawing in
* app units.
* @param aComputedStyle The style context of the nsIFrame (or
* @param aComputedStyle The ComputedStyle of the nsIFrame (or
* pseudo-element) for which this image is being
* drawn.
* @param aImage The image.

View File

@ -98,7 +98,7 @@ public:
/**
* Clears all currently registered ArenaRefPtrs for the given ArenaObjectID.
* This is called when we reconstruct the rule tree so that style contexts
* This is called when we reconstruct the rule tree so that ComputedStyles
* pointing into the old rule tree aren't released afterwards, triggering an
* assertion in ~ComputedStyle.
*/

View File

@ -183,7 +183,7 @@ private:
nsCOMPtr<Element> mThumbDiv;
/**
* Cached style context for -moz-focus-outer CSS pseudo-element style.
* Cached ComputedStyle for -moz-focus-outer CSS pseudo-element style.
*/
RefPtr<ComputedStyle> mOuterFocusStyle;

View File

@ -36,9 +36,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=572649
/** Test for Bug 572649 **/
SimpleTest.waitForExplicitFinish();
// We intermittently trigger two "Wrong parent style context" assertions
// We intermittently trigger two "Wrong parent ComputedStyle" assertions
// on B2G emulator builds (bug XXXXXXX). The two frames that get incorrect
// style context parents are scroll bar parts in the <textarea>.
// ComputedStyle parents are scroll bar parts in the <textarea>.
SimpleTest.expectAssertions(0, 2);
addLoadEvent(function() {

View File

@ -2895,7 +2895,7 @@ ReflowInput::CalcLineHeight(nsIContent* aContent,
nscoord aBlockBSize,
float aFontSizeInflation)
{
NS_PRECONDITION(aComputedStyle, "Must have a style context");
NS_PRECONDITION(aComputedStyle, "Must have a ComputedStyle");
nscoord lineHeight =
ComputeLineHeight(aComputedStyle, aBlockBSize, aFontSizeInflation);

View File

@ -481,7 +481,7 @@ public:
{ }
/**
* Construct writing mode based on a style context
* Construct writing mode based on a ComputedStyle.
*/
explicit WritingMode(ComputedStyle* aComputedStyle)
{

View File

@ -938,7 +938,7 @@ protected:
// Remove and return the pushed floats list.
nsFrameList* RemovePushedFloats();
// Resolve a style context for our bullet frame. aType should be
// Resolve a ComputedStyle for our bullet frame. aType should be
// mozListBullet or mozListNumber. Passing in the style set is an
// optimization, because all callsites have it.
already_AddRefed<ComputedStyle> ResolveBulletStyle(

View File

@ -148,7 +148,7 @@ nsBulletFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle)
RegisterImageRequest(/* aKnownToBeAnimated = */ false);
}
} else {
// No image request on the new style context.
// No image request on the new ComputedStyle.
DeregisterAndCancelImageRequest();
}

View File

@ -57,9 +57,9 @@ nsFirstLetterFrame::Init(nsIContent* aContent,
{
RefPtr<ComputedStyle> newSC;
if (aPrevInFlow) {
// Get proper style context for ourselves. We're creating the frame
// Get proper ComputedStyle for ourselves. We're creating the frame
// that represents everything *except* the first letter, so just create
// a style context that inherits from our style parent, with no extra rules.
// a ComputedStyle that inherits from our style parent, with no extra rules.
nsIFrame* styleParent =
CorrectStyleParentFrame(aParent, nsCSSPseudoElements::firstLetter);
ComputedStyle* parentComputedStyle = styleParent->Style();
@ -321,11 +321,11 @@ nsFirstLetterFrame::CreateContinuationForFloatingParent(nsPresContext* aPresCont
CreateContinuingFrame(aPresContext, aChild, parent, aIsFluid);
// The continuation will have gotten the first letter style from its
// prev continuation, so we need to repair the style context so it
// prev continuation, so we need to repair the ComputedStyle so it
// doesn't have the first letter styling.
//
// Note that getting parent frame's style context is different from getting
// this frame's style context's parent in the presence of ::first-line,
// Note that getting parent frame's ComputedStyle is different from getting
// this frame's ComputedStyle's parent in the presence of ::first-line,
// which we do want the continuation to inherit from.
ComputedStyle* parentSC = parent->Style();
if (parentSC) {
@ -372,7 +372,7 @@ nsFirstLetterFrame::DrainOverflowFrames(nsPresContext* aPresContext)
mFrames.AppendFrames(nullptr, *overflowFrames);
}
// Now repair our first frames style context (since we only reflow
// Now repair our first frames ComputedStyle (since we only reflow
// one frame there is no point in doing any other ones until they
// are reflowed)
nsIFrame* kid = mFrames.FirstChild();
@ -411,7 +411,7 @@ nsFirstLetterFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
{
if (GetPrevContinuation()) {
// We shouldn't get calls to GetSkipSides for later continuations since
// they have separate style contexts with initial values for all the
// they have separate ComputedStyles with initial values for all the
// properties that could trigger a call to GetSkipSides. Then again,
// it's not really an error to call GetSkipSides on any frame, so
// that's why we handle it properly.

View File

@ -250,17 +250,17 @@ public:
}
/**
* Do the work for getting the parent style context frame so that
* Do the work for getting the parent ComputedStyle frame so that
* other frame's |GetParentComputedStyle| methods can call this
* method on *another* frame. (This function handles out-of-flow
* frames by using the frame manager's placeholder map and it also
* handles block-within-inline and generated content wrappers.)
*
* @param aProviderFrame (out) the frame associated with the returned value
* or null if the style context is for display:contents content.
* @return The style context that should be the parent of this frame's
* style context. Null is permitted, and means that this frame's
* style context should be the root of the style context tree.
* or null if the ComputedStyle is for display:contents content.
* @return The ComputedStyle that should be the parent of this frame's
* ComputedStyle. Null is permitted, and means that this frame's
* ComputedStyle should be the root of the ComputedStyle tree.
*/
ComputedStyle* DoGetParentComputedStyle(nsIFrame** aProviderFrame) const;
@ -556,7 +556,7 @@ public:
const nsDisplayListSet& aLists);
/**
* Adjust the given parent frame to the right style context parent frame for
* Adjust the given parent frame to the right ComputedStyle parent frame for
* the child, given the pseudo-type of the prospective child. This handles
* things like walking out of table pseudos and so forth.
*

View File

@ -264,8 +264,8 @@ FRAME_STATE_BIT(Generic, 53, NS_FRAME_IS_NONDISPLAY)
// Frame has a LayerActivityProperty property
FRAME_STATE_BIT(Generic, 54, NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY)
// Frame owns anonymous boxes whose style contexts it will need to update during
// a stylo tree traversal.
// Frame owns anonymous boxes whose ComputedStyles it will need to update
// during a stylo tree traversal.
FRAME_STATE_BIT(Generic, 55, NS_FRAME_OWNS_ANON_BOXES)
// Frame maybe has a counter-reset/increment style

View File

@ -237,7 +237,7 @@ nsImageFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle)
nsStyleImageOrientation newOrientation = StyleVisibility()->mImageOrientation;
// We need to update our orientation either if we had no style context before
// We need to update our orientation either if we had no ComputedStyle before
// because this is the first time it's been set, or if the image-orientation
// property changed from its previous value.
bool shouldUpdateOrientation =
@ -2108,7 +2108,7 @@ nsImageFrame::GetCursor(const nsPoint& aPoint,
nsCOMPtr<nsIContent> area = map->GetArea(p.x, p.y);
if (area) {
// Use the cursor from the style of the *area* element.
// XXX Using the image as the parent style context isn't
// XXX Using the image as the parent ComputedStyle isn't
// technically correct, but it's probably the right thing to do
// here, since it means that areas on which the cursor isn't
// specified will inherit the style from the image.

View File

@ -360,9 +360,9 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
const nsFrameList::Slice& newFrames =
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
// If our prev in flow was under the first continuation of a first-line
// frame then we need to reparent the style contexts to remove the
// frame then we need to reparent the ComputedStyles to remove the
// the special first-line styling. In the lazilySetParentPointer case
// we reparent the style contexts when we set their parents in
// we reparent the ComputedStyles when we set their parents in
// nsInlineFrame::ReflowFrames and nsInlineFrame::ReflowInlineFrame.
if (aReflowInput.mLineLayout->GetInFirstLine()) {
ReparentChildListStyle(aPresContext, newFrames, this);
@ -960,12 +960,12 @@ nsInlineFrame::UpdateStyleOfOwnedAnonBoxesForIBSplit(
ComputedStyle* ourStyle = Style();
// The anonymous block's style inherits from ours, and we already have our new
// style context.
// ComputedStyle.
RefPtr<ComputedStyle> newContext =
aRestyleState.StyleSet().ResolveInheritingAnonymousBoxStyle(
nsCSSAnonBoxes::mozBlockInsideInlineWrapper, ourStyle);
// We're guaranteed that newContext only differs from the old style context on
// We're guaranteed that newContext only differs from the old ComputedStyle on
// the block in things they might inherit from us. And changehint processing
// guarantees walking the continuation and ib-sibling chains, so our existing
// changehint being in aChangeList is good enough. So we don't need to touch
@ -977,10 +977,10 @@ nsInlineFrame::UpdateStyleOfOwnedAnonBoxesForIBSplit(
MOZ_ASSERT(blockFrame->Style()->GetPseudo() ==
nsCSSAnonBoxes::mozBlockInsideInlineWrapper,
"Unexpected kind of style context");
"Unexpected kind of ComputedStyle");
// We don't want to just walk through using GetNextContinuationWithSameStyle
// here, because we want to set updated style contexts on both our
// here, because we want to set updated ComputedStyles on both our
// ib-sibling blocks and inlines.
for (nsIFrame* cont = blockFrame; cont; cont = cont->GetNextContinuation()) {
cont->SetComputedStyle(newContext);
@ -1026,12 +1026,12 @@ nsFirstLineFrame::Init(nsIContent* aContent,
return;
}
// This frame is a continuation - fixup the style context if aPrevInFlow
// This frame is a continuation - fixup the computed style if aPrevInFlow
// is the first-in-flow (the only one with a ::first-line pseudo).
if (aPrevInFlow->Style()->GetPseudo() == nsCSSPseudoElements::firstLine) {
MOZ_ASSERT(FirstInFlow() == aPrevInFlow);
// Create a new style context that is a child of the parent
// style context thus removing the ::first-line style. This way
// Create a new ComputedStyle that is a child of the parent
// ComputedStyle thus removing the ::first-line style. This way
// we behave as if an anonymous (unstyled) span was the child
// of the parent frame.
ComputedStyle* parentContext = aParent->Style();
@ -1088,7 +1088,7 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
AutoFrameListPtr prevOverflowFrames(aPresContext,
prevInFlow->StealOverflowFrames());
if (prevOverflowFrames) {
// Reparent the new frames and their style contexts.
// Reparent the new frames and their ComputedStyles.
const nsFrameList::Slice& newFrames =
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
ReparentChildListStyle(aPresContext, newFrames, this);

View File

@ -254,7 +254,7 @@ static const nsFrameState TEXT_WHITESPACE_FLAGS =
* TEXT_IS_SIMPLE_FLOW and TEXT_MIGHT_HAVE_GLYPH_CHANGES flags.
*
* We go to considerable effort to make sure things work even if in-flow
* siblings have different style contexts (i.e., first-letter and first-line).
* siblings have different ComputedStyles (i.e., first-letter and first-line).
*
* Our convention is that unsigned integer character offsets are offsets into
* the transformed string. Signed integer character offsets are offsets into

View File

@ -27,9 +27,9 @@ third line
SimpleTest.waitForExplicitFinish();
// We intermittently trigger two "Wrong parent style context" assertions
// We intermittently trigger two "Wrong parent ComputedStyle" assertions
// on B2G emulator builds (bug XXXXXXX). The two frames that get incorrect
// style context parents are scroll bar parts in the <textarea>.
// ComputedStyle parents are scroll bar parts in the <textarea>.
SimpleTest.expectAssertions(0, 2);
SimpleTest.waitForFocus(function test() {

View File

@ -204,7 +204,7 @@ mtable[framespacing] > mtr > mtd {
}
/**************************************************************************/
/* This rule is used to give a style context suitable for nsMathMLChars.
/* This rule is used to give a ComputedStyle suitable for nsMathMLChars.
We don't actually style -moz-math-anonymous by default. */
/*
::-moz-math-anonymous {

View File

@ -761,7 +761,7 @@ nsMathMLChar::~nsMathMLChar()
ComputedStyle*
nsMathMLChar::GetComputedStyle() const
{
NS_ASSERTION(mComputedStyle, "chars should always have style context");
NS_ASSERTION(mComputedStyle, "chars should always have a ComputedStyle");
return mComputedStyle;
}
@ -819,9 +819,9 @@ nsMathMLChar::SetData(nsString& aData)
be in different fonts. For eg., the base size for '(' should
come from a normal ascii font if CMEX10 is used, since CMEX10
only contains the stretched versions. Hence, there are two
style contexts in use throughout the process. The leaf style
ComputedStyles in use throughout the process. The leaf style
context of the char holds fonts with which to try to stretch
the char. The parent style context of the char contains fonts
the char. The parent ComputedStyle of the char contains fonts
for normal rendering. So the parent context is the one used
to get the initial base size at the start of the pipeline.
b) For operators that can be largeop's in display mode,
@ -833,7 +833,7 @@ nsMathMLChar::SetData(nsString& aData)
2) We search for the first larger variant of the char that fits the
container' size. We first search for larger variants using the glyph
table corresponding to the first existing font specified in the list of
stretchy fonts held by the leaf style context (from -moz-math-stretchy in
stretchy fonts held by the leaf ComputedStyle (from -moz-math-stretchy in
mathml.css). Generic fonts are resolved by the preference
"font.mathfont-family".
Issues :
@ -1095,7 +1095,7 @@ StretchEnumContext::TryVariants(nsGlyphTable* aGlyphTable,
RefPtr<gfxFontGroup>* aFontGroup,
const FontFamilyList& aFamilyList)
{
// Use our stretchy style context now that stretching is in progress
// Use our stretchy ComputedStyle now that stretching is in progress
ComputedStyle *sc = mChar->mComputedStyle;
nsFont font = sc->StyleFont()->mFont;
NormalizeDefaultFont(font, mFontSizeInflation);
@ -1241,7 +1241,7 @@ nsMathMLChar::StretchEnumContext::TryParts(nsGlyphTable* aGlyphTable,
RefPtr<gfxFontGroup>* aFontGroup,
const FontFamilyList& aFamilyList)
{
// Use our stretchy style context now that stretching is in progress
// Use our stretchy ComputedStyle now that stretching is in progress
nsFont font = mChar->mComputedStyle->StyleFont()->mFont;
NormalizeDefaultFont(font, mFontSizeInflation);

View File

@ -176,7 +176,7 @@ public:
// Metrics that _exactly_ enclose the char. The char *must* have *already*
// being stretched before you can call the GetBoundingMetrics() method.
// IMPORTANT: since chars have their own style contexts, and may be rendered
// IMPORTANT: since chars have their own ComputedStyles, and may be rendered
// with glyphs that are not in the parent font, just calling the default
// aRenderingContext.GetBoundingMetrics(aChar) can give incorrect results.
void
@ -189,7 +189,7 @@ public:
mBoundingMetrics = aBoundingMetrics;
}
// Hooks to access the extra leaf style contexts given to the MathMLChars.
// Hooks to access the extra leaf ComputedStyles given to the MathMLChars.
// They provide an interface to make them accessible to the Style System via
// the Get/Set AdditionalComputedStyle() APIs. Owners of MathMLChars
// should honor these APIs.

View File

@ -90,9 +90,9 @@ nsMathMLFrame::UpdatePresentationData(uint32_t aFlagsValues,
return NS_OK;
}
// Helper to give a style context suitable for doing the stretching of
// Helper to give a ComputedStyle suitable for doing the stretching of
// a MathMLChar. Frame classes that use this should ensure that the
// extra leaf style contexts given to the MathMLChars are accessible to
// extra leaf ComputedStyle given to the MathMLChars are accessible to
// the Style System via the Get/Set AdditionalComputedStyle() APIs.
/* static */ void
nsMathMLFrame::ResolveMathMLCharStyle(nsPresContext* aPresContext,

View File

@ -104,8 +104,8 @@ public:
return false;
}
// helper to give a style context suitable for doing the stretching to the
// MathMLChar. Frame classes that use this should make the extra style contexts
// helper to give a ComputedStyle suitable for doing the stretching to the
// MathMLChar. Frame classes that use this should make the extra ComputedStyle
// accessible to the Style System via Get/Set AdditionalmComputedStyle.
static void
ResolveMathMLCharStyle(nsPresContext* aPresContext,

View File

@ -65,7 +65,7 @@ nsresult nsMathMLmencloseFrame::AllocateMathMLChar(nsMencloseNotation mask)
(mask == NOTATION_RADICAL && mRadicalCharIndex >= 0))
return NS_OK;
// No need to track the style context given to our MathML chars.
// No need to track the ComputedStyle given to our MathML chars.
// The Style System will use Get/SetAdditionalComputedStyle() to keep it
// up-to-date if dynamic changes arise.
uint32_t i = mMathMLChar.Length();
@ -726,7 +726,7 @@ nsMathMLmencloseFrame::AttributeChanged(int32_t aNameSpaceID,
}
//////////////////
// the Style System will use these to pass the proper style context to our
// the Style System will use these to pass the proper ComputedStyle to our
// MathMLChar
ComputedStyle*
nsMathMLmencloseFrame::GetAdditionalComputedStyle(int32_t aIndex) const

View File

@ -56,7 +56,7 @@ nsMathMLmfencedFrame::SetInitialChildList(ChildListID aListID,
// frame, so initialize NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY for
// GetPreferredStretchSize() from Reflow().
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
// No need to track the style contexts given to our MathML chars.
// No need to track the ComputedStyle given to our MathML chars.
// The Style System will use Get/SetAdditionalComputedStyle() to keep them
// up-to-date if dynamic changes arise.
CreateFencesAndSeparators(PresContext());
@ -682,7 +682,8 @@ nsMathMLmfencedFrame::FixInterFrameSpacing(ReflowOutput& aDesiredSize)
}
// ----------------------
// the Style System will use these to pass the proper style context to our MathMLChar
// the Style System will use these to pass the proper ComputedStyle to our
// MathMLChar
ComputedStyle*
nsMathMLmfencedFrame::GetAdditionalComputedStyle(int32_t aIndex) const
{

View File

@ -16,7 +16,7 @@
// <mo> -- operator, fence, or separator - implementation
//
// additional style context to be used by our MathMLChar.
// additional ComputedStyle to be used by our MathMLChar.
#define NS_MATHML_CHAR_STYLE_CONTEXT_INDEX 0
nsIFrame*
@ -943,7 +943,7 @@ nsMathMLmoFrame::Reflow(nsPresContext* aPresContext,
{
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
// certain values use units that depend on our style context, so
// certain values use units that depend on our ComputedStyle, so
// it is safer to just process the whole lot here
ProcessOperatorData();
@ -1091,8 +1091,8 @@ nsMathMLmoFrame::AttributeChanged(int32_t aNameSpaceID,
}
// ----------------------
// No need to track the style context given to our MathML char.
// the Style System will use these to pass the proper style context to our MathMLChar
// No need to track the ComputedStyle given to our MathML char.
// the Style System will use these to pass the proper ComputedStyle to our MathMLChar
ComputedStyle*
nsMathMLmoFrame::GetAdditionalComputedStyle(int32_t aIndex) const
{

View File

@ -16,7 +16,7 @@ using namespace mozilla;
// <mroot> -- form a radical - implementation
//
// additional style context to be used by our MathMLChar.
// additional ComputedStyle to be used by our MathMLChar.
#define NS_SQR_CHAR_STYLE_CONTEXT_INDEX 0
static const char16_t kSqrChar = char16_t(0x221A);
@ -49,7 +49,7 @@ nsMathMLmrootFrame::Init(nsIContent* aContent,
nsPresContext *presContext = PresContext();
// No need to track the style context given to our MathML char.
// No need to track the ComputedStyle given to our MathML char.
// The Style System will use Get/SetAdditionalComputedStyle() to keep it
// up-to-date if dynamic changes arise.
nsAutoString sqrChar; sqrChar.Assign(kSqrChar);
@ -394,7 +394,8 @@ nsMathMLmrootFrame::GetIntrinsicISizeMetrics(gfxContext* aRenderingContext, Refl
}
// ----------------------
// the Style System will use these to pass the proper style context to our MathMLChar
// the Style System will use these to pass the proper ComputedStyle to our
// MathMLChar
ComputedStyle*
nsMathMLmrootFrame::GetAdditionalComputedStyle(int32_t aIndex) const
{

View File

@ -22,7 +22,7 @@
* have a defined ordering). Our display list is just one of a many possible linear
* representations of this ordering.
*
* Each time a frame changes (gets a new style context, or has a size/position
* Each time a frame changes (gets a new ComputedStyle, or has a size/position
* change), we schedule a paint (as we do currently), but also reord the frame that
* changed.
*

View File

@ -800,7 +800,7 @@ ConstructBorderRenderer(nsPresContext* aPresContext,
{
nsMargin border = aStyleBorder.GetComputedBorder();
// Get our style context's color struct.
// Get our ComputedStyle's color struct.
const nsStyleColor* ourColor = aComputedStyle->StyleColor();
// In NavQuirks mode we want to use the parent's context as a starting point
@ -903,8 +903,8 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
PrintAsStringNewline("++ PaintBorder");
// Check to see if we have an appearance defined. If so, we let the theme
// renderer draw the border. DO not get the data from aForFrame, since the passed in style context
// may be different! Always use |aComputedStyle|!
// renderer draw the border. DO not get the data from aForFrame, since the
// passed in ComputedStyle may be different! Always use |aComputedStyle|!
const nsStyleDisplay* displayData = aComputedStyle->StyleDisplay();
if (displayData->mAppearance) {
nsITheme *theme = aPresContext->GetTheme();
@ -1051,7 +1051,7 @@ nsCSSRendering::CreateBorderRendererForOutline(nsPresContext* aPresContext,
{
nscoord twipsRadii[8];
// Get our style context's color struct.
// Get our ComputedStyle's color struct.
const nsStyleOutline* ourOutline = aComputedStyle->StyleOutline();
if (!ourOutline->ShouldPaintOutline()) {
@ -1224,7 +1224,7 @@ nsCSSRendering::PaintFocus(nsPresContext* aPresContext,
// should not be used. Therefore, we provide a value that will
// be blatantly wrong if it ever does get used. (If this becomes
// something that CSS can style, this function will then have access
// to a style context and can use the same logic that PaintBorder
// to a ComputedStyle and can use the same logic that PaintBorder
// and PaintOutline do.)
//
// WebRender layers-free mode don't use PaintFocus function. Just assign
@ -1408,7 +1408,7 @@ nsCSSRendering::FindBackgroundStyleFrame(nsIFrame* aForFrame)
* and for SGML-based HTML documents only.
*
* |FindBackground| returns true if a background should be painted, and
* the resulting style context to use for the background information
* the resulting ComputedStyle to use for the background information
* will be filled in to |aBackground|.
*/
ComputedStyle*

View File

@ -1799,7 +1799,7 @@ nsDisplayListBuilder::IsAnimatedGeometryRoot(nsIFrame* aFrame,
// For SVG containers, they always have
// NS_FRAME_MAY_BE_TRANSFORMED bit. However, they would be
// affected by the fragement identifiers in the svgView form at
// runtime without a new style context.
// runtime without a new ComputedStyle.
// For example, layout/reftests/svg/fragmentIdentifier-01.xhtml
//
// see https://www.w3.org/TR/SVG/linking.html#SVGFragmentIdentifiers

View File

@ -32,11 +32,11 @@ getComputedStyle(a, "").marginTop;
// has been conditionally (on font size) cached on their shared rule node.
var b = document.getElementById("b");
// force style context construction and computation of the font struct on
// force ComputedStyle construction and computation of the font struct on
// B's parent
getComputedStyle(b.parentNode, "").fontSize;
// force style context construction (and computation of the color
// force ComputedStyle construction (and computation of the color
// struct) on B, but not the margin struct or font struct
getComputedStyle(b, "").color;

View File

@ -2,7 +2,7 @@
== basic-1.html basic-ref.html
== basic-2.html basic-ref.html
# parent style context correct
# parent ComputedStyle correct
== parent-style-1.html parent-style-1-ref.html
# others

View File

@ -7,7 +7,7 @@
== out-of-flow-1c.html out-of-flow-1-ref.html
== out-of-flow-1d.html out-of-flow-1-ref.html
# parent style context correct
# parent computed style correct
== parent-style-1.html parent-style-1-ref.html
== parent-style-2.html parent-style-2-ref.html
== parent-style-3.html parent-style-3-ref.html

View File

@ -39,17 +39,17 @@ MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(ServoComputedValuesMallocEnclosingSizeOf)
/**
* A ComputedStyle represents the computed style data for an element. The
* computed style data are stored in a set of structs (see nsStyleStruct.h) that
* are cached either on the style context or in the rule tree (see nsRuleNode.h
* are cached either on the ComputedStyle or in the rule tree (see nsRuleNode.h
* for a description of this caching and how the cached structs are shared).
*
* Since the data in |nsIStyleRule|s and |nsRuleNode|s are immutable (with a few
* exceptions, like system color changes), the data in an ComputedStyle are also
* immutable (with the additional exception of GetUniqueStyleData). When style
* data change, ElementRestyler::Restyle creates a new style context.
* data change, ElementRestyler::Restyle creates a new ComputedStyle.
*
* ComputedStyles are reference counted. References are generally held by:
* 1. the |nsIFrame|s that are using the style context and
* 2. any *child* style contexts (this might be the reverse of
* 1. the |nsIFrame|s that are using the ComputedStyle and
* 2. any *child* ComputedStyle (this might be the reverse of
* expectation, but it makes sense in this case)
*
* FIXME(emilio): This comment is somewhat outdated now.
@ -78,11 +78,11 @@ public:
void AddRef() { Servo_ComputedStyle_AddRef(this); }
void Release() { Servo_ComputedStyle_Release(this); }
// Return the style context whose style data should be used for the R,
// Return the ComputedStyle whose style data should be used for the R,
// G, and B components of color, background-color, and border-*-color
// if RelevantLinkIsVisited().
//
// GetPseudo() and GetPseudoType() on this style context return the
// GetPseudo() and GetPseudoType() on this ComputedStyle return the
// same as on |this|, and its depth in the tree (number of GetParent()
// calls until null is returned) is the same as |this|, since its
// parent is either |this|'s parent or |this|'s parent's
@ -132,7 +132,7 @@ public:
bool IsPseudoElement() const { return mPseudoTag && !IsAnonBox(); }
// Does this style context or any of its ancestors have text
// Does this ComputedStyle or any of its ancestors have text
// decoration lines?
// Differs from nsStyleTextReset::HasTextDecorationLines, which tests
// only the data for a single context.
@ -149,17 +149,17 @@ public:
bool ShouldSuppressLineBreak() const
{ return !!(mBits & NS_STYLE_SUPPRESS_LINEBREAK); }
// Does this style context or any of its ancestors have display:none set?
// Does this ComputedStyle or any of its ancestors have display:none set?
bool IsInDisplayNoneSubtree() const
{ return !!(mBits & NS_STYLE_IN_DISPLAY_NONE_SUBTREE); }
// Is this horizontal-in-vertical (tate-chu-yoko) text? This flag is
// only set on style contexts whose pseudo is nsCSSAnonBoxes::mozText.
// only set on ComputedStyles whose pseudo is nsCSSAnonBoxes::mozText.
bool IsTextCombined() const
{ return !!(mBits & NS_STYLE_IS_TEXT_COMBINED); }
// Does this style context represent the style for a pseudo-element or
// inherit data from such a style context? Whether this returns true
// Does this ComputedStyle represent the style for a pseudo-element or
// inherit data from such a ComputedStyle? Whether this returns true
// is equivalent to whether it or any of its ancestors returns
// non-null for IsPseudoElement().
bool HasPseudoElementData() const
@ -169,38 +169,38 @@ public:
{ return mBits & NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE; }
// Is the only link whose visitedness is allowed to influence the
// style of the node this style context is for (which is that element
// style of the node this ComputedStyle is for (which is that element
// or its nearest ancestor that is a link) visited?
bool RelevantLinkVisited() const
{ return !!(mBits & NS_STYLE_RELEVANT_LINK_VISITED); }
// Is this a style context for a link?
// Is this a ComputedStyle for a link?
inline bool IsLinkContext() const;
// Is this style context the GetStyleIfVisited() for some other style
// Is this ComputedStyle the GetStyleIfVisited() for some other style
// context?
bool IsStyleIfVisited() const
{ return !!(mBits & NS_STYLE_IS_STYLE_IF_VISITED); }
// Tells this style context that it should return true from
// Tells this ComputedStyle that it should return true from
// IsStyleIfVisited.
void SetIsStyleIfVisited()
{ mBits |= NS_STYLE_IS_STYLE_IF_VISITED; }
// Does any descendant of this style context have any style values
// that were computed based on this style context's ancestors?
// Does any descendant of this ComputedStyle have any style values
// that were computed based on this ComputedStyle's ancestors?
bool HasChildThatUsesGrandancestorStyle() const
{ return !!(mBits & NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE); }
// Is this style context shared with a sibling or cousin?
// Is this ComputedStyle shared with a sibling or cousin?
// (See nsStyleSet::GetContext.)
bool IsShared() const
{ return !!(mBits & NS_STYLE_IS_SHARED); }
/**
* Returns whether this style context has cached style data for a
* Returns whether this ComputedStyle has cached style data for a
* given style struct and it does NOT own that struct. This can
* happen because it was inherited from the parent style context, or
* happen because it was inherited from the parent ComputedStyle, or
* because it was stored conditionally on the rule node.
*/
bool HasCachedDependentStyleData(nsStyleStructID aSID) {
@ -273,7 +273,7 @@ public:
/**
* PeekStyle* is like Style* but doesn't trigger style
* computation if the data is not cached on either the style context
* computation if the data is not cached on either the ComputedStyle
* or the rule node.
*
* Perhaps this shouldn't be a public ComputedStyle API.
@ -327,7 +327,7 @@ public:
bool aLinkIsVisited);
/**
* Start the background image loads for this style context.
* Start the background image loads for this ComputedStyle.
*/
inline void StartBackgroundImageLoads();
@ -391,14 +391,14 @@ protected:
#undef STYLE_STRUCT_RESET
#undef STYLE_STRUCT_INHERITED
// If this style context is for a pseudo-element or anonymous box,
// If this ComputedStyle is for a pseudo-element or anonymous box,
// the relevant atom.
RefPtr<nsAtom> mPseudoTag;
// mBits stores a number of things:
// - It records (using the style struct bits) which structs are
// inherited from the parent context or owned by the rule node (i.e.,
// not owned by the style context).
// not owned by the ComputedStyle).
// - It also stores the additional bits listed at the top of
// nsStyleStruct.h.
uint64_t mBits;

View File

@ -74,7 +74,7 @@ StyleSetHandle::Ptr::EndUpdate()
FORWARD(EndUpdate, ());
}
// resolve a style context
// resolve a ComputedStyle
already_AddRefed<ComputedStyle>
StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement,
ComputedStyle* aParentStyle,

View File

@ -730,19 +730,19 @@ private:
nsCOMPtr<nsIContent> mContent;
/**
* Strong reference to the style context we access data from. This can be
* either a style context we resolved ourselves or a style context we got
* Strong reference to the ComputedStyle we access data from. This can be
* either a ComputedStyle we resolved ourselves or a ComputedStyle we got
* from our frame.
*
* If we got the style context from the frame, we clear out mComputedStyle
* If we got the ComputedStyle from the frame, we clear out mComputedStyle
* in ClearCurrentStyleSources. If we resolved one ourselves, then
* ClearCurrentStyleSources leaves it in mComputedStyle for use the next
* time this nsComputedDOMStyle object is queried. UpdateCurrentStyleSources
* in this case will check that the style context is still valid to be used,
* in this case will check that the ComputedStyle is still valid to be used,
* by checking whether flush styles results in any restyles having been
* processed.
*
* Since an ArenaRefPtr is used to hold the style context, it will be cleared
* Since an ArenaRefPtr is used to hold the ComputedStyle, it will be cleared
* if the pres arena from which it was allocated goes away.
*/
mozilla::ArenaRefPtr<mozilla::ComputedStyle> mComputedStyle;
@ -780,7 +780,7 @@ private:
bool mExposeVisitedStyle;
/**
* Whether we resolved a style context last time we called
* Whether we resolved a ComputedStyle last time we called
* UpdateCurrentStyleSources. Initially false.
*/
bool mResolvedComputedStyle;

View File

@ -4009,10 +4009,10 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
// changed.
// We do handle changes to transition-property, but we don't need to
// bother with anything here, since the transition manager is notified
// of any style context change anyway.
// of any ComputedStyle change anyway.
// Note: Likewise, for animation-*, the animation manager gets
// notified about every new style context constructed, and it uses
// notified about every new ComputedStyle constructed, and it uses
// that opportunity to handle dynamic changes appropriately.
// But we still need to return nsChangeHint_NeutralChange for these

View File

@ -93,7 +93,7 @@ class ImageTracker;
#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x400000000
// See ComputedStyle::IsTextCombined
#define NS_STYLE_IS_TEXT_COMBINED 0x800000000
// Whether a style context is a Gecko or Servo context
// Whether a ComputedStyle is a Gecko or Servo context
#define NS_STYLE_CONTEXT_IS_GECKO 0x1000000000
// See ComputedStyle::GetPseudoEnum
#define NS_STYLE_CONTEXT_TYPE_SHIFT 37
@ -1335,7 +1335,7 @@ protected:
/**
* An object that allows sharing of arrays that store 'quotes' property
* values. This is particularly important for inheritance, where we want
* to share the same 'quotes' value with a parent style context.
* to share the same 'quotes' value with a parent ComputedStyle.
*/
class nsStyleQuoteValues
{
@ -1610,7 +1610,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition
//
// They're effectively only different in this regard: mJustifyItems is set to
// mSpecifiedJustifyItems, except when the latter is AUTO -- in that case,
// mJustifyItems is set to NORMAL, or to the parent style context's
// mJustifyItems is set to NORMAL, or to the parent ComputedStyle's
// mJustifyItems if it has the legacy flag.
//
// This last part happens in ComputedStyle::ApplyStyleFixups.
@ -2671,7 +2671,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
/**
* The same as IsAbsPosContainingBlock, except skipping the tests that
* are based on the frame rather than the style context (thus
* are based on the frame rather than the ComputedStyle (thus
* potentially returning a false positive).
*
* FIXME(stylo-everywhere): Pretty sure the template can go here.
@ -2696,7 +2696,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
/**
* The same as IsFixedPosContainingBlock, except skipping the tests that
* are based on the frame rather than the style context (thus
* are based on the frame rather than the ComputedStyle (thus
* potentially returning a false positive).
*
* FIXME(stylo-everywhere): Pretty sure the template can go here.

View File

@ -147,7 +147,7 @@ ProcessTranslatePart(const nsCSSValue& aValue,
} else if (aValue.GetUnit() == eCSSUnit_Pixel ||
aValue.GetUnit() == eCSSUnit_Number) {
// Handle this here (even though nsRuleNode::CalcLength handles it
// fine) so that callers are allowed to pass a null style context
// fine) so that callers are allowed to pass a null ComputedStyle
// and pres context to SetToTransformFunction if they know (as
// StyleAnimationValue does) that all lengths within the transform
// function have already been computed to pixels and percents.

View File

@ -133,7 +133,7 @@ function testNodeThatHasParent(elem) {
function main() {
// Test the root node
// ==================
// (It's special because it has no parent style context.)
// (It's special because it has no parent ComputedStyle.)
var rootNode = document.documentElement;
@ -147,7 +147,7 @@ function main() {
// Test the body node
// ==================
// (It's special because it has no grandparent style context.)
// (It's special because it has no grandparent ComputedStyle.)
var body = document.getElementsByTagName("body")[0];
is(body.parentNode, document.documentElement,

View File

@ -24,7 +24,7 @@
SimpleTest.waitForExplicitFinish();
const utils = SpecialPowers.getDOMWindowUtils(window);
// TODO(emilio): Add an API to get the style contexts we've recreated, to make
// TODO(emilio): Add an API to get the ComputedStyles we've recreated, to make
// more elaborated tests.
document.documentElement.offsetTop;
const initialRestyleGeneration = utils.restyleGeneration;

View File

@ -138,7 +138,7 @@ nsTableFrame::GetParentComputedStyle(nsIFrame** aProviderFrame) const
NS_PRECONDITION(GetParent(), "table constructed without table wrapper");
if (!mContent->GetParent() && !Style()->GetPseudo()) {
// We're the root. We have no style context parent.
// We're the root. We have no ComputedStyle parent.
*aProviderFrame = nullptr;
return nullptr;
}
@ -733,7 +733,7 @@ nsTableFrame::AppendAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
int32_t lastIndex = startIndex + aNumColsToAdd - 1;
for (int32_t childX = startIndex; childX <= lastIndex; childX++) {
// all anonymous cols that we create here use a pseudo style context of the
// all anonymous cols that we create here use a pseudo ComputedStyle of the
// col group
nsIContent* iContent = aColGroupFrame->GetContent();
RefPtr<ComputedStyle> computedStyle = shell->StyleSet()->
@ -5107,7 +5107,7 @@ bool
nsTableFrame::BCRecalcNeeded(ComputedStyle* aOldComputedStyle,
ComputedStyle* aNewComputedStyle)
{
// Attention: the old style context is the one we're forgetting,
// Attention: the old ComputedStyle is the one we're forgetting,
// and hence possibly completely bogus for GetStyle* purposes.
// We use PeekStyleData instead.
@ -8202,7 +8202,7 @@ nsTableFrame::UpdateStyleOfOwnedAnonBoxesForTableWrapper(
nsChangeHint wrapperHint =
aWrapperFrame->Style()->CalcStyleDifference(newStyle, &equalStructs);
// CalcStyleDifference will handle caching structs on the new style context,
// CalcStyleDifference will handle caching structs on the new ComputedStyle,
// but only if we're not on a style worker thread.
MOZ_ASSERT(!ServoStyleSet::IsInServoTraversal(),
"if we can get in here from style worker threads, then we need "

View File

@ -216,14 +216,14 @@ ComputedStyle*
nsTableWrapperFrame::GetParentComputedStyle(nsIFrame** aProviderFrame) const
{
// The table wrapper frame and the (inner) table frame split the style
// data by giving the table frame the style context associated with
// the table content node and creating a style context for the wrapper
// frame that is a *child* of the table frame's style context,
// data by giving the table frame the ComputedStyle associated with
// the table content node and creating a ComputedStyle for the wrapper
// frame that is a *child* of the table frame's ComputedStyle,
// matching the ::-moz-table-wrapper pseudo-element. html.css has a
// rule that causes that pseudo-element (and thus the wrapper table)
// to inherit *some* style properties from the table frame. The
// children of the table inherit directly from the inner table, and
// the table wrapper's style context is a leaf.
// the table wrapper's ComputedStyle is a leaf.
return (*aProviderFrame = InnerTableFrame())->Style();
}

View File

@ -642,7 +642,8 @@ nsImageBoxFrame::CanOptimizeToImageLayer()
//
// DidSetComputedStyle
//
// When the style context changes, make sure that all of our image is up to date.
// When the ComputedStyle changes, make sure that all of our image is up to
// date.
//
/* virtual */ void
nsImageBoxFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle)

View File

@ -2057,7 +2057,7 @@ nsTreeBodyFrame::GetTwistyRect(int32_t aRowIndex,
ComputedStyle* aTwistyContext)
{
// The twisty rect extends all the way to the end of the cell. This is incorrect. We need to
// determine the twisty rect's true width. This is done by examining the style context for
// determine the twisty rect's true width. This is done by examining the ComputedStyle for
// a width first. If it has one, we use that. If it doesn't, we use the image's natural width.
// If the image hasn't loaded and if no width is specified, then we just bail. If there is
// a -moz-appearance involved, adjust the rect by the minimum widget size provided by
@ -2110,7 +2110,7 @@ nsTreeBodyFrame::GetImage(int32_t aRowIndex, nsTreeColumn* aCol, bool aUseContex
aAllowImageRegions = false;
}
else {
// Obtain the URL from the style context.
// Obtain the URL from the ComputedStyle.
aAllowImageRegions = true;
styleRequest = aComputedStyle->StyleList()->GetListStyleImage();
if (!styleRequest)
@ -2222,7 +2222,7 @@ nsRect nsTreeBodyFrame::GetImageSize(int32_t aRowIndex, nsTreeColumn* aCol, bool
// XXX We should respond to visibility rules for collapsed vs. hidden.
// This method returns the width of the twisty INCLUDING borders and padding.
// It first checks the style context for a width. If none is found, it tries to
// It first checks the ComputedStyle for a width. If none is found, it tries to
// use the default image width for the twisty. If no image is found, it defaults
// to border+padding.
nsRect r(0,0,0,0);

View File

@ -284,7 +284,7 @@ protected:
const nsRect& aDirtyRect,
nsPoint aPt);
// This method is called with a specific style context and rect to
// This method is called with a specific ComputedStyle and rect to
// paint the background rect as if it were a full-blown frame.
ImgDrawResult PaintBackgroundLayer(ComputedStyle* aComputedStyle,
nsPresContext* aPresContext,
@ -353,7 +353,7 @@ protected:
// Calculate the total width of our scrollable portion
nscoord CalcHorzWidth(const ScrollParts& aParts);
// Looks up a style context in the style cache. On a cache miss we resolve
// Looks up a ComputedStyle in the style cache. On a cache miss we resolve
// the pseudo-styles passed in and place them into the cache.
ComputedStyle* GetPseudoComputedStyle(nsICSSAnonBoxPseudo* aPseudoElement);
@ -574,19 +574,19 @@ protected: // Data Members
// from the view.
nsCOMPtr<nsITreeView> mView;
// A cache of all the style contexts we have seen for rows and cells of the tree. This is a mapping from
// a list of atoms to a corresponding style context. This cache stores every combination that
// A cache of all the ComputedStyles we have seen for rows and cells of the tree. This is a mapping from
// a list of atoms to a corresponding ComputedStyle. This cache stores every combination that
// occurs in the tree, so for n distinct properties, this cache could have 2 to the n entries
// (the power set of all row properties).
nsTreeStyleCache mStyleCache;
// A hashtable that maps from URLs to image request/listener pairs. The URL
// is provided by the view or by the style context. The style context
// is provided by the view or by the ComputedStyle. The ComputedStyle
// represents a resolved :-moz-tree-cell-image (or twisty) pseudo-element.
// It maps directly to an imgIRequest.
nsDataHashtable<nsStringHashKey, nsTreeImageCacheEntry> mImageCache;
// A scratch array used when looking up cached style contexts.
// A scratch array used when looking up cached ComputedStyles.
mozilla::AtomArray mScratchArray;
// The index of the first visible row and the # of rows visible onscreen.

View File

@ -32,7 +32,7 @@ nsTreeStyleCache::Transition::Hash() const
}
// The style context cache impl
// The ComputedStyle cache impl
ComputedStyle*
nsTreeStyleCache::GetComputedStyle(nsPresContext* aPresContext,
nsIContent* aContent,
@ -74,7 +74,7 @@ nsTreeStyleCache::GetComputedStyle(nsPresContext* aPresContext,
}
// We're in a final state.
// Look up our style context for this state.
// Look up our ComputedStyle for this state.
ComputedStyle* result = nullptr;
if (mCache) {
result = mCache->GetWeak(currState);
@ -85,7 +85,7 @@ nsTreeStyleCache::GetComputedStyle(nsPresContext* aPresContext,
ResolveXULTreePseudoStyle(aContent->AsElement(),
aPseudoElement, aStyle, aInputWord);
// Put the style context in our table, transferring the owning reference to the table.
// Put the ComputedStyle in our table, transferring the owning reference to the table.
if (!mCache) {
mCache = new ComputedStyleCache();
}

View File

@ -71,11 +71,11 @@ protected:
// under the key (S,i).
//
// Once the entire word has been consumed, the final state is used
// to reference the cache table to locate the style context.
// to reference the cache table to locate the ComputedStyle.
nsAutoPtr<TransitionTable> mTransitionTable;
// The cache of all active style contexts. This is a hash from
// a final state in the DFA, Sf, to the resultant style context.
// The cache of all active ComputedStyles. This is a hash from
// a final state in the DFA, Sf, to the resultant ComputedStyle.
typedef nsRefPtrHashtable<nsUint32HashKey, mozilla::ComputedStyle> ComputedStyleCache;
nsAutoPtr<ComputedStyleCache> mCache;