Commit d6f37825 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Don't force ComputedStyle for dragged image.

EnsureComputedStyle() is for forcing a ComputedStyle on display:none
elements and should only be called when style is clean. Use
GetComputedStyle() instead. I'm not even sure if GetComputedStyle() can
ever be null here.

Bug: 895894
Change-Id: I4e5bc12a52464ec74a9d9d5e85d4f9900ce9ef4f
Reviewed-on: https://chromium-review.googlesource.com/c/1286137Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600421}
parent 6a96ae29
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "third_party/blink/renderer/core/dom/document_fragment.h" #include "third_party/blink/renderer/core/dom/document_fragment.h"
#include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node.h" #include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h" #include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/text.h" #include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/dom/user_gesture_indicator.h" #include "third_party/blink/renderer/core/dom/user_gesture_indicator.h"
...@@ -1053,11 +1054,12 @@ static std::unique_ptr<DragImage> DragImageForImage( ...@@ -1053,11 +1054,12 @@ static std::unique_ptr<DragImage> DragImageForImage(
image = svg_image.get(); image = svg_image.get();
} }
InterpolationQuality interpolation_quality = InterpolationQuality interpolation_quality = kInterpolationDefault;
element->EnsureComputedStyle()->ImageRendering() == if (const ComputedStyle* style = element->GetComputedStyle()) {
EImageRendering::kPixelated if (style->ImageRendering() == EImageRendering::kPixelated)
? kInterpolationNone interpolation_quality = kInterpolationNone;
: kInterpolationDefault; }
RespectImageOrientationEnum should_respect_image_orientation = RespectImageOrientationEnum should_respect_image_orientation =
LayoutObject::ShouldRespectImageOrientation(element->GetLayoutObject()); LayoutObject::ShouldRespectImageOrientation(element->GetLayoutObject());
ImageOrientation orientation; ImageOrientation orientation;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment