diff --git a/content/html/style/src/nsInspectorCSSUtils.cpp b/content/html/style/src/nsInspectorCSSUtils.cpp
index 41c6defa6687..9d073a32cd39 100644
--- a/content/html/style/src/nsInspectorCSSUtils.cpp
+++ b/content/html/style/src/nsInspectorCSSUtils.cpp
@@ -152,12 +152,12 @@ nsInspectorCSSUtils::GetStyleContextForContent(nsIContent* aContent,
if (frame)
return GetStyleContextForFrame(frame, aStyleContext);
- // No frame has been created, so resolve the style ourself.
+ // No frame has been created, so resolve the style ourselves
nsCOMPtr parentContext;
nsCOMPtr parent;
aContent->GetParent(*getter_AddRefs(parent));
if (parent) {
- nsresult rv = GetStyleContextForContent(aContent, aPresShell,
+ nsresult rv = GetStyleContextForContent(parent, aPresShell,
getter_AddRefs(parentContext));
NS_ENSURE_SUCCESS(rv, rv);
}
diff --git a/layout/style/nsInspectorCSSUtils.cpp b/layout/style/nsInspectorCSSUtils.cpp
index 41c6defa6687..9d073a32cd39 100644
--- a/layout/style/nsInspectorCSSUtils.cpp
+++ b/layout/style/nsInspectorCSSUtils.cpp
@@ -152,12 +152,12 @@ nsInspectorCSSUtils::GetStyleContextForContent(nsIContent* aContent,
if (frame)
return GetStyleContextForFrame(frame, aStyleContext);
- // No frame has been created, so resolve the style ourself.
+ // No frame has been created, so resolve the style ourselves
nsCOMPtr parentContext;
nsCOMPtr parent;
aContent->GetParent(*getter_AddRefs(parent));
if (parent) {
- nsresult rv = GetStyleContextForContent(aContent, aPresShell,
+ nsresult rv = GetStyleContextForContent(parent, aPresShell,
getter_AddRefs(parentContext));
NS_ENSURE_SUCCESS(rv, rv);
}