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) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
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 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1274 #endif | 1274 #endif |
1275 } | 1275 } |
1276 | 1276 |
1277 void Element::createRendererIfNeeded() | 1277 void Element::createRendererIfNeeded() |
1278 { | 1278 { |
1279 NodeRenderingContext(this).createRendererForElementIfNeeded(); | 1279 NodeRenderingContext(this).createRendererForElementIfNeeded(); |
1280 } | 1280 } |
1281 | 1281 |
1282 void Element::attach() | 1282 void Element::attach() |
1283 { | 1283 { |
1284 // We update the style in the document if needed so that our parent style | |
1285 // is always up to date before creating our renderer otherwise our style | |
1286 // can inherit the wrong values. If we end up updating the style we'll | |
1287 // also get attached. | |
1288 document()->updateStyleIfNeeded(); | |
eseidel
2013/05/12 09:24:58
This only occurs for Elements, since they're the o
| |
1289 if (attached()) | |
1290 return; | |
1291 | |
1284 PostAttachCallbackDisabler callbackDisabler(this); | 1292 PostAttachCallbackDisabler callbackDisabler(this); |
1285 StyleResolverParentPusher parentPusher(this); | 1293 StyleResolverParentPusher parentPusher(this); |
1286 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; | 1294 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; |
1287 | 1295 |
1288 createRendererIfNeeded(); | 1296 createRendererIfNeeded(); |
1289 | 1297 |
1290 if (parentElement() && parentElement()->isInCanvasSubtree()) | 1298 if (parentElement() && parentElement()->isInCanvasSubtree()) |
1291 setIsInCanvasSubtree(true); | 1299 setIsInCanvasSubtree(true); |
1292 | 1300 |
1293 createPseudoElementIfNeeded(BEFORE); | 1301 createPseudoElementIfNeeded(BEFORE); |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3141 return 0; | 3149 return 0; |
3142 } | 3150 } |
3143 | 3151 |
3144 Attribute* UniqueElementData::attributeItem(unsigned index) | 3152 Attribute* UniqueElementData::attributeItem(unsigned index) |
3145 { | 3153 { |
3146 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); | 3154 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); |
3147 return &m_attributeVector.at(index); | 3155 return &m_attributeVector.at(index); |
3148 } | 3156 } |
3149 | 3157 |
3150 } // namespace WebCore | 3158 } // namespace WebCore |
OLD | NEW |