mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio
This commit is contained in:
parent
ee48bf82e0
commit
82ebebe276
@ -244,7 +244,7 @@ private:
|
|||||||
// When |aBackendType| is StyleBackendType::Gecko, we determine which
|
// When |aBackendType| is StyleBackendType::Gecko, we determine which
|
||||||
// properties are specified using the provided |aComputedStyle| and
|
// properties are specified using the provided |aComputedStyle| and
|
||||||
// |aElement| and |aPseudoType| are ignored. If |aComputedStyle| is nullptr,
|
// |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.
|
// (pseudo-)element.
|
||||||
//
|
//
|
||||||
// When |aBackendType| is StyleBackendType::Servo, we use the |StrongRuleNode|
|
// When |aBackendType| is StyleBackendType::Servo, we use the |StrongRuleNode|
|
||||||
|
@ -60,7 +60,7 @@ struct PropertyValuePair
|
|||||||
* overlapping shorthands/longhands, convert specified CSS values to computed
|
* overlapping shorthands/longhands, convert specified CSS values to computed
|
||||||
* values, etc.
|
* 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,
|
* per-property arrays from the original list of keyframes objects. As a result,
|
||||||
* these objects represent the master definition of the effect's values.
|
* these objects represent the master definition of the effect's values.
|
||||||
*/
|
*/
|
||||||
|
@ -1019,7 +1019,7 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
|
|||||||
// We should just store shorthands as-is (bug 1391537) and then return the
|
// 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
|
// 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
|
// 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.
|
// know what custom property values to provide.
|
||||||
RefPtr<ComputedStyle> computedStyle;
|
RefPtr<ComputedStyle> computedStyle;
|
||||||
if (isCSSAnimation) {
|
if (isCSSAnimation) {
|
||||||
|
@ -320,10 +320,10 @@ protected:
|
|||||||
// have changed, or when the target frame might have changed.
|
// have changed, or when the target frame might have changed.
|
||||||
void MaybeUpdateFrameForCompositor();
|
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
|
// 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
|
// 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.
|
// recursion.
|
||||||
already_AddRefed<ComputedStyle> GetTargetComputedStyle();
|
already_AddRefed<ComputedStyle> GetTargetComputedStyle();
|
||||||
|
|
||||||
|
@ -543,7 +543,7 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the computed -moz-binding directly from the style context
|
// Get the computed -moz-binding directly from the ComputedStyle
|
||||||
RefPtr<ComputedStyle> sc =
|
RefPtr<ComputedStyle> sc =
|
||||||
nsComputedDOMStyle::GetComputedStyleNoFlush(this, nullptr);
|
nsComputedDOMStyle::GetComputedStyleNoFlush(this, nullptr);
|
||||||
NS_ENSURE_TRUE(sc, false);
|
NS_ENSURE_TRUE(sc, false);
|
||||||
@ -581,7 +581,7 @@ Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
|||||||
return obj;
|
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.
|
// since that can destroy the relevant presshell.
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -443,7 +443,7 @@ CollectWindowReports(nsGlobalWindowInner *aWindow,
|
|||||||
"Memory used by CSS rule nodes within a window.");
|
"Memory used by CSS rule nodes within a window.");
|
||||||
|
|
||||||
REPORT_SIZE("/layout/style-contexts", mArenaSizes.mComputedStyles,
|
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
|
// 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
|
// only a few matter. Implement a cutoff so we don't bloat about:memory with
|
||||||
|
@ -2709,7 +2709,7 @@ GetFontStyleForServo(Element* aElement, const nsAString& aFont,
|
|||||||
ServoStyleSet* styleSet = aPresShell->StyleSet()->AsServo();
|
ServoStyleSet* styleSet = aPresShell->StyleSet()->AsServo();
|
||||||
|
|
||||||
RefPtr<ComputedStyle> parentStyle;
|
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.)
|
// values (2em, bolder, etc.)
|
||||||
if (aElement && aElement->IsInComposedDoc()) {
|
if (aElement && aElement->IsInComposedDoc()) {
|
||||||
parentStyle = nsComputedDOMStyle::GetComputedStyle(aElement, nullptr);
|
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
|
* 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,
|
* same value as previous could result in a different computed value,
|
||||||
* so we cannot have the optimization where we check if the new font
|
* so we cannot have the optimization where we check if the new font
|
||||||
* string is equal to the old one.
|
* string is equal to the old one.
|
||||||
@ -4351,7 +4351,7 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
|
|||||||
|
|
||||||
CanvasBidiProcessor processor;
|
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).
|
// (for now, at least; perhaps we need new Canvas API to control this).
|
||||||
processor.mTextRunFlags = canvasStyle
|
processor.mTextRunFlags = canvasStyle
|
||||||
? nsLayoutUtils::GetTextRunFlagsForStyle(canvasStyle,
|
? nsLayoutUtils::GetTextRunFlagsForStyle(canvasStyle,
|
||||||
|
@ -940,7 +940,7 @@ HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
|||||||
// WalkContentStyleRules so that this happens.) This violates the
|
// WalkContentStyleRules so that this happens.) This violates the
|
||||||
// nsIStyleRule contract, since it's the same style rule object doing
|
// nsIStyleRule contract, since it's the same style rule object doing
|
||||||
// the mapping in two different ways. It's also incorrect since it's
|
// 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
|
// which *element* it's matching (style rules should not stop matching
|
||||||
// when the display type is changed).
|
// when the display type is changed).
|
||||||
|
|
||||||
|
@ -732,7 +732,7 @@ ImageDocument::CreateSyntheticDocument()
|
|||||||
nsresult
|
nsresult
|
||||||
ImageDocument::CheckOverflowing(bool changeState)
|
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
|
* call RebuildStyleData. Also, holding onto pointers to the
|
||||||
* presentation through style resolution is potentially dangerous.
|
* presentation through style resolution is potentially dangerous.
|
||||||
*/
|
*/
|
||||||
|
@ -285,7 +285,7 @@
|
|||||||
document.documentElement.appendChild(link);
|
document.documentElement.appendChild(link);
|
||||||
navigator.serviceWorker.addEventListener("message", function onMessage(e) {
|
navigator.serviceWorker.addEventListener("message", function onMessage(e) {
|
||||||
if (e.data.data == "style") {
|
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);
|
navigator.serviceWorker.removeEventListener("message", onMessage);
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ nsSMILCSSProperty::GetBaseValue() const
|
|||||||
|
|
||||||
// SPECIAL CASE: (a) Shorthands
|
// SPECIAL CASE: (a) Shorthands
|
||||||
// (b) 'display'
|
// (b) 'display'
|
||||||
// (c) No base style context
|
// (c) No base ComputedStyle
|
||||||
if (nsCSSProps::IsShorthand(mPropID) ||
|
if (nsCSSProps::IsShorthand(mPropID) ||
|
||||||
mPropID == eCSSProperty_display ||
|
mPropID == eCSSProperty_display ||
|
||||||
!mBaseComputedStyle) {
|
!mBaseComputedStyle) {
|
||||||
@ -56,7 +56,7 @@ nsSMILCSSProperty::GetBaseValue() const
|
|||||||
// doing so involves clearing and resetting the property which can cause
|
// doing so involves clearing and resetting the property which can cause
|
||||||
// frames to be recreated which we'd like to avoid.
|
// 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.
|
// can't resolve a base value.
|
||||||
//
|
//
|
||||||
// In any case, just return a dummy value (initialized with the right
|
// In any case, just return a dummy value (initialized with the right
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
* Constructs a new nsSMILCSSProperty.
|
* Constructs a new nsSMILCSSProperty.
|
||||||
* @param aPropID The CSS property we're interested in animating.
|
* @param aPropID The CSS property we're interested in animating.
|
||||||
* @param aElement The element whose CSS property is being animated.
|
* @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
|
* value. If this is nullptr and GetBaseValue is
|
||||||
* called, an empty nsSMILValue initialized with
|
* called, an empty nsSMILValue initialized with
|
||||||
* the nsSMILCSSValueType will be returned.
|
* the nsSMILCSSValueType will be returned.
|
||||||
@ -79,7 +79,7 @@ protected:
|
|||||||
//
|
//
|
||||||
// As with mElement, since an nsISMILAttr only lives as long as the
|
// As with mElement, since an nsISMILAttr only lives as long as the
|
||||||
// compositing step and since ComposeAttribute holds an owning reference to
|
// 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;
|
mozilla::ComputedStyle* mBaseComputedStyle;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ nsSMILCompositor::ComposeAttribute(bool& aMightHavePendingStyleUpdates)
|
|||||||
if (!mKey.mElement)
|
if (!mKey.mElement)
|
||||||
return;
|
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.
|
// for initializing our nsISMILAttr with.
|
||||||
RefPtr<ComputedStyle> baseComputedStyle;
|
RefPtr<ComputedStyle> baseComputedStyle;
|
||||||
if (MightNeedBaseStyle()) {
|
if (MightNeedBaseStyle()) {
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
// Create a nsISMILAttr for my target, on the heap.
|
// 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.
|
// used when fetching the base style.
|
||||||
mozilla::UniquePtr<nsISMILAttr>
|
mozilla::UniquePtr<nsISMILAttr>
|
||||||
CreateSMILAttr(mozilla::ComputedStyle* aBaseComputedStyle);
|
CreateSMILAttr(mozilla::ComputedStyle* aBaseComputedStyle);
|
||||||
|
@ -279,7 +279,7 @@ SVGContentUtils::GetFontSize(Element *aElement)
|
|||||||
nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
|
nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
|
||||||
if (!computedStyle) {
|
if (!computedStyle) {
|
||||||
// ReportToConsole
|
// 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;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ SVGContentUtils::GetFontSize(nsIFrame *aFrame)
|
|||||||
float
|
float
|
||||||
SVGContentUtils::GetFontSize(ComputedStyle *aComputedStyle)
|
SVGContentUtils::GetFontSize(ComputedStyle *aComputedStyle)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aComputedStyle, "NULL style context in GetFontSize");
|
MOZ_ASSERT(aComputedStyle, "NULL ComputedStyle in GetFontSize");
|
||||||
|
|
||||||
nsPresContext *presContext = aComputedStyle->PresContext();
|
nsPresContext *presContext = aComputedStyle->PresContext();
|
||||||
MOZ_ASSERT(presContext, "NULL pres context in GetFontSize");
|
MOZ_ASSERT(presContext, "NULL pres context in GetFontSize");
|
||||||
@ -316,7 +316,7 @@ SVGContentUtils::GetFontXHeight(Element *aElement)
|
|||||||
nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
|
nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
|
||||||
if (!computedStyle) {
|
if (!computedStyle) {
|
||||||
// ReportToConsole
|
// 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;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ SVGContentUtils::GetFontXHeight(nsIFrame *aFrame)
|
|||||||
float
|
float
|
||||||
SVGContentUtils::GetFontXHeight(ComputedStyle *aComputedStyle)
|
SVGContentUtils::GetFontXHeight(ComputedStyle *aComputedStyle)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aComputedStyle, "NULL style context in GetFontXHeight");
|
MOZ_ASSERT(aComputedStyle, "NULL ComputedStyle in GetFontXHeight");
|
||||||
|
|
||||||
nsPresContext *presContext = aComputedStyle->PresContext();
|
nsPresContext *presContext = aComputedStyle->PresContext();
|
||||||
MOZ_ASSERT(presContext, "NULL pres context in GetFontXHeight");
|
MOZ_ASSERT(presContext, "NULL pres context in GetFontXHeight");
|
||||||
|
@ -150,7 +150,7 @@ SVGGeometryElement::GetFillRule()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// ReportToConsole
|
// ReportToConsole
|
||||||
NS_WARNING("Couldn't get style context for content in GetFillRule");
|
NS_WARNING("Couldn't get ComputedStyle for content in GetFillRule");
|
||||||
}
|
}
|
||||||
|
|
||||||
return fillRule;
|
return fillRule;
|
||||||
|
@ -4136,7 +4136,8 @@ EditorBase::IsPreformatted(nsIDOMNode* aNode,
|
|||||||
nsCOMPtr<nsIPresShell> ps = GetPresShell();
|
nsCOMPtr<nsIPresShell> ps = GetPresShell();
|
||||||
NS_ENSURE_TRUE(ps, NS_ERROR_NOT_INITIALIZED);
|
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;
|
RefPtr<ComputedStyle> elementStyle;
|
||||||
if (!content->IsElement()) {
|
if (!content->IsElement()) {
|
||||||
content = content->GetParent();
|
content = content->GetParent();
|
||||||
@ -4147,9 +4148,9 @@ EditorBase::IsPreformatted(nsIDOMNode* aNode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!elementStyle) {
|
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
|
// 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;
|
*aResult = false;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -4268,7 +4268,7 @@ PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush)
|
|||||||
// Now those constructors or events might have posted restyle
|
// Now those constructors or events might have posted restyle
|
||||||
// events. At the same time, we still need up-to-date style data.
|
// events. At the same time, we still need up-to-date style data.
|
||||||
// In particular, reflow depends on style being completely up to
|
// 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
|
// happen during reflow, might suddenly pick up the new rules and
|
||||||
// we'll end up with frames whose style doesn't match the frame
|
// we'll end up with frames whose style doesn't match the frame
|
||||||
// type.
|
// type.
|
||||||
@ -9722,7 +9722,7 @@ PresShell::ListComputedStyles(FILE *out, int32_t aIndent)
|
|||||||
rootFrame->Style()->List(out, 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();
|
Element* rootElement = mDocument->GetRootElement();
|
||||||
if (rootElement) {
|
if (rootElement) {
|
||||||
nsIFrame* rootElementFrame = rootElement->GetPrimaryFrame();
|
nsIFrame* rootElementFrame = rootElement->GetPrimaryFrame();
|
||||||
|
@ -166,7 +166,7 @@ enum nsChangeHint : uint32_t {
|
|||||||
/**
|
/**
|
||||||
* A hint reflecting that style data changed with no change handling
|
* A hint reflecting that style data changed with no change handling
|
||||||
* behavior. We need to return this, rather than nsChangeHint(0),
|
* 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.
|
* correct.
|
||||||
*
|
*
|
||||||
* nsChangeHint_NeutralChange must be returned by CalcDifference on a given
|
* 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
|
* Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process
|
||||||
* can stop processing at a frame when it detects no style changes and it is
|
* 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
|
* 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
|
* the old ComputedStyle 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.
|
* optimization on a frame, and to force its new ComputedStyle to be used.
|
||||||
*
|
*
|
||||||
* Similarly, eRestyle_ForceDescendants will cause the frame and all of its
|
* 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.
|
* to be set on the frames.
|
||||||
*
|
*
|
||||||
* NOTE: When adding new restyle hints, please also add them to
|
* NOTE: When adding new restyle hints, please also add them to
|
||||||
* RestyleManager::RestyleHintToString.
|
* RestyleManager::RestyleHintToString.
|
||||||
*/
|
*/
|
||||||
enum nsRestyleHint : uint32_t {
|
enum nsRestyleHint : uint32_t {
|
||||||
// Rerun selector matching on the element. If a new style context
|
// Rerun selector matching on the element. If a new ComputedStyle
|
||||||
// results, update the style contexts of descendants. (Irrelevant if
|
// results, update the ComputedStyles of descendants. (Irrelevant if
|
||||||
// eRestyle_Subtree is also set, since that implies a superset of the
|
// eRestyle_Subtree is also set, since that implies a superset of the
|
||||||
// work.)
|
// work.)
|
||||||
eRestyle_Self = 1 << 0,
|
eRestyle_Self = 1 << 0,
|
||||||
@ -574,24 +574,24 @@ enum nsRestyleHint : uint32_t {
|
|||||||
eRestyle_LaterSiblings = 1 << 3,
|
eRestyle_LaterSiblings = 1 << 3,
|
||||||
|
|
||||||
// Replace the style data coming from CSS transitions without updating
|
// 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
|
// contexts on the descendants. (Irrelevant if eRestyle_Self or
|
||||||
// eRestyle_Subtree is also set, since those imply a superset of the
|
// eRestyle_Subtree is also set, since those imply a superset of the
|
||||||
// work.)
|
// work.)
|
||||||
eRestyle_CSSTransitions = 1 << 4,
|
eRestyle_CSSTransitions = 1 << 4,
|
||||||
|
|
||||||
// Replace the style data coming from CSS animations without updating
|
// 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
|
// contexts on the descendants. (Irrelevant if eRestyle_Self or
|
||||||
// eRestyle_Subtree is also set, since those imply a superset of the
|
// eRestyle_Subtree is also set, since those imply a superset of the
|
||||||
// work.)
|
// work.)
|
||||||
eRestyle_CSSAnimations = 1 << 5,
|
eRestyle_CSSAnimations = 1 << 5,
|
||||||
|
|
||||||
// Replace the style data coming from inline style without updating
|
// 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
|
// contexts on the descendants. (Irrelevant if eRestyle_Self or
|
||||||
// eRestyle_Subtree is also set, since those imply a superset of the
|
// 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
|
// pseudo-elements or anonymous boxes, on which it converts to
|
||||||
// eRestyle_Self.
|
// eRestyle_Self.
|
||||||
// If the change is for the advance of a declarative animation, use
|
// If the change is for the advance of a declarative animation, use
|
||||||
|
@ -369,7 +369,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a frame which is the primary frame for an element,
|
* 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.
|
* the content.
|
||||||
* This is aPrimaryFrame itself except for tableWrapper frames.
|
* This is aPrimaryFrame itself except for tableWrapper frames.
|
||||||
*
|
*
|
||||||
@ -381,7 +381,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a content node,
|
* 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.
|
* the content. May return null.
|
||||||
* This is aContent->GetPrimaryFrame() except for tableWrapper frames.
|
* This is aContent->GetPrimaryFrame() except for tableWrapper frames.
|
||||||
*/
|
*/
|
||||||
@ -677,7 +677,7 @@ public:
|
|||||||
* attached to it; returns false otherwise.
|
* attached to it; returns false otherwise.
|
||||||
*
|
*
|
||||||
* @param aContent the content node we're looking at
|
* @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 aPseudoElement the id of the pseudo style we care about
|
||||||
* @param aPresContext the presentation context
|
* @param aPresContext the presentation context
|
||||||
* @return whether aContent has aPseudoElement style attached to it
|
* @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
|
* @param aRenderingContext Where to draw the image, set up with an
|
||||||
* appropriate scale and transform for drawing in
|
* appropriate scale and transform for drawing in
|
||||||
* app units.
|
* 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
|
* pseudo-element) for which this image is being
|
||||||
* drawn.
|
* drawn.
|
||||||
* @param aImage The image.
|
* @param aImage The image.
|
||||||
|
@ -98,7 +98,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears all currently registered ArenaRefPtrs for the given ArenaObjectID.
|
* 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
|
* pointing into the old rule tree aren't released afterwards, triggering an
|
||||||
* assertion in ~ComputedStyle.
|
* assertion in ~ComputedStyle.
|
||||||
*/
|
*/
|
||||||
|
@ -183,7 +183,7 @@ private:
|
|||||||
nsCOMPtr<Element> mThumbDiv;
|
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;
|
RefPtr<ComputedStyle> mOuterFocusStyle;
|
||||||
|
|
||||||
|
@ -36,9 +36,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=572649
|
|||||||
/** Test for Bug 572649 **/
|
/** Test for Bug 572649 **/
|
||||||
SimpleTest.waitForExplicitFinish();
|
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
|
// 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.expectAssertions(0, 2);
|
||||||
|
|
||||||
addLoadEvent(function() {
|
addLoadEvent(function() {
|
||||||
|
@ -2895,7 +2895,7 @@ ReflowInput::CalcLineHeight(nsIContent* aContent,
|
|||||||
nscoord aBlockBSize,
|
nscoord aBlockBSize,
|
||||||
float aFontSizeInflation)
|
float aFontSizeInflation)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aComputedStyle, "Must have a style context");
|
NS_PRECONDITION(aComputedStyle, "Must have a ComputedStyle");
|
||||||
|
|
||||||
nscoord lineHeight =
|
nscoord lineHeight =
|
||||||
ComputeLineHeight(aComputedStyle, aBlockBSize, aFontSizeInflation);
|
ComputeLineHeight(aComputedStyle, aBlockBSize, aFontSizeInflation);
|
||||||
|
@ -481,7 +481,7 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct writing mode based on a style context
|
* Construct writing mode based on a ComputedStyle.
|
||||||
*/
|
*/
|
||||||
explicit WritingMode(ComputedStyle* aComputedStyle)
|
explicit WritingMode(ComputedStyle* aComputedStyle)
|
||||||
{
|
{
|
||||||
|
@ -938,7 +938,7 @@ protected:
|
|||||||
// Remove and return the pushed floats list.
|
// Remove and return the pushed floats list.
|
||||||
nsFrameList* RemovePushedFloats();
|
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
|
// mozListBullet or mozListNumber. Passing in the style set is an
|
||||||
// optimization, because all callsites have it.
|
// optimization, because all callsites have it.
|
||||||
already_AddRefed<ComputedStyle> ResolveBulletStyle(
|
already_AddRefed<ComputedStyle> ResolveBulletStyle(
|
||||||
|
@ -148,7 +148,7 @@ nsBulletFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle)
|
|||||||
RegisterImageRequest(/* aKnownToBeAnimated = */ false);
|
RegisterImageRequest(/* aKnownToBeAnimated = */ false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No image request on the new style context.
|
// No image request on the new ComputedStyle.
|
||||||
DeregisterAndCancelImageRequest();
|
DeregisterAndCancelImageRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,9 +57,9 @@ nsFirstLetterFrame::Init(nsIContent* aContent,
|
|||||||
{
|
{
|
||||||
RefPtr<ComputedStyle> newSC;
|
RefPtr<ComputedStyle> newSC;
|
||||||
if (aPrevInFlow) {
|
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
|
// 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 =
|
nsIFrame* styleParent =
|
||||||
CorrectStyleParentFrame(aParent, nsCSSPseudoElements::firstLetter);
|
CorrectStyleParentFrame(aParent, nsCSSPseudoElements::firstLetter);
|
||||||
ComputedStyle* parentComputedStyle = styleParent->Style();
|
ComputedStyle* parentComputedStyle = styleParent->Style();
|
||||||
@ -321,11 +321,11 @@ nsFirstLetterFrame::CreateContinuationForFloatingParent(nsPresContext* aPresCont
|
|||||||
CreateContinuingFrame(aPresContext, aChild, parent, aIsFluid);
|
CreateContinuingFrame(aPresContext, aChild, parent, aIsFluid);
|
||||||
|
|
||||||
// The continuation will have gotten the first letter style from its
|
// 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.
|
// doesn't have the first letter styling.
|
||||||
//
|
//
|
||||||
// Note that getting parent frame's style context is different from getting
|
// Note that getting parent frame's ComputedStyle is different from getting
|
||||||
// this frame's style context's parent in the presence of ::first-line,
|
// this frame's ComputedStyle's parent in the presence of ::first-line,
|
||||||
// which we do want the continuation to inherit from.
|
// which we do want the continuation to inherit from.
|
||||||
ComputedStyle* parentSC = parent->Style();
|
ComputedStyle* parentSC = parent->Style();
|
||||||
if (parentSC) {
|
if (parentSC) {
|
||||||
@ -372,7 +372,7 @@ nsFirstLetterFrame::DrainOverflowFrames(nsPresContext* aPresContext)
|
|||||||
mFrames.AppendFrames(nullptr, *overflowFrames);
|
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
|
// one frame there is no point in doing any other ones until they
|
||||||
// are reflowed)
|
// are reflowed)
|
||||||
nsIFrame* kid = mFrames.FirstChild();
|
nsIFrame* kid = mFrames.FirstChild();
|
||||||
@ -411,7 +411,7 @@ nsFirstLetterFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
|
|||||||
{
|
{
|
||||||
if (GetPrevContinuation()) {
|
if (GetPrevContinuation()) {
|
||||||
// We shouldn't get calls to GetSkipSides for later continuations since
|
// 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,
|
// properties that could trigger a call to GetSkipSides. Then again,
|
||||||
// it's not really an error to call GetSkipSides on any frame, so
|
// it's not really an error to call GetSkipSides on any frame, so
|
||||||
// that's why we handle it properly.
|
// that's why we handle it properly.
|
||||||
|
@ -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
|
* other frame's |GetParentComputedStyle| methods can call this
|
||||||
* method on *another* frame. (This function handles out-of-flow
|
* method on *another* frame. (This function handles out-of-flow
|
||||||
* frames by using the frame manager's placeholder map and it also
|
* frames by using the frame manager's placeholder map and it also
|
||||||
* handles block-within-inline and generated content wrappers.)
|
* handles block-within-inline and generated content wrappers.)
|
||||||
*
|
*
|
||||||
* @param aProviderFrame (out) the frame associated with the returned value
|
* @param aProviderFrame (out) the frame associated with the returned value
|
||||||
* or null if the style context is for display:contents content.
|
* or null if the ComputedStyle is for display:contents content.
|
||||||
* @return The style context that should be the parent of this frame's
|
* @return The ComputedStyle that should be the parent of this frame's
|
||||||
* style context. Null is permitted, and means that this frame's
|
* ComputedStyle. Null is permitted, and means that this frame's
|
||||||
* style context should be the root of the style context tree.
|
* ComputedStyle should be the root of the ComputedStyle tree.
|
||||||
*/
|
*/
|
||||||
ComputedStyle* DoGetParentComputedStyle(nsIFrame** aProviderFrame) const;
|
ComputedStyle* DoGetParentComputedStyle(nsIFrame** aProviderFrame) const;
|
||||||
|
|
||||||
@ -556,7 +556,7 @@ public:
|
|||||||
const nsDisplayListSet& aLists);
|
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
|
* the child, given the pseudo-type of the prospective child. This handles
|
||||||
* things like walking out of table pseudos and so forth.
|
* things like walking out of table pseudos and so forth.
|
||||||
*
|
*
|
||||||
|
@ -264,8 +264,8 @@ FRAME_STATE_BIT(Generic, 53, NS_FRAME_IS_NONDISPLAY)
|
|||||||
// Frame has a LayerActivityProperty property
|
// Frame has a LayerActivityProperty property
|
||||||
FRAME_STATE_BIT(Generic, 54, NS_FRAME_HAS_LAYER_ACTIVITY_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
|
// Frame owns anonymous boxes whose ComputedStyles it will need to update
|
||||||
// a stylo tree traversal.
|
// during a stylo tree traversal.
|
||||||
FRAME_STATE_BIT(Generic, 55, NS_FRAME_OWNS_ANON_BOXES)
|
FRAME_STATE_BIT(Generic, 55, NS_FRAME_OWNS_ANON_BOXES)
|
||||||
|
|
||||||
// Frame maybe has a counter-reset/increment style
|
// Frame maybe has a counter-reset/increment style
|
||||||
|
@ -237,7 +237,7 @@ nsImageFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle)
|
|||||||
|
|
||||||
nsStyleImageOrientation newOrientation = StyleVisibility()->mImageOrientation;
|
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
|
// because this is the first time it's been set, or if the image-orientation
|
||||||
// property changed from its previous value.
|
// property changed from its previous value.
|
||||||
bool shouldUpdateOrientation =
|
bool shouldUpdateOrientation =
|
||||||
@ -2108,7 +2108,7 @@ nsImageFrame::GetCursor(const nsPoint& aPoint,
|
|||||||
nsCOMPtr<nsIContent> area = map->GetArea(p.x, p.y);
|
nsCOMPtr<nsIContent> area = map->GetArea(p.x, p.y);
|
||||||
if (area) {
|
if (area) {
|
||||||
// Use the cursor from the style of the *area* element.
|
// 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
|
// technically correct, but it's probably the right thing to do
|
||||||
// here, since it means that areas on which the cursor isn't
|
// here, since it means that areas on which the cursor isn't
|
||||||
// specified will inherit the style from the image.
|
// specified will inherit the style from the image.
|
||||||
|
@ -360,9 +360,9 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
const nsFrameList::Slice& newFrames =
|
const nsFrameList::Slice& newFrames =
|
||||||
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
|
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
|
||||||
// If our prev in flow was under the first continuation of a first-line
|
// 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
|
// 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.
|
// nsInlineFrame::ReflowFrames and nsInlineFrame::ReflowInlineFrame.
|
||||||
if (aReflowInput.mLineLayout->GetInFirstLine()) {
|
if (aReflowInput.mLineLayout->GetInFirstLine()) {
|
||||||
ReparentChildListStyle(aPresContext, newFrames, this);
|
ReparentChildListStyle(aPresContext, newFrames, this);
|
||||||
@ -960,12 +960,12 @@ nsInlineFrame::UpdateStyleOfOwnedAnonBoxesForIBSplit(
|
|||||||
ComputedStyle* ourStyle = Style();
|
ComputedStyle* ourStyle = Style();
|
||||||
|
|
||||||
// The anonymous block's style inherits from ours, and we already have our new
|
// The anonymous block's style inherits from ours, and we already have our new
|
||||||
// style context.
|
// ComputedStyle.
|
||||||
RefPtr<ComputedStyle> newContext =
|
RefPtr<ComputedStyle> newContext =
|
||||||
aRestyleState.StyleSet().ResolveInheritingAnonymousBoxStyle(
|
aRestyleState.StyleSet().ResolveInheritingAnonymousBoxStyle(
|
||||||
nsCSSAnonBoxes::mozBlockInsideInlineWrapper, ourStyle);
|
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
|
// the block in things they might inherit from us. And changehint processing
|
||||||
// guarantees walking the continuation and ib-sibling chains, so our existing
|
// 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
|
// 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() ==
|
MOZ_ASSERT(blockFrame->Style()->GetPseudo() ==
|
||||||
nsCSSAnonBoxes::mozBlockInsideInlineWrapper,
|
nsCSSAnonBoxes::mozBlockInsideInlineWrapper,
|
||||||
"Unexpected kind of style context");
|
"Unexpected kind of ComputedStyle");
|
||||||
|
|
||||||
// We don't want to just walk through using GetNextContinuationWithSameStyle
|
// 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.
|
// ib-sibling blocks and inlines.
|
||||||
for (nsIFrame* cont = blockFrame; cont; cont = cont->GetNextContinuation()) {
|
for (nsIFrame* cont = blockFrame; cont; cont = cont->GetNextContinuation()) {
|
||||||
cont->SetComputedStyle(newContext);
|
cont->SetComputedStyle(newContext);
|
||||||
@ -1026,12 +1026,12 @@ nsFirstLineFrame::Init(nsIContent* aContent,
|
|||||||
return;
|
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).
|
// is the first-in-flow (the only one with a ::first-line pseudo).
|
||||||
if (aPrevInFlow->Style()->GetPseudo() == nsCSSPseudoElements::firstLine) {
|
if (aPrevInFlow->Style()->GetPseudo() == nsCSSPseudoElements::firstLine) {
|
||||||
MOZ_ASSERT(FirstInFlow() == aPrevInFlow);
|
MOZ_ASSERT(FirstInFlow() == aPrevInFlow);
|
||||||
// Create a new style context that is a child of the parent
|
// Create a new ComputedStyle that is a child of the parent
|
||||||
// style context thus removing the ::first-line style. This way
|
// ComputedStyle thus removing the ::first-line style. This way
|
||||||
// we behave as if an anonymous (unstyled) span was the child
|
// we behave as if an anonymous (unstyled) span was the child
|
||||||
// of the parent frame.
|
// of the parent frame.
|
||||||
ComputedStyle* parentContext = aParent->Style();
|
ComputedStyle* parentContext = aParent->Style();
|
||||||
@ -1088,7 +1088,7 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
AutoFrameListPtr prevOverflowFrames(aPresContext,
|
AutoFrameListPtr prevOverflowFrames(aPresContext,
|
||||||
prevInFlow->StealOverflowFrames());
|
prevInFlow->StealOverflowFrames());
|
||||||
if (prevOverflowFrames) {
|
if (prevOverflowFrames) {
|
||||||
// Reparent the new frames and their style contexts.
|
// Reparent the new frames and their ComputedStyles.
|
||||||
const nsFrameList::Slice& newFrames =
|
const nsFrameList::Slice& newFrames =
|
||||||
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
|
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
|
||||||
ReparentChildListStyle(aPresContext, newFrames, this);
|
ReparentChildListStyle(aPresContext, newFrames, this);
|
||||||
|
@ -254,7 +254,7 @@ static const nsFrameState TEXT_WHITESPACE_FLAGS =
|
|||||||
* TEXT_IS_SIMPLE_FLOW and TEXT_MIGHT_HAVE_GLYPH_CHANGES 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
|
* 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
|
* Our convention is that unsigned integer character offsets are offsets into
|
||||||
* the transformed string. Signed integer character offsets are offsets into
|
* the transformed string. Signed integer character offsets are offsets into
|
||||||
|
@ -27,9 +27,9 @@ third line
|
|||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
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
|
// 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.expectAssertions(0, 2);
|
||||||
|
|
||||||
SimpleTest.waitForFocus(function test() {
|
SimpleTest.waitForFocus(function test() {
|
||||||
|
@ -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. */
|
We don't actually style -moz-math-anonymous by default. */
|
||||||
/*
|
/*
|
||||||
::-moz-math-anonymous {
|
::-moz-math-anonymous {
|
||||||
|
@ -761,7 +761,7 @@ nsMathMLChar::~nsMathMLChar()
|
|||||||
ComputedStyle*
|
ComputedStyle*
|
||||||
nsMathMLChar::GetComputedStyle() const
|
nsMathMLChar::GetComputedStyle() const
|
||||||
{
|
{
|
||||||
NS_ASSERTION(mComputedStyle, "chars should always have style context");
|
NS_ASSERTION(mComputedStyle, "chars should always have a ComputedStyle");
|
||||||
return mComputedStyle;
|
return mComputedStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -819,9 +819,9 @@ nsMathMLChar::SetData(nsString& aData)
|
|||||||
be in different fonts. For eg., the base size for '(' should
|
be in different fonts. For eg., the base size for '(' should
|
||||||
come from a normal ascii font if CMEX10 is used, since CMEX10
|
come from a normal ascii font if CMEX10 is used, since CMEX10
|
||||||
only contains the stretched versions. Hence, there are two
|
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
|
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
|
for normal rendering. So the parent context is the one used
|
||||||
to get the initial base size at the start of the pipeline.
|
to get the initial base size at the start of the pipeline.
|
||||||
b) For operators that can be largeop's in display mode,
|
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
|
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
|
container' size. We first search for larger variants using the glyph
|
||||||
table corresponding to the first existing font specified in the list of
|
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
|
mathml.css). Generic fonts are resolved by the preference
|
||||||
"font.mathfont-family".
|
"font.mathfont-family".
|
||||||
Issues :
|
Issues :
|
||||||
@ -1095,7 +1095,7 @@ StretchEnumContext::TryVariants(nsGlyphTable* aGlyphTable,
|
|||||||
RefPtr<gfxFontGroup>* aFontGroup,
|
RefPtr<gfxFontGroup>* aFontGroup,
|
||||||
const FontFamilyList& aFamilyList)
|
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;
|
ComputedStyle *sc = mChar->mComputedStyle;
|
||||||
nsFont font = sc->StyleFont()->mFont;
|
nsFont font = sc->StyleFont()->mFont;
|
||||||
NormalizeDefaultFont(font, mFontSizeInflation);
|
NormalizeDefaultFont(font, mFontSizeInflation);
|
||||||
@ -1241,7 +1241,7 @@ nsMathMLChar::StretchEnumContext::TryParts(nsGlyphTable* aGlyphTable,
|
|||||||
RefPtr<gfxFontGroup>* aFontGroup,
|
RefPtr<gfxFontGroup>* aFontGroup,
|
||||||
const FontFamilyList& aFamilyList)
|
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;
|
nsFont font = mChar->mComputedStyle->StyleFont()->mFont;
|
||||||
NormalizeDefaultFont(font, mFontSizeInflation);
|
NormalizeDefaultFont(font, mFontSizeInflation);
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ public:
|
|||||||
|
|
||||||
// Metrics that _exactly_ enclose the char. The char *must* have *already*
|
// Metrics that _exactly_ enclose the char. The char *must* have *already*
|
||||||
// being stretched before you can call the GetBoundingMetrics() method.
|
// 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
|
// with glyphs that are not in the parent font, just calling the default
|
||||||
// aRenderingContext.GetBoundingMetrics(aChar) can give incorrect results.
|
// aRenderingContext.GetBoundingMetrics(aChar) can give incorrect results.
|
||||||
void
|
void
|
||||||
@ -189,7 +189,7 @@ public:
|
|||||||
mBoundingMetrics = aBoundingMetrics;
|
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
|
// They provide an interface to make them accessible to the Style System via
|
||||||
// the Get/Set AdditionalComputedStyle() APIs. Owners of MathMLChars
|
// the Get/Set AdditionalComputedStyle() APIs. Owners of MathMLChars
|
||||||
// should honor these APIs.
|
// should honor these APIs.
|
||||||
|
@ -90,9 +90,9 @@ nsMathMLFrame::UpdatePresentationData(uint32_t aFlagsValues,
|
|||||||
return NS_OK;
|
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
|
// 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.
|
// the Style System via the Get/Set AdditionalComputedStyle() APIs.
|
||||||
/* static */ void
|
/* static */ void
|
||||||
nsMathMLFrame::ResolveMathMLCharStyle(nsPresContext* aPresContext,
|
nsMathMLFrame::ResolveMathMLCharStyle(nsPresContext* aPresContext,
|
||||||
|
@ -104,8 +104,8 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper to give a style context suitable for doing the stretching to the
|
// helper to give a ComputedStyle suitable for doing the stretching to the
|
||||||
// MathMLChar. Frame classes that use this should make the extra style contexts
|
// MathMLChar. Frame classes that use this should make the extra ComputedStyle
|
||||||
// accessible to the Style System via Get/Set AdditionalmComputedStyle.
|
// accessible to the Style System via Get/Set AdditionalmComputedStyle.
|
||||||
static void
|
static void
|
||||||
ResolveMathMLCharStyle(nsPresContext* aPresContext,
|
ResolveMathMLCharStyle(nsPresContext* aPresContext,
|
||||||
|
@ -65,7 +65,7 @@ nsresult nsMathMLmencloseFrame::AllocateMathMLChar(nsMencloseNotation mask)
|
|||||||
(mask == NOTATION_RADICAL && mRadicalCharIndex >= 0))
|
(mask == NOTATION_RADICAL && mRadicalCharIndex >= 0))
|
||||||
return NS_OK;
|
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
|
// The Style System will use Get/SetAdditionalComputedStyle() to keep it
|
||||||
// up-to-date if dynamic changes arise.
|
// up-to-date if dynamic changes arise.
|
||||||
uint32_t i = mMathMLChar.Length();
|
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
|
// MathMLChar
|
||||||
ComputedStyle*
|
ComputedStyle*
|
||||||
nsMathMLmencloseFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
nsMathMLmencloseFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
||||||
|
@ -56,7 +56,7 @@ nsMathMLmfencedFrame::SetInitialChildList(ChildListID aListID,
|
|||||||
// frame, so initialize NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY for
|
// frame, so initialize NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY for
|
||||||
// GetPreferredStretchSize() from Reflow().
|
// GetPreferredStretchSize() from Reflow().
|
||||||
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
|
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
|
// The Style System will use Get/SetAdditionalComputedStyle() to keep them
|
||||||
// up-to-date if dynamic changes arise.
|
// up-to-date if dynamic changes arise.
|
||||||
CreateFencesAndSeparators(PresContext());
|
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*
|
ComputedStyle*
|
||||||
nsMathMLmfencedFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
nsMathMLmfencedFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
// <mo> -- operator, fence, or separator - implementation
|
// <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
|
#define NS_MATHML_CHAR_STYLE_CONTEXT_INDEX 0
|
||||||
|
|
||||||
nsIFrame*
|
nsIFrame*
|
||||||
@ -943,7 +943,7 @@ nsMathMLmoFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
|
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
|
// it is safer to just process the whole lot here
|
||||||
ProcessOperatorData();
|
ProcessOperatorData();
|
||||||
|
|
||||||
@ -1091,8 +1091,8 @@ nsMathMLmoFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------
|
// ----------------------
|
||||||
// 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 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*
|
ComputedStyle*
|
||||||
nsMathMLmoFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
nsMathMLmoFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ using namespace mozilla;
|
|||||||
// <mroot> -- form a radical - implementation
|
// <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
|
#define NS_SQR_CHAR_STYLE_CONTEXT_INDEX 0
|
||||||
|
|
||||||
static const char16_t kSqrChar = char16_t(0x221A);
|
static const char16_t kSqrChar = char16_t(0x221A);
|
||||||
@ -49,7 +49,7 @@ nsMathMLmrootFrame::Init(nsIContent* aContent,
|
|||||||
|
|
||||||
nsPresContext *presContext = PresContext();
|
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
|
// The Style System will use Get/SetAdditionalComputedStyle() to keep it
|
||||||
// up-to-date if dynamic changes arise.
|
// up-to-date if dynamic changes arise.
|
||||||
nsAutoString sqrChar; sqrChar.Assign(kSqrChar);
|
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*
|
ComputedStyle*
|
||||||
nsMathMLmrootFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
nsMathMLmrootFrame::GetAdditionalComputedStyle(int32_t aIndex) const
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
* have a defined ordering). Our display list is just one of a many possible linear
|
* have a defined ordering). Our display list is just one of a many possible linear
|
||||||
* representations of this ordering.
|
* 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
|
* change), we schedule a paint (as we do currently), but also reord the frame that
|
||||||
* changed.
|
* changed.
|
||||||
*
|
*
|
||||||
|
@ -800,7 +800,7 @@ ConstructBorderRenderer(nsPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
nsMargin border = aStyleBorder.GetComputedBorder();
|
nsMargin border = aStyleBorder.GetComputedBorder();
|
||||||
|
|
||||||
// Get our style context's color struct.
|
// Get our ComputedStyle's color struct.
|
||||||
const nsStyleColor* ourColor = aComputedStyle->StyleColor();
|
const nsStyleColor* ourColor = aComputedStyle->StyleColor();
|
||||||
|
|
||||||
// In NavQuirks mode we want to use the parent's context as a starting point
|
// 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");
|
PrintAsStringNewline("++ PaintBorder");
|
||||||
|
|
||||||
// Check to see if we have an appearance defined. If so, we let the theme
|
// 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
|
// renderer draw the border. DO not get the data from aForFrame, since the
|
||||||
// may be different! Always use |aComputedStyle|!
|
// passed in ComputedStyle may be different! Always use |aComputedStyle|!
|
||||||
const nsStyleDisplay* displayData = aComputedStyle->StyleDisplay();
|
const nsStyleDisplay* displayData = aComputedStyle->StyleDisplay();
|
||||||
if (displayData->mAppearance) {
|
if (displayData->mAppearance) {
|
||||||
nsITheme *theme = aPresContext->GetTheme();
|
nsITheme *theme = aPresContext->GetTheme();
|
||||||
@ -1051,7 +1051,7 @@ nsCSSRendering::CreateBorderRendererForOutline(nsPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
nscoord twipsRadii[8];
|
nscoord twipsRadii[8];
|
||||||
|
|
||||||
// Get our style context's color struct.
|
// Get our ComputedStyle's color struct.
|
||||||
const nsStyleOutline* ourOutline = aComputedStyle->StyleOutline();
|
const nsStyleOutline* ourOutline = aComputedStyle->StyleOutline();
|
||||||
|
|
||||||
if (!ourOutline->ShouldPaintOutline()) {
|
if (!ourOutline->ShouldPaintOutline()) {
|
||||||
@ -1224,7 +1224,7 @@ nsCSSRendering::PaintFocus(nsPresContext* aPresContext,
|
|||||||
// should not be used. Therefore, we provide a value that will
|
// should not be used. Therefore, we provide a value that will
|
||||||
// be blatantly wrong if it ever does get used. (If this becomes
|
// be blatantly wrong if it ever does get used. (If this becomes
|
||||||
// something that CSS can style, this function will then have access
|
// 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.)
|
// and PaintOutline do.)
|
||||||
//
|
//
|
||||||
// WebRender layers-free mode don't use PaintFocus function. Just assign
|
// 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.
|
* and for SGML-based HTML documents only.
|
||||||
*
|
*
|
||||||
* |FindBackground| returns true if a background should be painted, and
|
* |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|.
|
* will be filled in to |aBackground|.
|
||||||
*/
|
*/
|
||||||
ComputedStyle*
|
ComputedStyle*
|
||||||
|
@ -1799,7 +1799,7 @@ nsDisplayListBuilder::IsAnimatedGeometryRoot(nsIFrame* aFrame,
|
|||||||
// For SVG containers, they always have
|
// For SVG containers, they always have
|
||||||
// NS_FRAME_MAY_BE_TRANSFORMED bit. However, they would be
|
// NS_FRAME_MAY_BE_TRANSFORMED bit. However, they would be
|
||||||
// affected by the fragement identifiers in the svgView form at
|
// 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
|
// For example, layout/reftests/svg/fragmentIdentifier-01.xhtml
|
||||||
//
|
//
|
||||||
// see https://www.w3.org/TR/SVG/linking.html#SVGFragmentIdentifiers
|
// see https://www.w3.org/TR/SVG/linking.html#SVGFragmentIdentifiers
|
||||||
|
@ -32,11 +32,11 @@ getComputedStyle(a, "").marginTop;
|
|||||||
// has been conditionally (on font size) cached on their shared rule node.
|
// has been conditionally (on font size) cached on their shared rule node.
|
||||||
var b = document.getElementById("b");
|
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
|
// B's parent
|
||||||
getComputedStyle(b.parentNode, "").fontSize;
|
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
|
// struct) on B, but not the margin struct or font struct
|
||||||
getComputedStyle(b, "").color;
|
getComputedStyle(b, "").color;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
== basic-1.html basic-ref.html
|
== basic-1.html basic-ref.html
|
||||||
== basic-2.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
|
== parent-style-1.html parent-style-1-ref.html
|
||||||
|
|
||||||
# others
|
# others
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
== out-of-flow-1c.html out-of-flow-1-ref.html
|
== out-of-flow-1c.html out-of-flow-1-ref.html
|
||||||
== out-of-flow-1d.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-1.html parent-style-1-ref.html
|
||||||
== parent-style-2.html parent-style-2-ref.html
|
== parent-style-2.html parent-style-2-ref.html
|
||||||
== parent-style-3.html parent-style-3-ref.html
|
== parent-style-3.html parent-style-3-ref.html
|
||||||
|
@ -39,17 +39,17 @@ MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(ServoComputedValuesMallocEnclosingSizeOf)
|
|||||||
/**
|
/**
|
||||||
* A ComputedStyle represents the computed style data for an element. The
|
* 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
|
* 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).
|
* 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
|
* 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
|
* exceptions, like system color changes), the data in an ComputedStyle are also
|
||||||
* immutable (with the additional exception of GetUniqueStyleData). When style
|
* 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:
|
* ComputedStyles are reference counted. References are generally held by:
|
||||||
* 1. the |nsIFrame|s that are using the style context and
|
* 1. the |nsIFrame|s that are using the ComputedStyle and
|
||||||
* 2. any *child* style contexts (this might be the reverse of
|
* 2. any *child* ComputedStyle (this might be the reverse of
|
||||||
* expectation, but it makes sense in this case)
|
* expectation, but it makes sense in this case)
|
||||||
*
|
*
|
||||||
* FIXME(emilio): This comment is somewhat outdated now.
|
* FIXME(emilio): This comment is somewhat outdated now.
|
||||||
@ -78,11 +78,11 @@ public:
|
|||||||
void AddRef() { Servo_ComputedStyle_AddRef(this); }
|
void AddRef() { Servo_ComputedStyle_AddRef(this); }
|
||||||
void Release() { Servo_ComputedStyle_Release(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
|
// G, and B components of color, background-color, and border-*-color
|
||||||
// if RelevantLinkIsVisited().
|
// 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()
|
// 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
|
// calls until null is returned) is the same as |this|, since its
|
||||||
// parent is either |this|'s parent or |this|'s parent's
|
// parent is either |this|'s parent or |this|'s parent's
|
||||||
@ -132,7 +132,7 @@ public:
|
|||||||
bool IsPseudoElement() const { return mPseudoTag && !IsAnonBox(); }
|
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?
|
// decoration lines?
|
||||||
// Differs from nsStyleTextReset::HasTextDecorationLines, which tests
|
// Differs from nsStyleTextReset::HasTextDecorationLines, which tests
|
||||||
// only the data for a single context.
|
// only the data for a single context.
|
||||||
@ -149,17 +149,17 @@ public:
|
|||||||
bool ShouldSuppressLineBreak() const
|
bool ShouldSuppressLineBreak() const
|
||||||
{ return !!(mBits & NS_STYLE_SUPPRESS_LINEBREAK); }
|
{ 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
|
bool IsInDisplayNoneSubtree() const
|
||||||
{ return !!(mBits & NS_STYLE_IN_DISPLAY_NONE_SUBTREE); }
|
{ return !!(mBits & NS_STYLE_IN_DISPLAY_NONE_SUBTREE); }
|
||||||
|
|
||||||
// Is this horizontal-in-vertical (tate-chu-yoko) text? This flag is
|
// 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
|
bool IsTextCombined() const
|
||||||
{ return !!(mBits & NS_STYLE_IS_TEXT_COMBINED); }
|
{ return !!(mBits & NS_STYLE_IS_TEXT_COMBINED); }
|
||||||
|
|
||||||
// Does this style context represent the style for a pseudo-element or
|
// Does this ComputedStyle represent the style for a pseudo-element or
|
||||||
// inherit data from such a style context? Whether this returns true
|
// inherit data from such a ComputedStyle? Whether this returns true
|
||||||
// is equivalent to whether it or any of its ancestors returns
|
// is equivalent to whether it or any of its ancestors returns
|
||||||
// non-null for IsPseudoElement().
|
// non-null for IsPseudoElement().
|
||||||
bool HasPseudoElementData() const
|
bool HasPseudoElementData() const
|
||||||
@ -169,38 +169,38 @@ public:
|
|||||||
{ return mBits & NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE; }
|
{ return mBits & NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE; }
|
||||||
|
|
||||||
// Is the only link whose visitedness is allowed to influence the
|
// 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?
|
// or its nearest ancestor that is a link) visited?
|
||||||
bool RelevantLinkVisited() const
|
bool RelevantLinkVisited() const
|
||||||
{ return !!(mBits & NS_STYLE_RELEVANT_LINK_VISITED); }
|
{ 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;
|
inline bool IsLinkContext() const;
|
||||||
|
|
||||||
// Is this style context the GetStyleIfVisited() for some other style
|
// Is this ComputedStyle the GetStyleIfVisited() for some other style
|
||||||
// context?
|
// context?
|
||||||
bool IsStyleIfVisited() const
|
bool IsStyleIfVisited() const
|
||||||
{ return !!(mBits & NS_STYLE_IS_STYLE_IF_VISITED); }
|
{ 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.
|
// IsStyleIfVisited.
|
||||||
void SetIsStyleIfVisited()
|
void SetIsStyleIfVisited()
|
||||||
{ mBits |= NS_STYLE_IS_STYLE_IF_VISITED; }
|
{ mBits |= NS_STYLE_IS_STYLE_IF_VISITED; }
|
||||||
|
|
||||||
// Does any descendant of this style context have any style values
|
// Does any descendant of this ComputedStyle have any style values
|
||||||
// that were computed based on this style context's ancestors?
|
// that were computed based on this ComputedStyle's ancestors?
|
||||||
bool HasChildThatUsesGrandancestorStyle() const
|
bool HasChildThatUsesGrandancestorStyle() const
|
||||||
{ return !!(mBits & NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE); }
|
{ 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.)
|
// (See nsStyleSet::GetContext.)
|
||||||
bool IsShared() const
|
bool IsShared() const
|
||||||
{ return !!(mBits & NS_STYLE_IS_SHARED); }
|
{ 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
|
* 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.
|
* because it was stored conditionally on the rule node.
|
||||||
*/
|
*/
|
||||||
bool HasCachedDependentStyleData(nsStyleStructID aSID) {
|
bool HasCachedDependentStyleData(nsStyleStructID aSID) {
|
||||||
@ -273,7 +273,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* PeekStyle* is like Style* but doesn't trigger style
|
* 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.
|
* or the rule node.
|
||||||
*
|
*
|
||||||
* Perhaps this shouldn't be a public ComputedStyle API.
|
* Perhaps this shouldn't be a public ComputedStyle API.
|
||||||
@ -327,7 +327,7 @@ public:
|
|||||||
bool aLinkIsVisited);
|
bool aLinkIsVisited);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start the background image loads for this style context.
|
* Start the background image loads for this ComputedStyle.
|
||||||
*/
|
*/
|
||||||
inline void StartBackgroundImageLoads();
|
inline void StartBackgroundImageLoads();
|
||||||
|
|
||||||
@ -391,14 +391,14 @@ protected:
|
|||||||
#undef STYLE_STRUCT_RESET
|
#undef STYLE_STRUCT_RESET
|
||||||
#undef STYLE_STRUCT_INHERITED
|
#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.
|
// the relevant atom.
|
||||||
RefPtr<nsAtom> mPseudoTag;
|
RefPtr<nsAtom> mPseudoTag;
|
||||||
|
|
||||||
// mBits stores a number of things:
|
// mBits stores a number of things:
|
||||||
// - It records (using the style struct bits) which structs are
|
// - It records (using the style struct bits) which structs are
|
||||||
// inherited from the parent context or owned by the rule node (i.e.,
|
// 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
|
// - It also stores the additional bits listed at the top of
|
||||||
// nsStyleStruct.h.
|
// nsStyleStruct.h.
|
||||||
uint64_t mBits;
|
uint64_t mBits;
|
||||||
|
@ -74,7 +74,7 @@ StyleSetHandle::Ptr::EndUpdate()
|
|||||||
FORWARD(EndUpdate, ());
|
FORWARD(EndUpdate, ());
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolve a style context
|
// resolve a ComputedStyle
|
||||||
already_AddRefed<ComputedStyle>
|
already_AddRefed<ComputedStyle>
|
||||||
StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement,
|
StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement,
|
||||||
ComputedStyle* aParentStyle,
|
ComputedStyle* aParentStyle,
|
||||||
|
@ -730,19 +730,19 @@ private:
|
|||||||
nsCOMPtr<nsIContent> mContent;
|
nsCOMPtr<nsIContent> mContent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong reference to the style context we access data from. This can be
|
* Strong reference to the ComputedStyle we access data from. This can be
|
||||||
* either a style context we resolved ourselves or a style context we got
|
* either a ComputedStyle we resolved ourselves or a ComputedStyle we got
|
||||||
* from our frame.
|
* 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
|
* in ClearCurrentStyleSources. If we resolved one ourselves, then
|
||||||
* ClearCurrentStyleSources leaves it in mComputedStyle for use the next
|
* ClearCurrentStyleSources leaves it in mComputedStyle for use the next
|
||||||
* time this nsComputedDOMStyle object is queried. UpdateCurrentStyleSources
|
* 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
|
* by checking whether flush styles results in any restyles having been
|
||||||
* processed.
|
* 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.
|
* if the pres arena from which it was allocated goes away.
|
||||||
*/
|
*/
|
||||||
mozilla::ArenaRefPtr<mozilla::ComputedStyle> mComputedStyle;
|
mozilla::ArenaRefPtr<mozilla::ComputedStyle> mComputedStyle;
|
||||||
@ -780,7 +780,7 @@ private:
|
|||||||
bool mExposeVisitedStyle;
|
bool mExposeVisitedStyle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether we resolved a style context last time we called
|
* Whether we resolved a ComputedStyle last time we called
|
||||||
* UpdateCurrentStyleSources. Initially false.
|
* UpdateCurrentStyleSources. Initially false.
|
||||||
*/
|
*/
|
||||||
bool mResolvedComputedStyle;
|
bool mResolvedComputedStyle;
|
||||||
|
@ -4009,10 +4009,10 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
|
|||||||
// changed.
|
// changed.
|
||||||
// We do handle changes to transition-property, but we don't need to
|
// We do handle changes to transition-property, but we don't need to
|
||||||
// bother with anything here, since the transition manager is notified
|
// 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
|
// 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.
|
// that opportunity to handle dynamic changes appropriately.
|
||||||
|
|
||||||
// But we still need to return nsChangeHint_NeutralChange for these
|
// But we still need to return nsChangeHint_NeutralChange for these
|
||||||
|
@ -93,7 +93,7 @@ class ImageTracker;
|
|||||||
#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x400000000
|
#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x400000000
|
||||||
// See ComputedStyle::IsTextCombined
|
// See ComputedStyle::IsTextCombined
|
||||||
#define NS_STYLE_IS_TEXT_COMBINED 0x800000000
|
#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
|
#define NS_STYLE_CONTEXT_IS_GECKO 0x1000000000
|
||||||
// See ComputedStyle::GetPseudoEnum
|
// See ComputedStyle::GetPseudoEnum
|
||||||
#define NS_STYLE_CONTEXT_TYPE_SHIFT 37
|
#define NS_STYLE_CONTEXT_TYPE_SHIFT 37
|
||||||
@ -1335,7 +1335,7 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* An object that allows sharing of arrays that store 'quotes' property
|
* An object that allows sharing of arrays that store 'quotes' property
|
||||||
* values. This is particularly important for inheritance, where we want
|
* 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
|
class nsStyleQuoteValues
|
||||||
{
|
{
|
||||||
@ -1610,7 +1610,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition
|
|||||||
//
|
//
|
||||||
// They're effectively only different in this regard: mJustifyItems is set to
|
// They're effectively only different in this regard: mJustifyItems is set to
|
||||||
// mSpecifiedJustifyItems, except when the latter is AUTO -- in that case,
|
// 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.
|
// mJustifyItems if it has the legacy flag.
|
||||||
//
|
//
|
||||||
// This last part happens in ComputedStyle::ApplyStyleFixups.
|
// 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
|
* 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).
|
* potentially returning a false positive).
|
||||||
*
|
*
|
||||||
* FIXME(stylo-everywhere): Pretty sure the template can go here.
|
* 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
|
* 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).
|
* potentially returning a false positive).
|
||||||
*
|
*
|
||||||
* FIXME(stylo-everywhere): Pretty sure the template can go here.
|
* FIXME(stylo-everywhere): Pretty sure the template can go here.
|
||||||
|
@ -147,7 +147,7 @@ ProcessTranslatePart(const nsCSSValue& aValue,
|
|||||||
} else if (aValue.GetUnit() == eCSSUnit_Pixel ||
|
} else if (aValue.GetUnit() == eCSSUnit_Pixel ||
|
||||||
aValue.GetUnit() == eCSSUnit_Number) {
|
aValue.GetUnit() == eCSSUnit_Number) {
|
||||||
// Handle this here (even though nsRuleNode::CalcLength handles it
|
// 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
|
// and pres context to SetToTransformFunction if they know (as
|
||||||
// StyleAnimationValue does) that all lengths within the transform
|
// StyleAnimationValue does) that all lengths within the transform
|
||||||
// function have already been computed to pixels and percents.
|
// function have already been computed to pixels and percents.
|
||||||
|
@ -133,7 +133,7 @@ function testNodeThatHasParent(elem) {
|
|||||||
function main() {
|
function main() {
|
||||||
// Test the root node
|
// 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;
|
var rootNode = document.documentElement;
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ function main() {
|
|||||||
|
|
||||||
// Test the body node
|
// 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];
|
var body = document.getElementsByTagName("body")[0];
|
||||||
is(body.parentNode, document.documentElement,
|
is(body.parentNode, document.documentElement,
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
const utils = SpecialPowers.getDOMWindowUtils(window);
|
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.
|
// more elaborated tests.
|
||||||
document.documentElement.offsetTop;
|
document.documentElement.offsetTop;
|
||||||
const initialRestyleGeneration = utils.restyleGeneration;
|
const initialRestyleGeneration = utils.restyleGeneration;
|
||||||
|
@ -138,7 +138,7 @@ nsTableFrame::GetParentComputedStyle(nsIFrame** aProviderFrame) const
|
|||||||
|
|
||||||
NS_PRECONDITION(GetParent(), "table constructed without table wrapper");
|
NS_PRECONDITION(GetParent(), "table constructed without table wrapper");
|
||||||
if (!mContent->GetParent() && !Style()->GetPseudo()) {
|
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;
|
*aProviderFrame = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -733,7 +733,7 @@ nsTableFrame::AppendAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
|
|||||||
int32_t lastIndex = startIndex + aNumColsToAdd - 1;
|
int32_t lastIndex = startIndex + aNumColsToAdd - 1;
|
||||||
|
|
||||||
for (int32_t childX = startIndex; childX <= lastIndex; childX++) {
|
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
|
// col group
|
||||||
nsIContent* iContent = aColGroupFrame->GetContent();
|
nsIContent* iContent = aColGroupFrame->GetContent();
|
||||||
RefPtr<ComputedStyle> computedStyle = shell->StyleSet()->
|
RefPtr<ComputedStyle> computedStyle = shell->StyleSet()->
|
||||||
@ -5107,7 +5107,7 @@ bool
|
|||||||
nsTableFrame::BCRecalcNeeded(ComputedStyle* aOldComputedStyle,
|
nsTableFrame::BCRecalcNeeded(ComputedStyle* aOldComputedStyle,
|
||||||
ComputedStyle* aNewComputedStyle)
|
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.
|
// and hence possibly completely bogus for GetStyle* purposes.
|
||||||
// We use PeekStyleData instead.
|
// We use PeekStyleData instead.
|
||||||
|
|
||||||
@ -8202,7 +8202,7 @@ nsTableFrame::UpdateStyleOfOwnedAnonBoxesForTableWrapper(
|
|||||||
nsChangeHint wrapperHint =
|
nsChangeHint wrapperHint =
|
||||||
aWrapperFrame->Style()->CalcStyleDifference(newStyle, &equalStructs);
|
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.
|
// but only if we're not on a style worker thread.
|
||||||
MOZ_ASSERT(!ServoStyleSet::IsInServoTraversal(),
|
MOZ_ASSERT(!ServoStyleSet::IsInServoTraversal(),
|
||||||
"if we can get in here from style worker threads, then we need "
|
"if we can get in here from style worker threads, then we need "
|
||||||
|
@ -216,14 +216,14 @@ ComputedStyle*
|
|||||||
nsTableWrapperFrame::GetParentComputedStyle(nsIFrame** aProviderFrame) const
|
nsTableWrapperFrame::GetParentComputedStyle(nsIFrame** aProviderFrame) const
|
||||||
{
|
{
|
||||||
// The table wrapper frame and the (inner) table frame split the style
|
// The table wrapper frame and the (inner) table frame split the style
|
||||||
// data by giving the table frame the style context associated with
|
// data by giving the table frame the ComputedStyle associated with
|
||||||
// the table content node and creating a style context for the wrapper
|
// the table content node and creating a ComputedStyle for the wrapper
|
||||||
// frame that is a *child* of the table frame's style context,
|
// frame that is a *child* of the table frame's ComputedStyle,
|
||||||
// matching the ::-moz-table-wrapper pseudo-element. html.css has a
|
// matching the ::-moz-table-wrapper pseudo-element. html.css has a
|
||||||
// rule that causes that pseudo-element (and thus the wrapper table)
|
// rule that causes that pseudo-element (and thus the wrapper table)
|
||||||
// to inherit *some* style properties from the table frame. The
|
// to inherit *some* style properties from the table frame. The
|
||||||
// children of the table inherit directly from the inner table, and
|
// 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();
|
return (*aProviderFrame = InnerTableFrame())->Style();
|
||||||
}
|
}
|
||||||
|
@ -642,7 +642,8 @@ nsImageBoxFrame::CanOptimizeToImageLayer()
|
|||||||
//
|
//
|
||||||
// DidSetComputedStyle
|
// 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
|
/* virtual */ void
|
||||||
nsImageBoxFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle)
|
nsImageBoxFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle)
|
||||||
|
@ -2057,7 +2057,7 @@ nsTreeBodyFrame::GetTwistyRect(int32_t aRowIndex,
|
|||||||
ComputedStyle* aTwistyContext)
|
ComputedStyle* aTwistyContext)
|
||||||
{
|
{
|
||||||
// The twisty rect extends all the way to the end of the cell. This is incorrect. We need to
|
// 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.
|
// 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
|
// 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
|
// 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;
|
aAllowImageRegions = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Obtain the URL from the style context.
|
// Obtain the URL from the ComputedStyle.
|
||||||
aAllowImageRegions = true;
|
aAllowImageRegions = true;
|
||||||
styleRequest = aComputedStyle->StyleList()->GetListStyleImage();
|
styleRequest = aComputedStyle->StyleList()->GetListStyleImage();
|
||||||
if (!styleRequest)
|
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.
|
// XXX We should respond to visibility rules for collapsed vs. hidden.
|
||||||
|
|
||||||
// This method returns the width of the twisty INCLUDING borders and padding.
|
// 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
|
// use the default image width for the twisty. If no image is found, it defaults
|
||||||
// to border+padding.
|
// to border+padding.
|
||||||
nsRect r(0,0,0,0);
|
nsRect r(0,0,0,0);
|
||||||
|
@ -284,7 +284,7 @@ protected:
|
|||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
nsPoint aPt);
|
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.
|
// paint the background rect as if it were a full-blown frame.
|
||||||
ImgDrawResult PaintBackgroundLayer(ComputedStyle* aComputedStyle,
|
ImgDrawResult PaintBackgroundLayer(ComputedStyle* aComputedStyle,
|
||||||
nsPresContext* aPresContext,
|
nsPresContext* aPresContext,
|
||||||
@ -353,7 +353,7 @@ protected:
|
|||||||
// Calculate the total width of our scrollable portion
|
// Calculate the total width of our scrollable portion
|
||||||
nscoord CalcHorzWidth(const ScrollParts& aParts);
|
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.
|
// the pseudo-styles passed in and place them into the cache.
|
||||||
ComputedStyle* GetPseudoComputedStyle(nsICSSAnonBoxPseudo* aPseudoElement);
|
ComputedStyle* GetPseudoComputedStyle(nsICSSAnonBoxPseudo* aPseudoElement);
|
||||||
|
|
||||||
@ -574,19 +574,19 @@ protected: // Data Members
|
|||||||
// from the view.
|
// from the view.
|
||||||
nsCOMPtr<nsITreeView> mView;
|
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 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 style context. This cache stores every combination that
|
// 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
|
// 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).
|
// (the power set of all row properties).
|
||||||
nsTreeStyleCache mStyleCache;
|
nsTreeStyleCache mStyleCache;
|
||||||
|
|
||||||
// A hashtable that maps from URLs to image request/listener pairs. The URL
|
// 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.
|
// represents a resolved :-moz-tree-cell-image (or twisty) pseudo-element.
|
||||||
// It maps directly to an imgIRequest.
|
// It maps directly to an imgIRequest.
|
||||||
nsDataHashtable<nsStringHashKey, nsTreeImageCacheEntry> mImageCache;
|
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;
|
mozilla::AtomArray mScratchArray;
|
||||||
|
|
||||||
// The index of the first visible row and the # of rows visible onscreen.
|
// The index of the first visible row and the # of rows visible onscreen.
|
||||||
|
@ -32,7 +32,7 @@ nsTreeStyleCache::Transition::Hash() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The style context cache impl
|
// The ComputedStyle cache impl
|
||||||
ComputedStyle*
|
ComputedStyle*
|
||||||
nsTreeStyleCache::GetComputedStyle(nsPresContext* aPresContext,
|
nsTreeStyleCache::GetComputedStyle(nsPresContext* aPresContext,
|
||||||
nsIContent* aContent,
|
nsIContent* aContent,
|
||||||
@ -74,7 +74,7 @@ nsTreeStyleCache::GetComputedStyle(nsPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We're in a final state.
|
// We're in a final state.
|
||||||
// Look up our style context for this state.
|
// Look up our ComputedStyle for this state.
|
||||||
ComputedStyle* result = nullptr;
|
ComputedStyle* result = nullptr;
|
||||||
if (mCache) {
|
if (mCache) {
|
||||||
result = mCache->GetWeak(currState);
|
result = mCache->GetWeak(currState);
|
||||||
@ -85,7 +85,7 @@ nsTreeStyleCache::GetComputedStyle(nsPresContext* aPresContext,
|
|||||||
ResolveXULTreePseudoStyle(aContent->AsElement(),
|
ResolveXULTreePseudoStyle(aContent->AsElement(),
|
||||||
aPseudoElement, aStyle, aInputWord);
|
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) {
|
if (!mCache) {
|
||||||
mCache = new ComputedStyleCache();
|
mCache = new ComputedStyleCache();
|
||||||
}
|
}
|
||||||
|
@ -71,11 +71,11 @@ protected:
|
|||||||
// under the key (S,i).
|
// under the key (S,i).
|
||||||
//
|
//
|
||||||
// Once the entire word has been consumed, the final state is used
|
// 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;
|
nsAutoPtr<TransitionTable> mTransitionTable;
|
||||||
|
|
||||||
// The cache of all active style contexts. This is a hash from
|
// The cache of all active ComputedStyles. This is a hash from
|
||||||
// a final state in the DFA, Sf, to the resultant style context.
|
// a final state in the DFA, Sf, to the resultant ComputedStyle.
|
||||||
typedef nsRefPtrHashtable<nsUint32HashKey, mozilla::ComputedStyle> ComputedStyleCache;
|
typedef nsRefPtrHashtable<nsUint32HashKey, mozilla::ComputedStyle> ComputedStyleCache;
|
||||||
nsAutoPtr<ComputedStyleCache> mCache;
|
nsAutoPtr<ComputedStyleCache> mCache;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user