mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
setting up for gfxtextcontrolchange
This commit is contained in:
parent
25a1ed3936
commit
8416b0f7cc
@ -22,7 +22,15 @@
|
|||||||
|
|
||||||
#include "nsFileControlFrame.h"
|
#include "nsFileControlFrame.h"
|
||||||
#include "nsFormFrame.h"
|
#include "nsFormFrame.h"
|
||||||
|
|
||||||
|
//#define DEBUG_NEWFRAME 1
|
||||||
|
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
#include "nsGfxTextControlFrame.h"
|
#include "nsGfxTextControlFrame.h"
|
||||||
|
#else
|
||||||
|
#include "nsGfxTextControlFrame2.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
#include "nsIAtom.h"
|
#include "nsIAtom.h"
|
||||||
@ -276,6 +284,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
const nsHTMLReflowState& aReflowState,
|
const nsHTMLReflowState& aReflowState,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsFileControlFrame", aReflowState.reason);
|
DO_GLOBAL_REFLOW_COUNT("nsFileControlFrame", aReflowState.reason);
|
||||||
|
|
||||||
if (mFormFrame == nsnull && eReflowReason_Initial == aReflowState.reason) {
|
if (mFormFrame == nsnull && eReflowReason_Initial == aReflowState.reason) {
|
||||||
@ -333,6 +342,9 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
|
#else
|
||||||
|
return NS_OK;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -358,7 +370,7 @@ nsGfxTextControlFrame*
|
|||||||
nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame* aStart)
|
nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame* aStart)
|
||||||
{
|
{
|
||||||
nsGfxTextControlFrame* result = nsnull;
|
nsGfxTextControlFrame* result = nsnull;
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
// find the text control frame.
|
// find the text control frame.
|
||||||
nsIFrame* childFrame = nsnull;
|
nsIFrame* childFrame = nsnull;
|
||||||
aStart->FirstChild(aPresContext, nsnull, &childFrame);
|
aStart->FirstChild(aPresContext, nsnull, &childFrame);
|
||||||
@ -394,6 +406,9 @@ nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame*
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
#else
|
||||||
|
return nsnull;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PRIntn
|
PRIntn
|
||||||
@ -554,6 +569,7 @@ NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIPresContext* aPresContext,
|
|||||||
const nsString& aValue)
|
const nsString& aValue)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
if (nsHTMLAtoms::value == aName) {
|
if (nsHTMLAtoms::value == aName) {
|
||||||
if (mTextFrame) {
|
if (mTextFrame) {
|
||||||
mTextFrame->SetTextControlFrameState(aValue);
|
mTextFrame->SetTextControlFrameState(aValue);
|
||||||
@ -563,6 +579,7 @@ NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIPresContext* aPresContext,
|
|||||||
if (!mCachedState) rv = NS_ERROR_OUT_OF_MEMORY;
|
if (!mCachedState) rv = NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,10 +588,11 @@ NS_IMETHODIMP nsFileControlFrame::GetProperty(nsIAtom* aName, nsString& aValue)
|
|||||||
// Return the value of the property from the widget it is not null.
|
// Return the value of the property from the widget it is not null.
|
||||||
// If widget is null, assume the widget is GFX-rendered and return a member variable instead.
|
// If widget is null, assume the widget is GFX-rendered and return a member variable instead.
|
||||||
|
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
if (nsHTMLAtoms::value == aName) {
|
if (nsHTMLAtoms::value == aName) {
|
||||||
mTextFrame->GetTextControlFrameState(aValue);
|
mTextFrame->GetTextControlFrameState(aValue);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,15 @@
|
|||||||
|
|
||||||
#include "nsFileControlFrame.h"
|
#include "nsFileControlFrame.h"
|
||||||
#include "nsFormFrame.h"
|
#include "nsFormFrame.h"
|
||||||
|
|
||||||
|
//#define DEBUG_NEWFRAME 1
|
||||||
|
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
#include "nsGfxTextControlFrame.h"
|
#include "nsGfxTextControlFrame.h"
|
||||||
|
#else
|
||||||
|
#include "nsGfxTextControlFrame2.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "prtypes.h"
|
#include "prtypes.h"
|
||||||
#include "nsIAtom.h"
|
#include "nsIAtom.h"
|
||||||
@ -276,6 +284,7 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
const nsHTMLReflowState& aReflowState,
|
const nsHTMLReflowState& aReflowState,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsFileControlFrame", aReflowState.reason);
|
DO_GLOBAL_REFLOW_COUNT("nsFileControlFrame", aReflowState.reason);
|
||||||
|
|
||||||
if (mFormFrame == nsnull && eReflowReason_Initial == aReflowState.reason) {
|
if (mFormFrame == nsnull && eReflowReason_Initial == aReflowState.reason) {
|
||||||
@ -333,6 +342,9 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
|
#else
|
||||||
|
return NS_OK;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -358,7 +370,7 @@ nsGfxTextControlFrame*
|
|||||||
nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame* aStart)
|
nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame* aStart)
|
||||||
{
|
{
|
||||||
nsGfxTextControlFrame* result = nsnull;
|
nsGfxTextControlFrame* result = nsnull;
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
// find the text control frame.
|
// find the text control frame.
|
||||||
nsIFrame* childFrame = nsnull;
|
nsIFrame* childFrame = nsnull;
|
||||||
aStart->FirstChild(aPresContext, nsnull, &childFrame);
|
aStart->FirstChild(aPresContext, nsnull, &childFrame);
|
||||||
@ -394,6 +406,9 @@ nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame*
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
#else
|
||||||
|
return nsnull;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PRIntn
|
PRIntn
|
||||||
@ -554,6 +569,7 @@ NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIPresContext* aPresContext,
|
|||||||
const nsString& aValue)
|
const nsString& aValue)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
if (nsHTMLAtoms::value == aName) {
|
if (nsHTMLAtoms::value == aName) {
|
||||||
if (mTextFrame) {
|
if (mTextFrame) {
|
||||||
mTextFrame->SetTextControlFrameState(aValue);
|
mTextFrame->SetTextControlFrameState(aValue);
|
||||||
@ -563,6 +579,7 @@ NS_IMETHODIMP nsFileControlFrame::SetProperty(nsIPresContext* aPresContext,
|
|||||||
if (!mCachedState) rv = NS_ERROR_OUT_OF_MEMORY;
|
if (!mCachedState) rv = NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,10 +588,11 @@ NS_IMETHODIMP nsFileControlFrame::GetProperty(nsIAtom* aName, nsString& aValue)
|
|||||||
// Return the value of the property from the widget it is not null.
|
// Return the value of the property from the widget it is not null.
|
||||||
// If widget is null, assume the widget is GFX-rendered and return a member variable instead.
|
// If widget is null, assume the widget is GFX-rendered and return a member variable instead.
|
||||||
|
|
||||||
|
#ifndef DEBUG_NEWFRAME
|
||||||
if (nsHTMLAtoms::value == aName) {
|
if (nsHTMLAtoms::value == aName) {
|
||||||
mTextFrame->GetTextControlFrameState(aValue);
|
mTextFrame->GetTextControlFrameState(aValue);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user