зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1639963 - Define the default size for replaced elements. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D81006
This commit is contained in:
Родитель
cb69cd917a
Коммит
5b6832c5f3
|
@ -28,4 +28,10 @@
|
||||||
|
|
||||||
#define NS_INTRINSIC_ISIZE_UNKNOWN nscoord_MIN
|
#define NS_INTRINSIC_ISIZE_UNKNOWN nscoord_MIN
|
||||||
|
|
||||||
|
// The fallback size of width is 300px and the aspect-ratio is 2:1, based on the
|
||||||
|
// spec definition in CSS2 section 10.3.2:
|
||||||
|
// https://drafts.csswg.org/css2/visudet.html#inline-replaced-width
|
||||||
|
#define REPLACED_ELEM_FALLBACK_PX_WIDTH 300
|
||||||
|
#define REPLACED_ELEM_FALLBACK_PX_HEIGHT 150
|
||||||
|
|
||||||
#endif // LayoutConstants_h___
|
#endif // LayoutConstants_h___
|
||||||
|
|
|
@ -624,9 +624,11 @@ IntrinsicSize nsSubDocumentFrame::GetIntrinsicSize() {
|
||||||
return {}; // XUL <iframe> and <browser> have no useful intrinsic size
|
return {}; // XUL <iframe> and <browser> have no useful intrinsic size
|
||||||
}
|
}
|
||||||
|
|
||||||
// We must be an HTML <iframe>. Default to size of 300px x 150px, for IE
|
// We must be an HTML <iframe>. Default to size of
|
||||||
// compat (and per CSS2.1 draft)
|
// REPLACED_ELEM_FALLBACK_PX_WIDTH x REPLACED_ELEM_FALLBACK_PX_HEIGHT (i.e.
|
||||||
return IntrinsicSize(CSSPixel::ToAppUnits(300), CSSPixel::ToAppUnits(150));
|
// 300px x 150px), for IE compat (and per CSS2.1 draft)
|
||||||
|
return IntrinsicSize(CSSPixel::ToAppUnits(REPLACED_ELEM_FALLBACK_PX_WIDTH),
|
||||||
|
CSSPixel::ToAppUnits(REPLACED_ELEM_FALLBACK_PX_HEIGHT));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
|
|
|
@ -671,8 +671,8 @@ nsSize nsVideoFrame::GetVideoIntrinsicSize(gfxContext* aRenderingContext) {
|
||||||
return nsSize(0, 0);
|
return nsSize(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defaulting size to 300x150 if no size given.
|
nsIntSize size(REPLACED_ELEM_FALLBACK_PX_WIDTH,
|
||||||
nsIntSize size(300, 150);
|
REPLACED_ELEM_FALLBACK_PX_HEIGHT);
|
||||||
|
|
||||||
HTMLVideoElement* element = static_cast<HTMLVideoElement*>(GetContent());
|
HTMLVideoElement* element = static_cast<HTMLVideoElement*>(GetContent());
|
||||||
if (NS_FAILED(element->GetVideoSize(&size)) && ShouldDisplayPoster()) {
|
if (NS_FAILED(element->GetVideoSize(&size)) && ShouldDisplayPoster()) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче