Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1251)

Unified Diff: Source/core/layout/LayoutObject.cpp

Issue 1162793003: Add CSS image-orientation: from-image (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add runtime flag Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698