Index: Source/core/layout/LayoutObject.cpp |
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp |
index 16ac690af84b0a27f460326e1de36c246c25bb80..ab0a6d14d4b9b737a5ca678177973c80bbf19327 100644 |
--- a/Source/core/layout/LayoutObject.cpp |
+++ b/Source/core/layout/LayoutObject.cpp |
@@ -2321,10 +2321,22 @@ bool LayoutObject::isRooted() const |
RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation() const |
{ |
- // Respect the image's orientation if it's being used as a full-page image or it's |
- // an <img> and the setting to respect it everywhere is set. |
- return document().isImageDocument() |
- || (document().settings() && document().settings()->shouldRespectImageOrientation() && isHTMLImageElement(node())) ? RespectImageOrientation : DoNotRespectImageOrientation; |
+ // Respect the image's orientation if it's being used as a full-page image or |
+ // it's an <img> and the setting to respect it everywhere is set or the <img> |
+ // has image-orientation: from-image style. FIXME: crbug.com/498233 |
+ if (document().isImageDocument()) |
+ return RespectImageOrientation; |
+ |
+ if (!isHTMLImageElement(node())) |
+ return DoNotRespectImageOrientation; |
+ |
+ if (document().settings() && document().settings()->shouldRespectImageOrientation()) |
+ return RespectImageOrientation; |
+ |
+ if (style() && style()->respectImageOrientation() == RespectImageOrientation) |
+ return RespectImageOrientation; |
+ |
+ return DoNotRespectImageOrientation; |
} |
LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const |