зеркало из https://github.com/mozilla/pjs.git
Container floated elements are now wrapped in a BODY frame
This commit is contained in:
Родитель
6a771ae2b8
Коммит
c19913ecf4
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,52 +0,0 @@
|
||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Netscape Public License
|
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/NPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
|
||||||
* the License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* The Original Code is Mozilla Communicator client code.
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is Netscape Communications
|
|
||||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
|
||||||
* Netscape Communications Corporation. All Rights Reserved.
|
|
||||||
*/
|
|
||||||
#include "nsCSSContainerFrame.h"
|
|
||||||
#include "nsPlaceholderFrame.h"
|
|
||||||
#include "nsIStyleContext.h"
|
|
||||||
|
|
||||||
nsCSSContainerFrame::nsCSSContainerFrame(nsIContent* aContent,
|
|
||||||
nsIFrame* aParent)
|
|
||||||
: nsHTMLContainerFrame(aContent, aParent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCSSContainerFrame::~nsCSSContainerFrame()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
nsPlaceholderFrame*
|
|
||||||
nsCSSContainerFrame::CreatePlaceholderFrame(nsIPresContext* aPresContext,
|
|
||||||
nsIFrame* aFloatedFrame)
|
|
||||||
{
|
|
||||||
nsIContent* content;
|
|
||||||
aFloatedFrame->GetContent(content);
|
|
||||||
|
|
||||||
// XXX We should wrap the floated element in a BODY frame...
|
|
||||||
nsPlaceholderFrame* placeholder;
|
|
||||||
nsPlaceholderFrame::NewFrame((nsIFrame**)&placeholder, content, this, aFloatedFrame);
|
|
||||||
NS_IF_RELEASE(content);
|
|
||||||
|
|
||||||
// Let the placeholder share the same style context as the floated element
|
|
||||||
nsIStyleContext* kidSC;
|
|
||||||
aFloatedFrame->GetStyleContext(aPresContext, kidSC);
|
|
||||||
placeholder->SetStyleContext(aPresContext, kidSC);
|
|
||||||
NS_RELEASE(kidSC);
|
|
||||||
|
|
||||||
return placeholder;
|
|
||||||
}
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "nsIInlineReflow.h"
|
#include "nsIInlineReflow.h"
|
||||||
|
|
||||||
// Implementation of a frame that's used as a placeholder for an anchored item
|
// Implementation of a frame that's used as a placeholder for an anchored item
|
||||||
|
|
||||||
class nsPlaceholderFrame : public nsFrame, public nsIInlineReflow {
|
class nsPlaceholderFrame : public nsFrame, public nsIInlineReflow {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +35,7 @@ public:
|
||||||
|
|
||||||
// Returns the associated anchored item
|
// Returns the associated anchored item
|
||||||
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
||||||
|
void SetAnchoredItem(nsIFrame* aAnchoredItem) {mAnchoredItem = aAnchoredItem;}
|
||||||
|
|
||||||
// nsISupports
|
// nsISupports
|
||||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "nsIInlineReflow.h"
|
#include "nsIInlineReflow.h"
|
||||||
|
|
||||||
// Implementation of a frame that's used as a placeholder for an anchored item
|
// Implementation of a frame that's used as a placeholder for an anchored item
|
||||||
|
|
||||||
class nsPlaceholderFrame : public nsFrame, public nsIInlineReflow {
|
class nsPlaceholderFrame : public nsFrame, public nsIInlineReflow {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +35,7 @@ public:
|
||||||
|
|
||||||
// Returns the associated anchored item
|
// Returns the associated anchored item
|
||||||
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
||||||
|
void SetAnchoredItem(nsIFrame* aAnchoredItem) {mAnchoredItem = aAnchoredItem;}
|
||||||
|
|
||||||
// nsISupports
|
// nsISupports
|
||||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче