зеркало из https://github.com/mozilla/pjs.git
Support style changes for leaf frames
This commit is contained in:
Родитель
6fdfd094d8
Коммит
1c24cf2f69
|
@ -16,10 +16,12 @@
|
|||
* Reserved.
|
||||
*/
|
||||
#include "nsLeafFrame.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIStyleContext.h"
|
||||
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
|
@ -121,3 +123,15 @@ NS_METHOD nsLeafFrame::ContentChanged(nsIPresShell* aShell,
|
|||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLeafFrame::AttributeChanged(nsIPresShell* aShell,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
nsIAtom* aAttribute)
|
||||
{
|
||||
if (nsHTMLAtoms::style == aAttribute) {
|
||||
nsHTMLContainerFrame::ApplyStyleChangeToTree(*aPresContext, this);
|
||||
nsHTMLContainerFrame::StyleChangeReflow(*aPresContext, this);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -28,19 +28,23 @@
|
|||
*/
|
||||
class nsLeafFrame : public nsFrame {
|
||||
public:
|
||||
|
||||
// nsIFrame replacements
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD ContentChanged(nsIPresShell* aShell,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
nsISupports* aSubContent);
|
||||
NS_IMETHOD AttributeChanged(nsIPresShell* aShell,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
nsIAtom* aAttribute);
|
||||
|
||||
protected:
|
||||
nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
|
|
@ -16,10 +16,12 @@
|
|||
* Reserved.
|
||||
*/
|
||||
#include "nsLeafFrame.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIStyleContext.h"
|
||||
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
|
@ -121,3 +123,15 @@ NS_METHOD nsLeafFrame::ContentChanged(nsIPresShell* aShell,
|
|||
return result;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLeafFrame::AttributeChanged(nsIPresShell* aShell,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
nsIAtom* aAttribute)
|
||||
{
|
||||
if (nsHTMLAtoms::style == aAttribute) {
|
||||
nsHTMLContainerFrame::ApplyStyleChangeToTree(*aPresContext, this);
|
||||
nsHTMLContainerFrame::StyleChangeReflow(*aPresContext, this);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -28,19 +28,23 @@
|
|||
*/
|
||||
class nsLeafFrame : public nsFrame {
|
||||
public:
|
||||
|
||||
// nsIFrame replacements
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
const nsReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD ContentChanged(nsIPresShell* aShell,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
nsISupports* aSubContent);
|
||||
NS_IMETHOD AttributeChanged(nsIPresShell* aShell,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
nsIAtom* aAttribute);
|
||||
|
||||
protected:
|
||||
nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
|
Загрузка…
Ссылка в новой задаче