зеркало из https://github.com/mozilla/gecko-dev.git
r=troy; bug: 15153; fixed problem with style-change reflows not being propogated properly
This commit is contained in:
Родитель
0d540807d5
Коммит
b10899223c
|
@ -24,6 +24,7 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsIReflowCommand.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsIDOMHTMLParagraphElement.h"
|
||||
|
@ -141,6 +142,29 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
|
|||
// Make sure we only incrementally reflow once
|
||||
mNextRCFrame = nsnull;
|
||||
}
|
||||
else if (mOuterReflowState.reason == eReflowReason_StyleChange) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
else {
|
||||
if (mOuterReflowState.reason == eReflowReason_Incremental) {
|
||||
// If the incremental reflow command is a StyleChanged reflow
|
||||
// and it's target is the current block, then make sure we send
|
||||
// StyleChange reflow reasons down to all the children so that
|
||||
// they don't over-optimize their reflow.
|
||||
nsIReflowCommand* rc = mOuterReflowState.reflowCommand;
|
||||
if (rc) {
|
||||
nsIReflowCommand::ReflowType type;
|
||||
rc->GetType(type);
|
||||
if (type == nsIReflowCommand::StyleChanged) {
|
||||
nsIFrame* target;
|
||||
rc->GetTarget(target);
|
||||
if (target == mOuterReflowState.frame) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setup reflow state for reflowing the frame
|
||||
// XXX subtract out vertical margin?
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "nsIRenderingContext.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
|
||||
#include "nsIReflowCommand.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsIContent.h"
|
||||
|
@ -833,6 +833,33 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
// Make sure we only incrementally reflow once
|
||||
*aNextRCFrame = nsnull;
|
||||
}
|
||||
else if (psd->mReflowState->reason == eReflowReason_StyleChange) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
else {
|
||||
const nsReflowState* rs = psd->mReflowState;
|
||||
if (rs->reason == eReflowReason_Incremental) {
|
||||
// If the incremental reflow command is a StyleChanged reflow and
|
||||
// it's target is the current span, then make sure we send
|
||||
// StyleChange reflow reasons down to the children so that they
|
||||
// don't over-optimize their reflow.
|
||||
nsIReflowCommand* rc = rs->reflowCommand;
|
||||
if (rc) {
|
||||
nsIReflowCommand::ReflowType type;
|
||||
rc->GetType(type);
|
||||
if (type == nsIReflowCommand::StyleChanged) {
|
||||
nsIFrame* parentFrame = psd->mFrame
|
||||
? psd->mFrame->mFrame
|
||||
: mBlockReflowState->frame;
|
||||
nsIFrame* target;
|
||||
rc->GetTarget(target);
|
||||
if (target == parentFrame) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setup reflow state for reflowing the frame
|
||||
nsHTMLReflowState reflowState(mPresContext, *psd->mReflowState, aFrame,
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsIReflowCommand.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsIDOMHTMLParagraphElement.h"
|
||||
|
@ -141,6 +142,29 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
|
|||
// Make sure we only incrementally reflow once
|
||||
mNextRCFrame = nsnull;
|
||||
}
|
||||
else if (mOuterReflowState.reason == eReflowReason_StyleChange) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
else {
|
||||
if (mOuterReflowState.reason == eReflowReason_Incremental) {
|
||||
// If the incremental reflow command is a StyleChanged reflow
|
||||
// and it's target is the current block, then make sure we send
|
||||
// StyleChange reflow reasons down to all the children so that
|
||||
// they don't over-optimize their reflow.
|
||||
nsIReflowCommand* rc = mOuterReflowState.reflowCommand;
|
||||
if (rc) {
|
||||
nsIReflowCommand::ReflowType type;
|
||||
rc->GetType(type);
|
||||
if (type == nsIReflowCommand::StyleChanged) {
|
||||
nsIFrame* target;
|
||||
rc->GetTarget(target);
|
||||
if (target == mOuterReflowState.frame) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setup reflow state for reflowing the frame
|
||||
// XXX subtract out vertical margin?
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "nsIRenderingContext.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
|
||||
#include "nsIReflowCommand.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsIContent.h"
|
||||
|
@ -833,6 +833,33 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
// Make sure we only incrementally reflow once
|
||||
*aNextRCFrame = nsnull;
|
||||
}
|
||||
else if (psd->mReflowState->reason == eReflowReason_StyleChange) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
else {
|
||||
const nsReflowState* rs = psd->mReflowState;
|
||||
if (rs->reason == eReflowReason_Incremental) {
|
||||
// If the incremental reflow command is a StyleChanged reflow and
|
||||
// it's target is the current span, then make sure we send
|
||||
// StyleChange reflow reasons down to the children so that they
|
||||
// don't over-optimize their reflow.
|
||||
nsIReflowCommand* rc = rs->reflowCommand;
|
||||
if (rc) {
|
||||
nsIReflowCommand::ReflowType type;
|
||||
rc->GetType(type);
|
||||
if (type == nsIReflowCommand::StyleChanged) {
|
||||
nsIFrame* parentFrame = psd->mFrame
|
||||
? psd->mFrame->mFrame
|
||||
: mBlockReflowState->frame;
|
||||
nsIFrame* target;
|
||||
rc->GetTarget(target);
|
||||
if (target == parentFrame) {
|
||||
reason = eReflowReason_StyleChange;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setup reflow state for reflowing the frame
|
||||
nsHTMLReflowState reflowState(mPresContext, *psd->mReflowState, aFrame,
|
||||
|
|
Загрузка…
Ссылка в новой задаче