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

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

Issue 1032033002: Fire error events for a variety of script and style failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed processing result to an enum rather than a bool Created 5 years, 9 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } else if (name == mediaAttr && inDocument() && document().isActive() && m_s heet) { 70 } else if (name == mediaAttr && inDocument() && document().isActive() && m_s heet) {
71 m_sheet->setMediaQueries(MediaQuerySet::create(value)); 71 m_sheet->setMediaQueries(MediaQuerySet::create(value));
72 document().modifiedStyleSheet(m_sheet.get()); 72 document().modifiedStyleSheet(m_sheet.get());
73 } else { 73 } else {
74 HTMLElement::parseAttribute(name, value); 74 HTMLElement::parseAttribute(name, value);
75 } 75 }
76 } 76 }
77 77
78 void HTMLStyleElement::finishParsingChildren() 78 void HTMLStyleElement::finishParsingChildren()
79 { 79 {
80 StyleElement::finishParsingChildren(this); 80 StyleElement::ProcessingResult result = StyleElement::finishParsingChildren( this);
81 HTMLElement::finishParsingChildren(); 81 HTMLElement::finishParsingChildren();
82 if (result == StyleElement::ProcessingFatalError)
83 notifyLoadedSheetAndAllCriticalSubresources(true);
82 } 84 }
83 85
84 Node::InsertionNotificationRequest HTMLStyleElement::insertedInto(ContainerNode* insertionPoint) 86 Node::InsertionNotificationRequest HTMLStyleElement::insertedInto(ContainerNode* insertionPoint)
85 { 87 {
86 HTMLElement::insertedInto(insertionPoint); 88 HTMLElement::insertedInto(insertionPoint);
87 StyleElement::insertedInto(this, insertionPoint); 89 StyleElement::insertedInto(this, insertionPoint);
88 return InsertionShouldCallDidNotifySubtreeInsertions; 90 return InsertionShouldCallDidNotifySubtreeInsertions;
89 } 91 }
90 92
91 void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint) 93 void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint)
92 { 94 {
93 HTMLElement::removedFrom(insertionPoint); 95 HTMLElement::removedFrom(insertionPoint);
94 StyleElement::removedFrom(this, insertionPoint); 96 StyleElement::removedFrom(this, insertionPoint);
95 } 97 }
96 98
97 void HTMLStyleElement::didNotifySubtreeInsertionsToDocument() 99 void HTMLStyleElement::didNotifySubtreeInsertionsToDocument()
98 { 100 {
99 StyleElement::processStyleSheet(document(), this); 101 if (StyleElement::processStyleSheet(document(), this) == StyleElement::Proce ssingFatalError)
102 notifyLoadedSheetAndAllCriticalSubresources(true);
100 } 103 }
101 104
102 void HTMLStyleElement::childrenChanged(const ChildrenChange& change) 105 void HTMLStyleElement::childrenChanged(const ChildrenChange& change)
103 { 106 {
104 HTMLElement::childrenChanged(change); 107 HTMLElement::childrenChanged(change);
105 StyleElement::childrenChanged(this); 108 if (StyleElement::childrenChanged(this) == StyleElement::ProcessingFatalErro r)
109 notifyLoadedSheetAndAllCriticalSubresources(true);
106 } 110 }
107 111
108 const AtomicString& HTMLStyleElement::media() const 112 const AtomicString& HTMLStyleElement::media() const
109 { 113 {
110 return getAttribute(mediaAttr); 114 return getAttribute(mediaAttr);
111 } 115 }
112 116
113 const AtomicString& HTMLStyleElement::type() const 117 const AtomicString& HTMLStyleElement::type() const
114 { 118 {
115 return getAttribute(typeAttr); 119 return getAttribute(typeAttr);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 styleSheet->setDisabled(setDisabled); 164 styleSheet->setDisabled(setDisabled);
161 } 165 }
162 166
163 DEFINE_TRACE(HTMLStyleElement) 167 DEFINE_TRACE(HTMLStyleElement)
164 { 168 {
165 StyleElement::trace(visitor); 169 StyleElement::trace(visitor);
166 HTMLElement::trace(visitor); 170 HTMLElement::trace(visitor);
167 } 171 }
168 172
169 } 173 }
OLDNEW
« Source/core/html/HTMLLinkElement.cpp ('K') | « Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698