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

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: Address even more review comments Created 5 years, 6 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 e96113c8527123bac9e23bd9410e148474f9f1a9..170944915842b2e3ae76e420340ca5ab7c178268 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -2292,9 +2292,19 @@ 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;
+ // an <img> and image-orientation: from-image is set.
+ // FIXME: crbug.com/498233
Noel Gordon 2015/06/19 07:41:25 // Respect the image's orientation if it's being u
rwlbuis 2015/06/19 16:03:15 Oh, missed this.... but it will be easy to fix.
Noel Gordon 2015/06/19 16:50:07 Ok, let's do it next round.
+ bool respectOrientation = false;
+ if (document().isImageDocument()) {
+ respectOrientation = true;
Noel Gordon 2015/06/19 07:41:25 nit: this code might read better of your preferred
rwlbuis 2015/06/19 16:03:15 Great suggestion, I think it looks much clearer, d
+ } else if (isHTMLImageElement(node())) {
+ if (document().settings() && document().settings()->shouldRespectImageOrientation())
+ respectOrientation = true;
+ else if (style() && style()->respectImageOrientation() == RespectImageOrientation)
+ respectOrientation = true;
+ }
+
+ return respectOrientation ? RespectImageOrientation : DoNotRespectImageOrientation;
}
LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const

Powered by Google App Engine
This is Rietveld 408576698