From 60303543bc3f73dd33bc248743212e0c8782fcca Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Sat, 20 Dec 2003 12:15:48 +0000 Subject: [PATCH] look into wrapper frames for inputs with :after and :before bug 15597 r/sr=dbaron --- .../html/content/src/nsGenericHTMLElement.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 7003cf181d3..0934b351d86 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -2707,7 +2707,22 @@ nsGenericHTMLElement::GetFormControlFrameFor(nsIContent* aContent, if (frame) { nsIFormControlFrame* form_frame = nsnull; CallQueryInterface(frame, &form_frame); - return form_frame; + if (form_frame) { + return form_frame; + } + + // If we have generated content, the primary frame will be a + // wrapper frame.. out real frame will be in its child list. + for (frame->FirstChild(frame->GetPresContext(), nsnull, &frame); + frame; + frame = frame->GetNextSibling()) { + CallQueryInterface(frame, &form_frame); + if (form_frame) { + return form_frame; + } + } + + NS_ERROR("Form control has a frame, but it's not a form frame"); } return nsnull;