Bug 1357169 - Back out changeset b55a8d9517c8 (
bug 1320809).
MozReview-Commit-ID: LCiH5P1L7bD
--- a/layout/forms/nsGfxCheckboxControlFrame.cpp
+++ b/layout/forms/nsGfxCheckboxControlFrame.cpp
@@ -42,8 +42,27 @@ nsGfxCheckboxControlFrame::~nsGfxCheckbo
#ifdef ACCESSIBILITY
a11y::AccType
nsGfxCheckboxControlFrame::AccessibleType()
{
return a11y::eHTMLCheckboxType;
}
#endif
+
+//------------------------------------------------------------
+bool
+nsGfxCheckboxControlFrame::IsChecked()
+{
+ nsCOMPtr<nsIDOMHTMLInputElement> elem(do_QueryInterface(mContent));
+ bool retval = false;
+ elem->GetChecked(&retval);
+ return retval;
+}
+
+bool
+nsGfxCheckboxControlFrame::IsIndeterminate()
+{
+ nsCOMPtr<nsIDOMHTMLInputElement> elem(do_QueryInterface(mContent));
+ bool retval = false;
+ elem->GetIndeterminate(&retval);
+ return retval;
+}
--- a/layout/forms/nsGfxCheckboxControlFrame.h
+++ b/layout/forms/nsGfxCheckboxControlFrame.h
@@ -20,12 +20,17 @@ public:
virtual nsresult GetFrameName(nsAString& aResult) const override {
return MakeFrameName(NS_LITERAL_STRING("CheckboxControl"), aResult);
}
#endif
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
+
+protected:
+
+ bool IsChecked();
+ bool IsIndeterminate();
};
#endif