Chromium Code Reviews| 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 |