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

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 converter 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 4b85023fd7fd3510d65468c96ff69f8cfa548377..8f3a565833c73dd56c1c393766d4e8c659783375 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -2265,10 +2265,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
« no previous file with comments | « Source/core/layout/LayoutImage.cpp ('k') | Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698