| 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, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 RefPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.string
(), parserContext); | 98 RefPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.string
(), parserContext); |
| 99 return adoptRef(new CSSStyleSheet(sheet.release(), ownerNode, true, startPos
ition)); | 99 return adoptRef(new CSSStyleSheet(sheet.release(), ownerNode, true, startPos
ition)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents) | 102 CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents) |
| 103 : m_contents(contents) | 103 : m_contents(contents) |
| 104 , m_isInlineStylesheet(false) | 104 , m_isInlineStylesheet(false) |
| 105 , m_ownerNode(nullptr) | 105 , m_ownerNode(nullptr) |
| 106 , m_startPosition(TextPosition::minimumPosition()) | 106 , m_startPosition(TextPosition::minimumPosition()) |
| 107 { | 107 { |
| 108 ScriptWrappable::init(this); | |
| 109 m_contents->registerClient(this); | 108 m_contents->registerClient(this); |
| 110 } | 109 } |
| 111 | 110 |
| 112 CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, Node* owne
rNode, bool isInlineStylesheet, const TextPosition& startPosition) | 111 CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, Node* owne
rNode, bool isInlineStylesheet, const TextPosition& startPosition) |
| 113 : m_contents(contents) | 112 : m_contents(contents) |
| 114 , m_isInlineStylesheet(isInlineStylesheet) | 113 , m_isInlineStylesheet(isInlineStylesheet) |
| 115 , m_ownerNode(ownerNode) | 114 , m_ownerNode(ownerNode) |
| 116 , m_startPosition(startPosition) | 115 , m_startPosition(startPosition) |
| 117 { | 116 { |
| 118 ScriptWrappable::init(this); | |
| 119 ASSERT(isAcceptableCSSStyleSheetParent(ownerNode)); | 117 ASSERT(isAcceptableCSSStyleSheetParent(ownerNode)); |
| 120 m_contents->registerClient(this); | 118 m_contents->registerClient(this); |
| 121 } | 119 } |
| 122 | 120 |
| 123 CSSStyleSheet::~CSSStyleSheet() | 121 CSSStyleSheet::~CSSStyleSheet() |
| 124 { | 122 { |
| 125 // With oilpan the parent style sheet pointer is strong and the sheet and | 123 // With oilpan the parent style sheet pointer is strong and the sheet and |
| 126 // its RuleCSSOMWrappers die together and we don't need to clear them here. | 124 // its RuleCSSOMWrappers die together and we don't need to clear them here. |
| 127 // Also with oilpan the StyleSheetContents client pointers are weak and | 125 // Also with oilpan the StyleSheetContents client pointers are weak and |
| 128 // therefore do not need to be cleared here. | 126 // therefore do not need to be cleared here. |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 visitor->trace(m_contents); | 356 visitor->trace(m_contents); |
| 359 visitor->trace(m_mediaQueries); | 357 visitor->trace(m_mediaQueries); |
| 360 visitor->trace(m_ownerNode); | 358 visitor->trace(m_ownerNode); |
| 361 visitor->trace(m_mediaCSSOMWrapper); | 359 visitor->trace(m_mediaCSSOMWrapper); |
| 362 visitor->trace(m_childRuleCSSOMWrappers); | 360 visitor->trace(m_childRuleCSSOMWrappers); |
| 363 visitor->trace(m_ruleListCSSOMWrapper); | 361 visitor->trace(m_ruleListCSSOMWrapper); |
| 364 StyleSheet::trace(visitor); | 362 StyleSheet::trace(visitor); |
| 365 } | 363 } |
| 366 | 364 |
| 367 } // namespace blink | 365 } // namespace blink |
| OLD | NEW |