| OLD | NEW |
| 1 /** | 1 /** |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 inline const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& StyleSheetList::
styleSheets() | 43 inline const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& StyleSheetList::
styleSheets() |
| 44 { | 44 { |
| 45 if (!m_treeScope) | 45 if (!m_treeScope) |
| 46 return m_detachedStyleSheets; | 46 return m_detachedStyleSheets; |
| 47 return document()->styleEngine()->styleSheetsForStyleSheetList(*m_treeScope)
; | 47 return document()->styleEngine()->styleSheetsForStyleSheetList(*m_treeScope)
; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void StyleSheetList::detachFromDocument() | 50 void StyleSheetList::detachFromDocument() |
| 51 { | 51 { |
| 52 // FIXME: Oilpan: This is safe currently because the Document is |
| 53 // *not* in the oilpan heap and the style engine is alive when the |
| 54 // document dies. When the Document is in the oilpan heap, we need |
| 55 // the StyleSheetList and the document to die together and get rid |
| 56 // of the detachedStyleSheets. |
| 52 m_detachedStyleSheets = document()->styleEngine()->styleSheetsForStyleSheetL
ist(*m_treeScope); | 57 m_detachedStyleSheets = document()->styleEngine()->styleSheetsForStyleSheetL
ist(*m_treeScope); |
| 53 m_treeScope = 0; | 58 m_treeScope = 0; |
| 54 } | 59 } |
| 55 | 60 |
| 56 unsigned StyleSheetList::length() | 61 unsigned StyleSheetList::length() |
| 57 { | 62 { |
| 58 return styleSheets().size(); | 63 return styleSheets().size(); |
| 59 } | 64 } |
| 60 | 65 |
| 61 StyleSheet* StyleSheetList::item(unsigned index) | 66 StyleSheet* StyleSheetList::item(unsigned index) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 86 return 0; | 91 return 0; |
| 87 return item->sheet(); | 92 return item->sheet(); |
| 88 } | 93 } |
| 89 | 94 |
| 90 void StyleSheetList::trace(Visitor* visitor) | 95 void StyleSheetList::trace(Visitor* visitor) |
| 91 { | 96 { |
| 92 visitor->trace(m_detachedStyleSheets); | 97 visitor->trace(m_detachedStyleSheets); |
| 93 } | 98 } |
| 94 | 99 |
| 95 } // namespace WebCore | 100 } // namespace WebCore |
| OLD | NEW |