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

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

Issue 2354773003: Make stylesheet owner node a reference instead of pointer. (Closed)
Patch Set: const Created 4 years, 2 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } else if (name == mediaAttr && isConnected() && document().isActive() && m_ sheet) { 65 } else if (name == mediaAttr && isConnected() && document().isActive() && m_ sheet) {
66 m_sheet->setMediaQueries(MediaQuerySet::create(value)); 66 m_sheet->setMediaQueries(MediaQuerySet::create(value));
67 document().styleEngine().setNeedsActiveStyleUpdate(m_sheet.get(), FullSt yleUpdate); 67 document().styleEngine().setNeedsActiveStyleUpdate(m_sheet.get(), FullSt yleUpdate);
68 } else { 68 } else {
69 HTMLElement::parseAttribute(name, oldValue, value); 69 HTMLElement::parseAttribute(name, oldValue, value);
70 } 70 }
71 } 71 }
72 72
73 void HTMLStyleElement::finishParsingChildren() 73 void HTMLStyleElement::finishParsingChildren()
74 { 74 {
75 StyleElement::ProcessingResult result = StyleElement::finishParsingChildren( this); 75 StyleElement::ProcessingResult result = StyleElement::finishParsingChildren( *this);
76 HTMLElement::finishParsingChildren(); 76 HTMLElement::finishParsingChildren();
77 if (result == StyleElement::ProcessingFatalError) 77 if (result == StyleElement::ProcessingFatalError)
78 notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresou rce); 78 notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresou rce);
79 } 79 }
80 80
81 Node::InsertionNotificationRequest HTMLStyleElement::insertedInto(ContainerNode* insertionPoint) 81 Node::InsertionNotificationRequest HTMLStyleElement::insertedInto(ContainerNode* insertionPoint)
82 { 82 {
83 HTMLElement::insertedInto(insertionPoint); 83 HTMLElement::insertedInto(insertionPoint);
84 StyleElement::insertedInto(this, insertionPoint); 84 StyleElement::insertedInto(*this, insertionPoint);
85 return InsertionShouldCallDidNotifySubtreeInsertions; 85 return InsertionShouldCallDidNotifySubtreeInsertions;
86 } 86 }
87 87
88 void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint) 88 void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint)
89 { 89 {
90 HTMLElement::removedFrom(insertionPoint); 90 HTMLElement::removedFrom(insertionPoint);
91 StyleElement::removedFrom(this, insertionPoint); 91 StyleElement::removedFrom(*this, insertionPoint);
92 } 92 }
93 93
94 void HTMLStyleElement::didNotifySubtreeInsertionsToDocument() 94 void HTMLStyleElement::didNotifySubtreeInsertionsToDocument()
95 { 95 {
96 if (StyleElement::processStyleSheet(document(), this) == StyleElement::Proce ssingFatalError) 96 if (StyleElement::processStyleSheet(document(), *this) == StyleElement::Proc essingFatalError)
97 notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresou rce); 97 notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresou rce);
98 } 98 }
99 99
100 void HTMLStyleElement::childrenChanged(const ChildrenChange& change) 100 void HTMLStyleElement::childrenChanged(const ChildrenChange& change)
101 { 101 {
102 HTMLElement::childrenChanged(change); 102 HTMLElement::childrenChanged(change);
103 if (StyleElement::childrenChanged(this) == StyleElement::ProcessingFatalErro r) 103 if (StyleElement::childrenChanged(*this) == StyleElement::ProcessingFatalErr or)
104 notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresou rce); 104 notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresou rce);
105 } 105 }
106 106
107 const AtomicString& HTMLStyleElement::media() const 107 const AtomicString& HTMLStyleElement::media() const
108 { 108 {
109 return getAttribute(mediaAttr); 109 return getAttribute(mediaAttr);
110 } 110 }
111 111
112 const AtomicString& HTMLStyleElement::type() const 112 const AtomicString& HTMLStyleElement::type() const
113 { 113 {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 styleSheet->setDisabled(setDisabled); 149 styleSheet->setDisabled(setDisabled);
150 } 150 }
151 151
152 DEFINE_TRACE(HTMLStyleElement) 152 DEFINE_TRACE(HTMLStyleElement)
153 { 153 {
154 StyleElement::trace(visitor); 154 StyleElement::trace(visitor);
155 HTMLElement::trace(visitor); 155 HTMLElement::trace(visitor);
156 } 156 }
157 157
158 } // namespace blink 158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698