summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/layout_video.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-20 13:40:20 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-22 12:41:23 +0000
commit7961cea6d1041e3e454dae6a1da660b453efd238 (patch)
treec0eeb4a9ff9ba32986289c1653d9608e53ccb444 /chromium/third_party/blink/renderer/core/layout/layout_video.cc
parentb7034d0803538058e5c9d904ef03cf5eab34f6ef (diff)
downloadqtwebengine-chromium-7961cea6d1041e3e454dae6a1da660b453efd238.tar.gz
BASELINE: Update Chromium to 78.0.3904.130
Change-Id: If185e0c0061b3437531c97c9c8c78f239352a68b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/layout_video.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/layout_video.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_video.cc b/chromium/third_party/blink/renderer/core/layout/layout_video.cc
index bd0965b3e0d..6f50070e634 100644
--- a/chromium/third_party/blink/renderer/core/layout/layout_video.cc
+++ b/chromium/third_party/blink/renderer/core/layout/layout_video.cc
@@ -46,10 +46,10 @@ LayoutSize LayoutVideo::DefaultSize() {
void LayoutVideo::IntrinsicSizeChanged() {
if (VideoElement()->ShouldDisplayPosterImage())
LayoutMedia::IntrinsicSizeChanged();
- UpdateIntrinsicSize();
+ UpdateIntrinsicSize(/* is_in_layout */ false);
}
-void LayoutVideo::UpdateIntrinsicSize() {
+void LayoutVideo::UpdateIntrinsicSize(bool is_in_layout) {
LayoutSize size = CalculateIntrinsicSize();
size.Scale(StyleRef().EffectiveZoom());
@@ -63,8 +63,10 @@ void LayoutVideo::UpdateIntrinsicSize() {
SetIntrinsicSize(size);
SetPreferredLogicalWidthsDirty();
- SetNeedsLayoutAndFullPaintInvalidation(
- layout_invalidation_reason::kSizeChanged);
+ if (!is_in_layout) {
+ SetNeedsLayoutAndFullPaintInvalidation(
+ layout_invalidation_reason::kSizeChanged);
+ }
}
LayoutSize LayoutVideo::CalculateIntrinsicSize() {
@@ -114,7 +116,7 @@ void LayoutVideo::ImageChanged(WrappedImagePtr new_image,
// The intrinsic size is now that of the image, but in case we already had the
// intrinsic size of the video we call this here to restore the video size.
- UpdateIntrinsicSize();
+ UpdateIntrinsicSize(/* is_in_layout */ false);
}
bool LayoutVideo::ShouldDisplayVideo() const {
@@ -127,7 +129,7 @@ void LayoutVideo::PaintReplaced(const PaintInfo& paint_info,
}
void LayoutVideo::UpdateLayout() {
- UpdatePlayer();
+ UpdatePlayer(/* is_in_layout */ true);
LayoutMedia::UpdateLayout();
}
@@ -137,14 +139,14 @@ HTMLVideoElement* LayoutVideo::VideoElement() const {
void LayoutVideo::UpdateFromElement() {
LayoutMedia::UpdateFromElement();
- UpdatePlayer();
+ UpdatePlayer(/* is_in_layout */ false);
// If the DisplayMode of the video changed, then we need to paint.
SetShouldDoFullPaintInvalidation();
}
-void LayoutVideo::UpdatePlayer() {
- UpdateIntrinsicSize();
+void LayoutVideo::UpdatePlayer(bool is_in_layout) {
+ UpdateIntrinsicSize(is_in_layout);
WebMediaPlayer* media_player = MediaElement()->GetWebMediaPlayer();
if (!media_player)