Bug 317544: Disable floating inside mathml. r=bz sr=dbaron

This commit is contained in:
cvshook%sicking.cc 2006-01-25 21:40:31 +00:00
Родитель c46fb5af56
Коммит 366cc1d0ed
3 изменённых файлов: 22 добавлений и 6 удалений

Просмотреть файл

@ -1136,12 +1136,18 @@ public:
~nsFrameConstructorState();
// Function to push the existing absolute containing block state and
// create a new scope.
// create a new scope. Code that uses this function should get matching
// logic in GetAbsoluteContainingBlock.
void PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteContainingBlock,
nsFrameConstructorSaveState& aSaveState);
// Function to push the existing float containing block state and
// create a new scope
// create a new scope. Code that uses this function should get matching
// logic in GetFloatContainingBlock.
// Pushing a null float containing block forbids any frames from being
// floated until a new float containing block is pushed.
// XXX we should get rid of null float containing blocks and teach the
// various frame classes to deal with floats instead.
void PushFloatContainingBlock(nsIFrame* aNewFloatContainingBlock,
nsFrameConstructorSaveState& aSaveState,
PRBool aFirstLetterStyle,
@ -7391,6 +7397,10 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
return rv;
}
// Push a null float containing block to disable floating within mathml
nsFrameConstructorSaveState saveState;
aState.PushFloatContainingBlock(nsnull, saveState, PR_FALSE, PR_FALSE);
// MathML frames are inline frames, so just process their kids
nsFrameItems childItems;
if (!newFrame->IsLeaf()) {
@ -8345,7 +8355,7 @@ nsCSSFrameConstructor::GetFloatContainingBlock(nsIFrame* aFrame)
// Starting with aFrame, look for a frame that is a float containing block
for (nsIFrame* containingBlock = aFrame;
containingBlock;
containingBlock && !containingBlock->IsFrameOfType(nsIFrame::eMathML);
containingBlock = containingBlock->GetParent()) {
if (containingBlock->IsFloatContainingBlock()) {
return containingBlock;

Просмотреть файл

@ -686,8 +686,15 @@ private:
nsIFrame* GetFrameFor(nsIContent* aContent);
/**
* These functions are used when we start frame creation from a non-root
* element. They should recreate the same state that we would have
* arrived at if we had built frames from the root frame to aFrame.
* Therefore, any calls to PushFloatContainingBlock and
* PushAbsoluteContainingBlock during frame construction should get
* corresponding logic in these functions.
*/
nsIFrame* GetAbsoluteContainingBlock(nsIFrame* aFrame);
nsIFrame* GetFloatContainingBlock(nsIFrame* aFrame);
nsIContent* PropagateScrollToViewport();

Просмотреть файл

@ -42,9 +42,8 @@
@namespace url(http://www.w3.org/1998/Math/MathML);
/* MathML doesn't permit floating and positioning */
/* MathML doesn't permit positioning */
*, * > *|* {
float: none !important;
position: static !important;
}