OLD | NEW |
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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 | 2148 |
2149 if (!o->isRenderView()) | 2149 if (!o->isRenderView()) |
2150 return false; | 2150 return false; |
2151 | 2151 |
2152 if (view) | 2152 if (view) |
2153 *view = toRenderView(o); | 2153 *view = toRenderView(o); |
2154 | 2154 |
2155 return true; | 2155 return true; |
2156 } | 2156 } |
2157 | 2157 |
2158 Node* RenderObject::styledGeneratingNode() const | |
2159 { | |
2160 Node* node = generatingNode(); | |
2161 if (node) | |
2162 return node; | |
2163 | |
2164 for (RenderObject* object = parent(); object; object = object->parent()) { | |
2165 if (Node* node = object->generatingNode()) | |
2166 return node; | |
2167 } | |
2168 | |
2169 ASSERT_NOT_REACHED(); | |
2170 return 0; | |
2171 } | |
2172 | |
2173 RenderObject* RenderObject::rendererForRootBackground() | 2158 RenderObject* RenderObject::rendererForRootBackground() |
2174 { | 2159 { |
2175 ASSERT(isRoot()); | 2160 ASSERT(isRoot()); |
2176 if (!hasBackground() && node() && node()->hasTagName(HTMLNames::htmlTag)) { | 2161 if (!hasBackground() && node() && node()->hasTagName(HTMLNames::htmlTag)) { |
2177 // Locate the <body> element using the DOM. This is easier than trying | 2162 // Locate the <body> element using the DOM. This is easier than trying |
2178 // to crawl around a render tree with potential :before/:after content a
nd | 2163 // to crawl around a render tree with potential :before/:after content a
nd |
2179 // anonymous blocks created by inline <body> tags etc. We can locate the
<body> | 2164 // anonymous blocks created by inline <body> tags etc. We can locate the
<body> |
2180 // render object very easily via the DOM. | 2165 // render object very easily via the DOM. |
2181 HTMLElement* body = document()->body(); | 2166 HTMLElement* body = document()->body(); |
2182 RenderObject* bodyObject = (body && body->hasLocalName(bodyTag)) ? body-
>renderer() : 0; | 2167 RenderObject* bodyObject = (body && body->hasLocalName(bodyTag)) ? body-
>renderer() : 0; |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2956 { | 2941 { |
2957 if (object1) { | 2942 if (object1) { |
2958 const WebCore::RenderObject* root = object1; | 2943 const WebCore::RenderObject* root = object1; |
2959 while (root->parent()) | 2944 while (root->parent()) |
2960 root = root->parent(); | 2945 root = root->parent(); |
2961 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 2946 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
2962 } | 2947 } |
2963 } | 2948 } |
2964 | 2949 |
2965 #endif | 2950 #endif |
OLD | NEW |