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 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3279 // Ids stop style sharing if they show up in the stylesheets. | 3279 // Ids stop style sharing if they show up in the stylesheets. |
3280 if (hasID() && document().ensureStyleResolver().hasRulesForId(idForStyleReso
lution())) | 3280 if (hasID() && document().ensureStyleResolver().hasRulesForId(idForStyleReso
lution())) |
3281 return false; | 3281 return false; |
3282 // :active and :hover elements always make a chain towards the document node | 3282 // :active and :hover elements always make a chain towards the document node |
3283 // and no siblings or cousins will have the same state. There's also only on
e | 3283 // and no siblings or cousins will have the same state. There's also only on
e |
3284 // :focus element per scope so we don't need to attempt to share. | 3284 // :focus element per scope so we don't need to attempt to share. |
3285 if (isUserActionElement()) | 3285 if (isUserActionElement()) |
3286 return false; | 3286 return false; |
3287 if (!parentOrShadowHostElement()->childrenSupportStyleSharing()) | 3287 if (!parentOrShadowHostElement()->childrenSupportStyleSharing()) |
3288 return false; | 3288 return false; |
3289 if (hasScopedHTMLStyleChild()) | |
3290 return false; | |
3291 if (this == document().cssTarget()) | 3289 if (this == document().cssTarget()) |
3292 return false; | 3290 return false; |
3293 if (isHTMLElement() && toHTMLElement(this)->hasDirectionAuto()) | 3291 if (isHTMLElement() && toHTMLElement(this)->hasDirectionAuto()) |
3294 return false; | 3292 return false; |
3295 if (hasActiveAnimations()) | 3293 if (hasActiveAnimations()) |
3296 return false; | 3294 return false; |
3297 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. | 3295 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. |
3298 // See comments in RenderObject::setStyle(). | 3296 // See comments in RenderObject::setStyle(). |
3299 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? | 3297 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? |
3300 if (isHTMLFrameElementBase(*this) | 3298 if (isHTMLFrameElementBase(*this) |
3301 || isHTMLEmbedElement(*this) | 3299 || isHTMLEmbedElement(*this) |
3302 || isHTMLObjectElement(*this) | 3300 || isHTMLObjectElement(*this) |
3303 || isHTMLAppletElement(*this) | 3301 || isHTMLAppletElement(*this) |
3304 || isHTMLCanvasElement(*this)) | 3302 || isHTMLCanvasElement(*this)) |
3305 return false; | 3303 return false; |
3306 if (FullscreenElementStack::isActiveFullScreenElement(this)) | 3304 if (FullscreenElementStack::isActiveFullScreenElement(this)) |
3307 return false; | 3305 return false; |
3308 return true; | 3306 return true; |
3309 } | 3307 } |
3310 | 3308 |
3311 void Element::trace(Visitor* visitor) | 3309 void Element::trace(Visitor* visitor) |
3312 { | 3310 { |
3313 if (hasRareData()) | 3311 if (hasRareData()) |
3314 visitor->trace(elementRareData()); | 3312 visitor->trace(elementRareData()); |
3315 | 3313 |
3316 ContainerNode::trace(visitor); | 3314 ContainerNode::trace(visitor); |
3317 } | 3315 } |
3318 | 3316 |
3319 } // namespace WebCore | 3317 } // namespace WebCore |
OLD | NEW |