зеркало из https://github.com/mozilla/pjs.git
Added code to just lay out an image and mark the context as requiring reflow when an unsized image is encountered. Also, dont bother calling LO_SetImageInfo() if w/h hasnt changed. r=nisheeth,mjudge
This commit is contained in:
Родитель
c432f369ed
Коммит
fb03cea4b6
|
@ -1467,13 +1467,16 @@ lo_PartialFormatImage(MWContext *context, lo_DocState *state, PA_Tag *tag)
|
|||
* We may have to block on this image until later
|
||||
* when the front end can give us the width and height.
|
||||
*/
|
||||
if ((image->width == 0)||(image->height == 0))
|
||||
if (((image->width == 0)||(image->height == 0))
|
||||
&& EDT_IS_EDITOR(context))
|
||||
{
|
||||
state->top_state->layout_blocking_element = (LO_Element *)image;
|
||||
}
|
||||
else
|
||||
{
|
||||
lo_FinishImage(context, state, image);
|
||||
if ((image->width == 0) || (image->height == 0))
|
||||
context->requires_reflow = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2107,7 +2110,8 @@ lo_FormatImage(MWContext *context, lo_DocState *state, PA_Tag *tag)
|
|||
* We may have to block on this image until later
|
||||
* when the front end can give us the width and height.
|
||||
*/
|
||||
if ((image->width == 0)||(image->height == 0))
|
||||
if (((image->width == 0)||(image->height == 0))
|
||||
&& EDT_IS_EDITOR(context))
|
||||
{
|
||||
/* If a lowres image has been specified, we'll actually be
|
||||
blocking on that, not the real (hires) url */
|
||||
|
@ -2118,6 +2122,8 @@ lo_FormatImage(MWContext *context, lo_DocState *state, PA_Tag *tag)
|
|||
else
|
||||
{
|
||||
lo_FinishImage(context, state, image);
|
||||
if ((image->width == 0) || (image->height == 0))
|
||||
context->requires_reflow = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2732,6 +2738,14 @@ lo_image_dimensions(MWContext *context, LO_ImageStruct *lo_image,
|
|||
|
||||
width = FEUNITS_X(width, context);
|
||||
height = FEUNITS_Y(height, context);
|
||||
|
||||
/* No need to change the image info if the image's size has
|
||||
remained the same. */
|
||||
if ((lo_image->width == width) &&
|
||||
(lo_image->height == height)) {
|
||||
return;
|
||||
}
|
||||
|
||||
lo_image->width = width;
|
||||
lo_image->height = height;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче