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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1463793002: Simplify ImageResource::canRender() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 } 949 }
950 950
951 bool LayoutObject::mustInvalidateFillLayersPaintOnHeightChange(const FillLayer& layer) const 951 bool LayoutObject::mustInvalidateFillLayersPaintOnHeightChange(const FillLayer& layer) const
952 { 952 {
953 // Nobody will use multiple layers without wanting fancy positioning. 953 // Nobody will use multiple layers without wanting fancy positioning.
954 if (layer.next()) 954 if (layer.next())
955 return true; 955 return true;
956 956
957 // Make sure we have a valid image. 957 // Make sure we have a valid image.
958 StyleImage* img = layer.image(); 958 StyleImage* img = layer.image();
959 if (!img || !img->canRender(*this, style()->effectiveZoom())) 959 if (!img || !img->canRender())
960 return false; 960 return false;
961 961
962 if (layer.repeatY() != RepeatFill && layer.repeatY() != NoRepeatFill) 962 if (layer.repeatY() != RepeatFill && layer.repeatY() != NoRepeatFill)
963 return true; 963 return true;
964 964
965 // TODO(alancutter): Make this work correctly for calc lengths. 965 // TODO(alancutter): Make this work correctly for calc lengths.
966 if (layer.yPosition().hasPercent() && !layer.yPosition().isZero()) 966 if (layer.yPosition().hasPercent() && !layer.yPosition().isZero())
967 return true; 967 return true;
968 968
969 if (layer.backgroundYOrigin() != TopEdge) 969 if (layer.backgroundYOrigin() != TopEdge)
(...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after
3488 const blink::LayoutObject* root = object1; 3488 const blink::LayoutObject* root = object1;
3489 while (root->parent()) 3489 while (root->parent())
3490 root = root->parent(); 3490 root = root->parent();
3491 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3491 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3492 } else { 3492 } else {
3493 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3493 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3494 } 3494 }
3495 } 3495 }
3496 3496
3497 #endif 3497 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698