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

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: Improved check 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 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 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 if (bodyObject) 2315 if (bodyObject)
2316 return bodyObject; 2316 return bodyObject;
2317 } 2317 }
2318 2318
2319 return this; 2319 return this;
2320 } 2320 }
2321 2321
2322 RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation() const 2322 RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation() const
2323 { 2323 {
2324 // Respect the image's orientation if it's being used as a full-page image o r it's 2324 // Respect the image's orientation if it's being used as a full-page image o r it's
2325 // an <img> and the setting to respect it everywhere is set. 2325 // an <img> and the setting to respect it everywhere is set.
Noel Gordon 2015/06/12 16:21:04 Comment out of date.
rwlbuis 2015/06/15 17:21:52 Done.
2326 return document().isImageDocument() 2326 return document().isImageDocument()
Noel Gordon 2015/06/12 16:21:04 Let's break this up into individual if statements,
rwlbuis 2015/06/15 17:21:52 Done. Forgot about the breaking up though, will fi
2327 || (document().settings() && document().settings()->shouldRespectImageOr ientation() && isHTMLImageElement(node())) ? RespectImageOrientation : DoNotResp ectImageOrientation; 2327 || (((document().settings() && document().settings()->shouldRespectImage Orientation()) || (style() && style()->respectImageOrientation() == RespectImage Orientation)) && isHTMLImageElement(node())) ? RespectImageOrientation : DoNotRe spectImageOrientation;
2328
2328 } 2329 }
2329 2330
2330 LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat ionContainer, bool* paintInvalidationContainerSkipped) const 2331 LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat ionContainer, bool* paintInvalidationContainerSkipped) const
2331 { 2332 {
2332 if (paintInvalidationContainerSkipped) 2333 if (paintInvalidationContainerSkipped)
2333 *paintInvalidationContainerSkipped = false; 2334 *paintInvalidationContainerSkipped = false;
2334 2335
2335 // This method is extremely similar to containingBlock(), but with a few not able 2336 // This method is extremely similar to containingBlock(), but with a few not able
2336 // exceptions. 2337 // exceptions.
2337 // (1) It can be used on orphaned subtrees, i.e., it can be called safely ev en when 2338 // (1) It can be used on orphaned subtrees, i.e., it can be called safely ev en when
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
3309 const blink::LayoutObject* root = object1; 3310 const blink::LayoutObject* root = object1;
3310 while (root->parent()) 3311 while (root->parent())
3311 root = root->parent(); 3312 root = root->parent();
3312 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3313 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3313 } else { 3314 } else {
3314 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3315 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3315 } 3316 }
3316 } 3317 }
3317 3318
3318 #endif 3319 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698