Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: sky/engine/core/html/HTMLStyleElement.cpp

Issue 836893003: Replace sheet change methods with styleResolverChanged. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698