mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Null-check the primary frame before using it. b=380749 r=aaronleventhal
This commit is contained in:
parent
3678edfc86
commit
520a24ca3f
@ -239,7 +239,9 @@ nsHTMLTableAccessible::GetCaption(nsIAccessible **aCaption)
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> captionNode(do_QueryInterface(caption));
|
||||
NS_ENSURE_TRUE(captionNode, NS_ERROR_FAILURE);
|
||||
if (!captionNode) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessibilityService> accService = GetAccService();
|
||||
NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
|
||||
@ -252,6 +254,9 @@ nsHTMLTableAccessible::GetCaption(nsIAccessible **aCaption)
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(captionNode));
|
||||
NS_ENSURE_TRUE(presShell && content, NS_ERROR_FAILURE);
|
||||
nsIFrame* frame = presShell->GetPrimaryFrameFor(content);
|
||||
if (!frame) {
|
||||
return NS_OK;
|
||||
}
|
||||
accService->CreateHyperTextAccessible(frame, aCaption);
|
||||
nsCOMPtr<nsPIAccessNode> accessNode(do_QueryInterface(*aCaption));
|
||||
return accessNode ? accessNode->Init() : NS_ERROR_FAILURE;
|
||||
@ -953,7 +958,9 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL
|
||||
NS_ENSURE_TRUE(cellContent, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIPresShell> shell(GetPresShell());
|
||||
nsIFrame *cellFrame = shell->GetPrimaryFrameFor(cellContent);
|
||||
NS_ENSURE_TRUE(cellFrame, NS_ERROR_FAILURE);
|
||||
if (!cellFrame) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsMargin border;
|
||||
cellFrame->GetBorder(border);
|
||||
if (border.top && border.bottom && border.left && border.right) {
|
||||
|
Loading…
Reference in New Issue
Block a user