mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 741681 - replaced nsAccessNode::GetPresContext() with nsDocAccessible::PresContext(), r=hub, f=surkov
This commit is contained in:
parent
dd70339941
commit
edfd26711c
@ -209,17 +209,6 @@ void nsAccessNode::ShutdownXPAccessibility()
|
||||
NotifyA11yInitOrShutdown(false);
|
||||
}
|
||||
|
||||
// nsAccessNode protected
|
||||
nsPresContext* nsAccessNode::GetPresContext()
|
||||
{
|
||||
if (!mDoc)
|
||||
return nsnull;
|
||||
|
||||
nsIPresShell* presShell(mDoc->PresShell());
|
||||
|
||||
return presShell ? presShell->GetPresContext() : nsnull;
|
||||
}
|
||||
|
||||
nsRootAccessible*
|
||||
nsAccessNode::RootAccessible() const
|
||||
{
|
||||
|
@ -154,22 +154,20 @@ public:
|
||||
void Language(nsAString& aLocale);
|
||||
|
||||
protected:
|
||||
nsPresContext* GetPresContext();
|
||||
|
||||
void LastRelease();
|
||||
void LastRelease();
|
||||
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsDocAccessible* mDoc;
|
||||
|
||||
/**
|
||||
* Notify global nsIObserver's that a11y is getting init'd or shutdown
|
||||
*/
|
||||
static void NotifyA11yInitOrShutdown(bool aIsInit);
|
||||
/**
|
||||
* Notify global nsIObserver's that a11y is getting init'd or shutdown.
|
||||
*/
|
||||
static void NotifyA11yInitOrShutdown(bool aIsInit);
|
||||
|
||||
// Static data, we do our own refcounting for our static data
|
||||
static nsIStringBundle *gStringBundle;
|
||||
// Static data, we do our own refcounting for our static data.
|
||||
static nsIStringBundle* gStringBundle;
|
||||
|
||||
static bool gIsFormFillEnabled;
|
||||
static bool gIsFormFillEnabled;
|
||||
|
||||
private:
|
||||
nsAccessNode() MOZ_DELETE;
|
||||
|
@ -133,6 +133,11 @@ public:
|
||||
*/
|
||||
nsIPresShell* PresShell() const { return mPresShell; }
|
||||
|
||||
/**
|
||||
* Return the presentation shell's context.
|
||||
*/
|
||||
nsPresContext* PresContext() const { return mPresShell->GetPresContext(); }
|
||||
|
||||
/**
|
||||
* Return true if associated DOM document was loaded and isn't unloading.
|
||||
*/
|
||||
|
@ -207,11 +207,7 @@ nsIntRect nsHyperTextAccessible::GetBoundsForString(nsIFrame *aFrame, PRUint32 a
|
||||
&startContentOffsetInFrame, &frame);
|
||||
NS_ENSURE_SUCCESS(rv, screenRect);
|
||||
|
||||
NS_ENSURE_TRUE(mDoc, screenRect);
|
||||
nsIPresShell* shell = mDoc->PresShell();
|
||||
NS_ENSURE_TRUE(shell, screenRect);
|
||||
|
||||
nsPresContext *context = shell->GetPresContext();
|
||||
nsPresContext* context = mDoc->PresContext();
|
||||
|
||||
while (frame && startContentOffset < endContentOffset) {
|
||||
// Start with this frame's screen rect, which we will
|
||||
@ -1294,13 +1290,10 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
PRUint32 aCoordType, PRInt32 *aOffset)
|
||||
{
|
||||
*aOffset = -1;
|
||||
if (!mDoc)
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIPresShell* shell = mDoc->PresShell();
|
||||
if (!shell) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsIFrame *hyperFrame = GetFrame();
|
||||
if (!hyperFrame) {
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -1319,8 +1312,7 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
|
||||
}
|
||||
nsIntPoint pxInHyperText(coords.x - frameScreenRect.x,
|
||||
coords.y - frameScreenRect.y);
|
||||
nsPresContext *context = GetPresContext();
|
||||
NS_ENSURE_TRUE(context, NS_ERROR_FAILURE);
|
||||
nsPresContext* context = mDoc->PresContext();
|
||||
nsPoint pointInHyperText(context->DevPixelsToAppUnits(pxInHyperText.x),
|
||||
context->DevPixelsToAppUnits(pxInHyperText.y));
|
||||
|
||||
|
@ -217,8 +217,11 @@ nsresult nsTextAccessibleWrap::GetCharacterExtents(PRInt32 aStartOffset, PRInt32
|
||||
PRInt32* aWidth, PRInt32* aHeight)
|
||||
{
|
||||
*aX = *aY = *aWidth = *aHeight = 0;
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
|
||||
|
||||
if (IsDefunct())
|
||||
return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
nsPresContext* presContext = mDoc->PresContext();
|
||||
|
||||
nsIFrame *frame = GetFrame();
|
||||
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
|
||||
|
@ -802,7 +802,7 @@ nsXULTreeItemAccessibleBase::GetBounds(PRInt32 *aX, PRInt32 *aY,
|
||||
x = tcX;
|
||||
y += tcY;
|
||||
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext* presContext = mDoc->PresContext();
|
||||
*aX = presContext->CSSPixelsToDevPixels(x);
|
||||
*aY = presContext->CSSPixelsToDevPixels(y);
|
||||
*aWidth = presContext->CSSPixelsToDevPixels(width);
|
||||
|
@ -924,7 +924,7 @@ nsXULTreeGridCellAccessible::GetBounds(PRInt32 *aX, PRInt32 *aY,
|
||||
x += tcX;
|
||||
y += tcY;
|
||||
|
||||
nsPresContext *presContext = GetPresContext();
|
||||
nsPresContext* presContext = mDoc->PresContext();
|
||||
*aX = presContext->CSSPixelsToDevPixels(x);
|
||||
*aY = presContext->CSSPixelsToDevPixels(y);
|
||||
*aWidth = presContext->CSSPixelsToDevPixels(width);
|
||||
|
Loading…
Reference in New Issue
Block a user