mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Fixes bugs 301002, 206090, and 312021. Blocked tags were getting misordered.
lo_FinishLayout() was getting called multiple times. These fixes were migrated over from the 4.06 branch.
This commit is contained in:
parent
ad3409c277
commit
3858b3fd8f
@ -2502,7 +2502,7 @@ lo_FlushBlockage(MWContext *context, lo_DocState *state,
|
||||
tag_ptr = top_state->tags;
|
||||
|
||||
orig_state = top_state->doc_state;
|
||||
|
||||
|
||||
up_state = NULL;
|
||||
state = orig_state;
|
||||
while (state->sub_state != NULL)
|
||||
@ -2530,6 +2530,10 @@ lo_FlushBlockage(MWContext *context, lo_DocState *state,
|
||||
* Always keep top_state->tags sane
|
||||
*/
|
||||
top_state->tags = tag_ptr;
|
||||
if (tag_ptr == NULL)
|
||||
{
|
||||
top_state->tags_end = &top_state->tags;
|
||||
}
|
||||
|
||||
/*
|
||||
* Since script processing is asynchronous we need to do this
|
||||
@ -2738,7 +2742,8 @@ lo_FlushBlockage(MWContext *context, lo_DocState *state,
|
||||
|
||||
if ((top_state->layout_blocking_element == NULL)&&
|
||||
(top_state->tags == NULL)&&
|
||||
(top_state->layout_status == PA_COMPLETE))
|
||||
(top_state->layout_status == PA_COMPLETE) &&
|
||||
!top_state->finished)
|
||||
{
|
||||
/*
|
||||
* makes sure we are at the bottom
|
||||
@ -3687,15 +3692,23 @@ lo_FinishLayout(MWContext *context, lo_DocState *state, int32 mocha_event)
|
||||
if ((state != NULL) &&
|
||||
(state->top_state != NULL))
|
||||
{
|
||||
lo_CloseMochaWriteStream(state->top_state, mocha_event);
|
||||
lo_TopState * top_state = state->top_state;
|
||||
|
||||
/* only finish once, please */
|
||||
XP_ASSERT(!top_state->finished);
|
||||
if (top_state->finished)
|
||||
return;
|
||||
|
||||
top_state->finished = TRUE;
|
||||
lo_CloseMochaWriteStream(top_state, mocha_event);
|
||||
|
||||
/* Could be left over if someone forgets to close a tag */
|
||||
if (state->top_state->scriptData)
|
||||
lo_DestroyScriptData(state->top_state->scriptData);
|
||||
if (top_state->scriptData)
|
||||
lo_DestroyScriptData(top_state->scriptData);
|
||||
|
||||
/* Handle the page background for the case of a document that contains
|
||||
no displayed layout elements. */
|
||||
if (state->top_state->nothing_displayed != FALSE)
|
||||
if (top_state->nothing_displayed != FALSE)
|
||||
lo_use_default_doc_background(context, state);
|
||||
}
|
||||
|
||||
|
@ -792,6 +792,7 @@ struct lo_TopState_struct {
|
||||
PRPackedBool is_binary; /* hack for images instead of HTML doc */
|
||||
PRPackedBool insecure_images; /* secure doc with insecure images */
|
||||
PRPackedBool out_of_memory; /* ran out of memory mid-layout */
|
||||
PRPackedBool finished; /* lo_FinishLayout() has been called */
|
||||
NET_ReloadMethod
|
||||
force_reload; /* URL_Struct reload flag */
|
||||
intn auto_scroll; /* Chat auto-scrolling layout, # of lines */
|
||||
|
@ -423,16 +423,6 @@ done:
|
||||
stream.data_object=(pa_DocData *)top_state->doc_data;
|
||||
pa_FlushOverflow(&stream);
|
||||
|
||||
/*
|
||||
* The initial call to lo_UnblockLayout() might have not torn
|
||||
* everything down because we were waiting for the last
|
||||
* chunk of data to come out of the doc_data->overflow_buf
|
||||
* We need to get to lo_FlushedBlockedTags() and lo_FinishLayout()
|
||||
* at the bottom of lo_FlushBlockage().
|
||||
*/
|
||||
if (!top_state->layout_blocking_element)
|
||||
lo_FlushBlockage(context, top_state->doc_state, top_state->doc_state);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user