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

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

Issue 864533003: Remove HTMLStyleElement::scopingNode(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/html/HTMLStyleElement.h ('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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLStyleElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698