Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 #endif | 114 #endif |
| 115 | 115 |
| 116 static const RenderObject* parentElementRenderer(const RenderObject* renderer) | 116 static const RenderObject* parentElementRenderer(const RenderObject* renderer) |
| 117 { | 117 { |
| 118 // At style recalc, the renderer's parent may not be attached, | 118 // At style recalc, the renderer's parent may not be attached, |
| 119 // so we need to obtain this from the DOM tree. | 119 // so we need to obtain this from the DOM tree. |
| 120 const Node* node = renderer->node(); | 120 const Node* node = renderer->node(); |
| 121 if (!node) | 121 if (!node) |
| 122 return 0; | 122 return 0; |
| 123 | 123 |
| 124 for (node = node->parentNode(); node; node = node->parentNode()) { | 124 if (Element* parent = node->parentElement()) |
| 125 if (node->isElementNode()) | 125 return parent->renderer(); |
|
esprehn
2014/08/19 01:02:45
This code is wrong, add a FIXME: That it should be
Inactive
2014/08/19 12:51:45
Done.
| |
| 126 return node->renderer(); | |
| 127 } | |
| 128 return 0; | 126 return 0; |
| 129 } | 127 } |
| 130 | 128 |
| 131 static bool isNonTextAreaFormControl(const RenderObject* renderer) | 129 static bool isNonTextAreaFormControl(const RenderObject* renderer) |
| 132 { | 130 { |
| 133 const Node* node = renderer ? renderer->node() : 0; | 131 const Node* node = renderer ? renderer->node() : 0; |
| 134 if (!node || !node->isElementNode()) | 132 if (!node || !node->isElementNode()) |
| 135 return false; | 133 return false; |
| 136 const Element* element = toElement(node); | 134 const Element* element = toElement(node); |
| 137 | 135 |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1152 } | 1150 } |
| 1153 return computedSize; | 1151 return computedSize; |
| 1154 } | 1152 } |
| 1155 | 1153 |
| 1156 void TextAutosizer::trace(Visitor* visitor) | 1154 void TextAutosizer::trace(Visitor* visitor) |
| 1157 { | 1155 { |
| 1158 visitor->trace(m_document); | 1156 visitor->trace(m_document); |
| 1159 } | 1157 } |
| 1160 | 1158 |
| 1161 } // namespace blink | 1159 } // namespace blink |
| OLD | NEW |