mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Attempt to fix nebiros bustage by moving style struct access into nsIInspectorCSSUtils
r/a=timeless,jkeiser,#mozilla bug 147189
This commit is contained in:
parent
8559ad8701
commit
5586aa4d4a
@ -81,6 +81,11 @@ public:
|
||||
// Hooks to methods that need layout atoms (static vars in layout)
|
||||
NS_IMETHOD GetStyleContextForFrame(nsIFrame* aFrame,
|
||||
nsIStyleContext** aStyleContext) = 0;
|
||||
|
||||
// Hooks to ::GetStyleData<T>(nsCOMPtr<nsIStyleContext>, const nsStyleText**)
|
||||
// and calls nsStyleText->WhiteSpaceIsSignificant();
|
||||
NS_IMETHOD IsWhiteSpaceSignificant(nsIStyleContext* aStyleContext,
|
||||
PRBool *aIsSignificant) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIInspectorCSSUtils_h___ */
|
||||
|
@ -142,3 +142,18 @@ nsInspectorCSSUtils::GetStyleContextForFrame(nsIFrame* aFrame,
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsInspectorCSSUtils::IsWhiteSpaceSignificant(nsIStyleContext* aStyleContext,
|
||||
PRBool *aIsSignificant)
|
||||
{
|
||||
NS_PRECONDITION(aStyleContext, "We'd better have a style context!");
|
||||
NS_PRECONDITION(aStyleContext, "We'd better have an out pointer!");
|
||||
|
||||
const nsStyleText* text = nsnull;
|
||||
::GetStyleData(aStyleContext, &text);
|
||||
NS_ASSERTION(text, "Could not get a style struct!");
|
||||
|
||||
*aIsSignificant = text->WhiteSpaceIsSignificant();
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -59,6 +59,8 @@ public:
|
||||
NS_IMETHOD AdjustRectForMargins(nsIFrame* aFrame, nsRect& aRect);
|
||||
NS_IMETHOD GetStyleContextForFrame(nsIFrame* aFrame,
|
||||
nsIStyleContext** aStyleContext);
|
||||
NS_IMETHOD IsWhiteSpaceSignificant(nsIStyleContext* aStyleContext,
|
||||
PRBool *aIsSignificant);
|
||||
};
|
||||
|
||||
#endif /* nsInspectorCSSUtils_h___ */
|
||||
|
@ -154,11 +154,10 @@ inDOMUtils::IsIgnorableWhitespace(nsIDOMCharacterData *aDataNode,
|
||||
getter_AddRefs(styleContext));
|
||||
|
||||
if (styleContext) {
|
||||
const nsStyleText* text = nsnull;
|
||||
::GetStyleData(styleContext, &text);
|
||||
NS_ASSERTION(text, "Could not get a style struct!");
|
||||
PRBool significant = PR_FALSE;
|
||||
mCSSUtils->IsWhiteSpaceSignificant(styleContext, &significant);
|
||||
|
||||
*aReturn = !text->WhiteSpaceIsSignificant();
|
||||
*aReturn = !significant;
|
||||
}
|
||||
else {
|
||||
// No style context. Let's just assume the default value of
|
||||
|
@ -81,6 +81,11 @@ public:
|
||||
// Hooks to methods that need layout atoms (static vars in layout)
|
||||
NS_IMETHOD GetStyleContextForFrame(nsIFrame* aFrame,
|
||||
nsIStyleContext** aStyleContext) = 0;
|
||||
|
||||
// Hooks to ::GetStyleData<T>(nsCOMPtr<nsIStyleContext>, const nsStyleText**)
|
||||
// and calls nsStyleText->WhiteSpaceIsSignificant();
|
||||
NS_IMETHOD IsWhiteSpaceSignificant(nsIStyleContext* aStyleContext,
|
||||
PRBool *aIsSignificant) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIInspectorCSSUtils_h___ */
|
||||
|
@ -142,3 +142,18 @@ nsInspectorCSSUtils::GetStyleContextForFrame(nsIFrame* aFrame,
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsInspectorCSSUtils::IsWhiteSpaceSignificant(nsIStyleContext* aStyleContext,
|
||||
PRBool *aIsSignificant)
|
||||
{
|
||||
NS_PRECONDITION(aStyleContext, "We'd better have a style context!");
|
||||
NS_PRECONDITION(aStyleContext, "We'd better have an out pointer!");
|
||||
|
||||
const nsStyleText* text = nsnull;
|
||||
::GetStyleData(aStyleContext, &text);
|
||||
NS_ASSERTION(text, "Could not get a style struct!");
|
||||
|
||||
*aIsSignificant = text->WhiteSpaceIsSignificant();
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -59,6 +59,8 @@ public:
|
||||
NS_IMETHOD AdjustRectForMargins(nsIFrame* aFrame, nsRect& aRect);
|
||||
NS_IMETHOD GetStyleContextForFrame(nsIFrame* aFrame,
|
||||
nsIStyleContext** aStyleContext);
|
||||
NS_IMETHOD IsWhiteSpaceSignificant(nsIStyleContext* aStyleContext,
|
||||
PRBool *aIsSignificant);
|
||||
};
|
||||
|
||||
#endif /* nsInspectorCSSUtils_h___ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user