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

Side by Side Diff: Source/core/html/HTMLStyleElement.cpp

Issue 23847002: Have StyleElement API take Document as a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLStyleElement.h ('k') | Source/core/svg/SVGStyleElement.h » ('j') | 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 , m_scopedStyleRegistrationState(NotRegistered) 52 , m_scopedStyleRegistrationState(NotRegistered)
53 { 53 {
54 ASSERT(hasTagName(styleTag)); 54 ASSERT(hasTagName(styleTag));
55 ScriptWrappable::init(this); 55 ScriptWrappable::init(this);
56 } 56 }
57 57
58 HTMLStyleElement::~HTMLStyleElement() 58 HTMLStyleElement::~HTMLStyleElement()
59 { 59 {
60 // During tear-down, willRemove isn't called, so m_scopedStyleRegistrationSt ate may still be RegisteredAsScoped or RegisteredInShadowRoot here. 60 // During tear-down, willRemove isn't called, so m_scopedStyleRegistrationSt ate may still be RegisteredAsScoped or RegisteredInShadowRoot here.
61 // Therefore we can't ASSERT(m_scopedStyleRegistrationState == NotRegistered ). 61 // Therefore we can't ASSERT(m_scopedStyleRegistrationState == NotRegistered ).
62 StyleElement::clearDocumentData(&document(), this); 62 StyleElement::clearDocumentData(document(), this);
63 63
64 styleLoadEventSender().cancelEvent(this); 64 styleLoadEventSender().cancelEvent(this);
65 } 65 }
66 66
67 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagNa me, Document* document, bool createdByParser) 67 PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagNa me, Document* document, bool createdByParser)
68 { 68 {
69 return adoptRef(new HTMLStyleElement(tagName, document, createdByParser)); 69 return adoptRef(new HTMLStyleElement(tagName, document, createdByParser));
70 } 70 }
71 71
72 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) 72 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value)
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 if (m_scopedStyleRegistrationState == RegisteredInShadowRoot) { 195 if (m_scopedStyleRegistrationState == RegisteredInShadowRoot) {
196 scope = containingShadowRoot(); 196 scope = containingShadowRoot();
197 if (!scope) 197 if (!scope)
198 scope = insertionPoint->containingShadowRoot(); 198 scope = insertionPoint->containingShadowRoot();
199 } else 199 } else
200 scope = parentNode() ? parentNode() : insertionPoint; 200 scope = parentNode() ? parentNode() : insertionPoint;
201 unregisterWithScopingNode(scope); 201 unregisterWithScopingNode(scope);
202 } 202 }
203 203
204 if (insertionPoint->inDocument()) 204 if (insertionPoint->inDocument())
205 StyleElement::removedFromDocument(&document(), this, scope); 205 StyleElement::removedFromDocument(document(), this, scope);
206 } 206 }
207 207
208 void HTMLStyleElement::didNotifySubtreeInsertions(ContainerNode* insertionPoint) 208 void HTMLStyleElement::didNotifySubtreeInsertions(ContainerNode* insertionPoint)
209 { 209 {
210 StyleElement::processStyleSheet(&document(), this); 210 StyleElement::processStyleSheet(document(), this);
211 } 211 }
212 212
213 void HTMLStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) 213 void HTMLStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
214 { 214 {
215 HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, chi ldCountDelta); 215 HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, chi ldCountDelta);
216 StyleElement::childrenChanged(this); 216 StyleElement::childrenChanged(this);
217 } 217 }
218 218
219 const AtomicString& HTMLStyleElement::media() const 219 const AtomicString& HTMLStyleElement::media() const
220 { 220 {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return m_sheet->disabled(); 286 return m_sheet->disabled();
287 } 287 }
288 288
289 void HTMLStyleElement::setDisabled(bool setDisabled) 289 void HTMLStyleElement::setDisabled(bool setDisabled)
290 { 290 {
291 if (CSSStyleSheet* styleSheet = sheet()) 291 if (CSSStyleSheet* styleSheet = sheet())
292 styleSheet->setDisabled(setDisabled); 292 styleSheet->setDisabled(setDisabled);
293 } 293 }
294 294
295 } 295 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLStyleElement.h ('k') | Source/core/svg/SVGStyleElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698