| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 if (!m_styleSharingLists[depth]) | 215 if (!m_styleSharingLists[depth]) |
| 216 m_styleSharingLists[depth] = new StyleSharingList; | 216 m_styleSharingLists[depth] = new StyleSharingList; |
| 217 return *m_styleSharingLists[depth]; | 217 return *m_styleSharingLists[depth]; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void StyleResolver::clearStyleSharingList() { | 220 void StyleResolver::clearStyleSharingList() { |
| 221 m_styleSharingLists.resize(0); | 221 m_styleSharingLists.resize(0); |
| 222 } | 222 } |
| 223 | 223 |
| 224 static inline ScopedStyleResolver* scopedResolverFor(const Element& element) { | 224 static inline ScopedStyleResolver* scopedResolverFor(const Element& element) { |
| 225 // Ideally, returning element->treeScope().scopedStyleResolver() should be | 225 // For normal elements, returning element->treeScope().scopedStyleResolver() |
| 226 // enough, but ::cue and custom pseudo elements like ::-webkit-meter-bar | 226 // is enough. Rules for ::cue and custom pseudo elements like |
| 227 // pierce through a shadow dom boundary, yet they are not part of boundary | 227 // ::-webkit-meter-bar pierce through a single shadow dom boundary and apply |
| 228 // crossing rules. The assumption here is that these rules only pierce through | 228 // to elements in sub-scopes. |
| 229 // one boundary and that the scope of these elements do not have a style | 229 // |
| 230 // resolver due to the fact that VTT scopes and UA shadow trees don't have | 230 // An assumption here is that these elements belong to scopes without a |
| 231 // <style> elements. This is backed up by the DCHECKs below. | 231 // ScopedStyleResolver due to the fact that VTT scopes and UA shadow trees |
| 232 // don't have <style> or <link> elements. This is backed up by the DCHECKs |
| 233 // below. |
| 232 | 234 |
| 233 TreeScope* treeScope = &element.treeScope(); | 235 TreeScope* treeScope = &element.treeScope(); |
| 234 if (ScopedStyleResolver* resolver = treeScope->scopedStyleResolver()) { | 236 if (ScopedStyleResolver* resolver = treeScope->scopedStyleResolver()) { |
| 235 DCHECK(element.shadowPseudoId().isEmpty()); | 237 DCHECK(element.shadowPseudoId().isEmpty()); |
| 236 DCHECK(!element.isVTTElement()); | 238 DCHECK(!element.isVTTElement()); |
| 237 return resolver; | 239 return resolver; |
| 238 } | 240 } |
| 239 | 241 |
| 240 treeScope = treeScope->parentTreeScope(); | 242 treeScope = treeScope->parentTreeScope(); |
| 241 if (!treeScope) | 243 if (!treeScope) |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1963 | 1965 |
| 1964 DEFINE_TRACE(StyleResolver) { | 1966 DEFINE_TRACE(StyleResolver) { |
| 1965 visitor->trace(m_matchedPropertiesCache); | 1967 visitor->trace(m_matchedPropertiesCache); |
| 1966 visitor->trace(m_selectorFilter); | 1968 visitor->trace(m_selectorFilter); |
| 1967 visitor->trace(m_styleSharingLists); | 1969 visitor->trace(m_styleSharingLists); |
| 1968 visitor->trace(m_document); | 1970 visitor->trace(m_document); |
| 1969 visitor->trace(m_tracker); | 1971 visitor->trace(m_tracker); |
| 1970 } | 1972 } |
| 1971 | 1973 |
| 1972 } // namespace blink | 1974 } // namespace blink |
| OLD | NEW |