| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(Document& document) | 53 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(Document& document) |
| 54 { | 54 { |
| 55 return adoptRef(new HTMLStyleElement(document)); | 55 return adoptRef(new HTMLStyleElement(document)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 58 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
| 59 { | 59 { |
| 60 if (name == HTMLNames::mediaAttr && inDocument() && document().isActive() &&
m_sheet) { | 60 if (name == HTMLNames::mediaAttr && inDocument() && document().isActive() &&
m_sheet) { |
| 61 m_sheet->setMediaQueries(MediaQuerySet::create(value)); | 61 m_sheet->setMediaQueries(MediaQuerySet::create(value)); |
| 62 document().modifiedStyleSheet(m_sheet.get()); | 62 document().styleResolverChanged(); |
| 63 } else { | 63 } else { |
| 64 HTMLElement::parseAttribute(name, value); | 64 HTMLElement::parseAttribute(name, value); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void HTMLStyleElement::insertedInto(ContainerNode* insertionPoint) | 68 void HTMLStyleElement::insertedInto(ContainerNode* insertionPoint) |
| 69 { | 69 { |
| 70 HTMLElement::insertedInto(insertionPoint); | 70 HTMLElement::insertedInto(insertionPoint); |
| 71 if (!inActiveDocument()) | 71 if (!inActiveDocument()) |
| 72 return; | 72 return; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 84 TreeScope* containingScope = containingShadowRoot(); | 84 TreeScope* containingScope = containingShadowRoot(); |
| 85 TreeScope& scope = containingScope ? *containingScope : insertionPoint->tree
Scope(); | 85 TreeScope& scope = containingScope ? *containingScope : insertionPoint->tree
Scope(); |
| 86 | 86 |
| 87 scope.styleSheets().removeStyleSheetCandidateNode(*this); | 87 scope.styleSheets().removeStyleSheetCandidateNode(*this); |
| 88 | 88 |
| 89 RefPtr<CSSStyleSheet> removedSheet = m_sheet.get(); | 89 RefPtr<CSSStyleSheet> removedSheet = m_sheet.get(); |
| 90 | 90 |
| 91 if (m_sheet) | 91 if (m_sheet) |
| 92 clearSheet(); | 92 clearSheet(); |
| 93 if (removedSheet) | 93 if (removedSheet) |
| 94 document().removedStyleSheet(removedSheet.get()); | 94 document().styleResolverChanged(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void HTMLStyleElement::childrenChanged(const ChildrenChange& change) | 97 void HTMLStyleElement::childrenChanged(const ChildrenChange& change) |
| 98 { | 98 { |
| 99 HTMLElement::childrenChanged(change); | 99 HTMLElement::childrenChanged(change); |
| 100 process(); | 100 process(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 const AtomicString& HTMLStyleElement::media() const | 103 const AtomicString& HTMLStyleElement::media() const |
| 104 { | 104 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (screenEval.eval(mediaQueries.get())) { | 138 if (screenEval.eval(mediaQueries.get())) { |
| 139 const String& text = textFromChildren(); | 139 const String& text = textFromChildren(); |
| 140 m_sheet = document().styleEngine()->createSheet(this, text); | 140 m_sheet = document().styleEngine()->createSheet(this, text); |
| 141 m_sheet->setMediaQueries(mediaQueries.release()); | 141 m_sheet->setMediaQueries(mediaQueries.release()); |
| 142 } | 142 } |
| 143 | 143 |
| 144 document().styleResolverChanged(); | 144 document().styleResolverChanged(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } | 147 } |
| OLD | NEW |