| 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 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. |
| 6 * (C) 2007 Rob Buis (buis@kde.org) | 6 * (C) 2007 Rob Buis (buis@kde.org) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 { | 97 { |
| 98 HTMLElement::childrenChanged(change); | 98 HTMLElement::childrenChanged(change); |
| 99 process(); | 99 process(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 const AtomicString& HTMLStyleElement::media() const | 102 const AtomicString& HTMLStyleElement::media() const |
| 103 { | 103 { |
| 104 return getAttribute(HTMLNames::mediaAttr); | 104 return getAttribute(HTMLNames::mediaAttr); |
| 105 } | 105 } |
| 106 | 106 |
| 107 ContainerNode* HTMLStyleElement::scopingNode() | |
| 108 { | |
| 109 if (!inActiveDocument()) | |
| 110 return 0; | |
| 111 | |
| 112 if (isInShadowTree()) | |
| 113 return containingShadowRoot(); | |
| 114 | |
| 115 return &document(); | |
| 116 } | |
| 117 | |
| 118 void HTMLStyleElement::clearSheet() | 107 void HTMLStyleElement::clearSheet() |
| 119 { | 108 { |
| 120 ASSERT(m_sheet); | 109 ASSERT(m_sheet); |
| 121 m_sheet.release()->clearOwnerNode(); | 110 m_sheet.release()->clearOwnerNode(); |
| 122 } | 111 } |
| 123 | 112 |
| 124 void HTMLStyleElement::process() | 113 void HTMLStyleElement::process() |
| 125 { | 114 { |
| 126 if (!inActiveDocument()) | 115 if (!inActiveDocument()) |
| 127 return; | 116 return; |
| 128 | 117 |
| 129 TRACE_EVENT0("blink", "StyleElement::process"); | 118 TRACE_EVENT0("blink", "StyleElement::process"); |
| 130 | 119 |
| 131 if (m_sheet) | 120 if (m_sheet) |
| 132 clearSheet(); | 121 clearSheet(); |
| 133 | 122 |
| 134 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media()); | 123 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media()); |
| 135 | 124 |
| 136 MediaQueryEvaluator screenEval("screen", true); | 125 MediaQueryEvaluator screenEval("screen", true); |
| 137 if (screenEval.eval(mediaQueries.get())) { | 126 if (screenEval.eval(mediaQueries.get())) { |
| 138 const String& text = textFromChildren(); | 127 const String& text = textFromChildren(); |
| 139 m_sheet = document().styleEngine()->createSheet(this, text); | 128 m_sheet = document().styleEngine()->createSheet(this, text); |
| 140 m_sheet->setMediaQueries(mediaQueries.release()); | 129 m_sheet->setMediaQueries(mediaQueries.release()); |
| 141 } | 130 } |
| 142 | 131 |
| 143 document().styleResolverChanged(); | 132 document().styleResolverChanged(); |
| 144 } | 133 } |
| 145 | 134 |
| 146 } | 135 } |
| OLD | NEW |