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