mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 871338: Handle NS_BLOCK_LOOK_FOR_DIRTY_FRAMES lazy marking in GetMinWidth and GetPrefWidth in addition to Reflow. r=bzbarsky
This commit is contained in:
parent
736dd852cb
commit
8eed96b5d6
@ -641,6 +641,11 @@ nsBlockFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
|
||||
AutoNoisyIndenter indenter(gNoisyIntrinsic);
|
||||
#endif
|
||||
|
||||
for (nsBlockFrame* curFrame = this; curFrame;
|
||||
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
|
||||
curFrame->LazyMarkLinesDirty();
|
||||
}
|
||||
|
||||
if (GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
|
||||
ResolveBidi();
|
||||
InlineMinWidthData data;
|
||||
@ -721,6 +726,11 @@ nsBlockFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
||||
AutoNoisyIndenter indenter(gNoisyIntrinsic);
|
||||
#endif
|
||||
|
||||
for (nsBlockFrame* curFrame = this; curFrame;
|
||||
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
|
||||
curFrame->LazyMarkLinesDirty();
|
||||
}
|
||||
|
||||
if (GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
|
||||
ResolveBidi();
|
||||
InlinePrefWidthData data;
|
||||
@ -993,21 +1003,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
PrepareResizeReflow(state);
|
||||
}
|
||||
|
||||
if (GetStateBits() & NS_BLOCK_LOOK_FOR_DIRTY_FRAMES) {
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end; ++line) {
|
||||
int32_t n = line->GetChildCount();
|
||||
for (nsIFrame* lineFrame = line->mFirstChild;
|
||||
n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
|
||||
if (NS_SUBTREE_DIRTY(lineFrame)) {
|
||||
// NOTE: MarkLineDirty does more than just marking the line dirty.
|
||||
MarkLineDirty(line, &mLines);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
RemoveStateBits(NS_BLOCK_LOOK_FOR_DIRTY_FRAMES);
|
||||
}
|
||||
LazyMarkLinesDirty();
|
||||
|
||||
mState &= ~NS_FRAME_FIRST_REFLOW;
|
||||
|
||||
@ -1509,6 +1505,26 @@ nsBlockFrame::UpdateOverflow()
|
||||
return nsBlockFrameSuper::UpdateOverflow();
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::LazyMarkLinesDirty()
|
||||
{
|
||||
if (GetStateBits() & NS_BLOCK_LOOK_FOR_DIRTY_FRAMES) {
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end; ++line) {
|
||||
int32_t n = line->GetChildCount();
|
||||
for (nsIFrame* lineFrame = line->mFirstChild;
|
||||
n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
|
||||
if (NS_SUBTREE_DIRTY(lineFrame)) {
|
||||
// NOTE: MarkLineDirty does more than just marking the line dirty.
|
||||
MarkLineDirty(line, &mLines);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
RemoveStateBits(NS_BLOCK_LOOK_FOR_DIRTY_FRAMES);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::MarkLineDirty(line_iterator aLine, const nsLineList* aLineList)
|
||||
{
|
||||
|
@ -611,6 +611,12 @@ protected:
|
||||
nscoord& aAvailableSpaceHeight, /* in-out */
|
||||
bool* aKeepReflowGoing);
|
||||
|
||||
/**
|
||||
* If NS_BLOCK_LOOK_FOR_DIRTY_FRAMES is set, call MarkLineDirty
|
||||
* on any line with a child frame that is dirty.
|
||||
*/
|
||||
void LazyMarkLinesDirty();
|
||||
|
||||
/**
|
||||
* Mark |aLine| dirty, and, if necessary because of possible
|
||||
* pull-up, mark the previous line dirty as well. Also invalidates textruns
|
||||
|
1
layout/reftests/bugs/871338-1-ref.html
Normal file
1
layout/reftests/bugs/871338-1-ref.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><body><div style="float: right"><span> <span id="comment-buttons-tools" style="display:inline-block">Report</span></span> <span>HoverMe</span></div>
|
1
layout/reftests/bugs/871338-1.html
Normal file
1
layout/reftests/bugs/871338-1.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><body onload="document.getElementById('comment-buttons-tools').style.display='inline-block'"><div style="float: right"><span> <span id="comment-buttons-tools" style="display:none">Report</span></span> <span>HoverMe</span></div>
|
@ -1758,3 +1758,4 @@ test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html
|
||||
== 849996-1.html 849996-1-ref.html
|
||||
== 858803-1.html 858803-1-ref.html
|
||||
!= 860370.html 860370-notref.html
|
||||
== 871338-1.html 871338-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user