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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 const LayoutObject* object = this; 2258 const LayoutObject* object = this;
2259 while (object->parent() && !object->hasLayer()) 2259 while (object->parent() && !object->hasLayer())
2260 object = object->parent(); 2260 object = object->parent();
2261 if (object->hasLayer()) 2261 if (object->hasLayer())
2262 return toLayoutBoxModelObject(object)->layer()->root()->isRootLayer(); 2262 return toLayoutBoxModelObject(object)->layer()->root()->isRootLayer();
2263 return false; 2263 return false;
2264 } 2264 }
2265 2265
2266 RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation() const 2266 RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation() const
2267 { 2267 {
2268 // Respect the image's orientation if it's being used as a full-page image o r it's 2268 // Respect the image's orientation if it's being used as a full-page image o r
2269 // an <img> and the setting to respect it everywhere is set. 2269 // it's an <img> and the setting to respect it everywhere is set or the <img >
2270 return document().isImageDocument() 2270 // has image-orientation: from-image style. FIXME: crbug.com/498233
2271 || (document().settings() && document().settings()->shouldRespectImageOr ientation() && isHTMLImageElement(node())) ? RespectImageOrientation : DoNotResp ectImageOrientation; 2271 if (document().isImageDocument())
2272 return RespectImageOrientation;
2273
2274 if (!isHTMLImageElement(node()))
2275 return DoNotRespectImageOrientation;
2276
2277 if (document().settings() && document().settings()->shouldRespectImageOrient ation())
2278 return RespectImageOrientation;
2279
2280 if (style() && style()->respectImageOrientation() == RespectImageOrientation )
2281 return RespectImageOrientation;
2282
2283 return DoNotRespectImageOrientation;
2272 } 2284 }
2273 2285
2274 LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat ionContainer, bool* paintInvalidationContainerSkipped) const 2286 LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat ionContainer, bool* paintInvalidationContainerSkipped) const
2275 { 2287 {
2276 if (paintInvalidationContainerSkipped) 2288 if (paintInvalidationContainerSkipped)
2277 *paintInvalidationContainerSkipped = false; 2289 *paintInvalidationContainerSkipped = false;
2278 2290
2279 // This method is extremely similar to containingBlock(), but with a few not able 2291 // This method is extremely similar to containingBlock(), but with a few not able
2280 // exceptions. 2292 // exceptions.
2281 // (1) It can be used on orphaned subtrees, i.e., it can be called safely ev en when 2293 // (1) It can be used on orphaned subtrees, i.e., it can be called safely ev en when
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
3355 const blink::LayoutObject* root = object1; 3367 const blink::LayoutObject* root = object1;
3356 while (root->parent()) 3368 while (root->parent())
3357 root = root->parent(); 3369 root = root->parent();
3358 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3370 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3359 } else { 3371 } else {
3360 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3372 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3361 } 3373 }
3362 } 3374 }
3363 3375
3364 #endif 3376 #endif
OLDNEW
« 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