| OLD | NEW |
| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 const AtomicString& HTMLStyleElement::media() const { | 100 const AtomicString& HTMLStyleElement::media() const { |
| 101 return getAttribute(mediaAttr); | 101 return getAttribute(mediaAttr); |
| 102 } | 102 } |
| 103 | 103 |
| 104 const AtomicString& HTMLStyleElement::type() const { | 104 const AtomicString& HTMLStyleElement::type() const { |
| 105 return getAttribute(typeAttr); | 105 return getAttribute(typeAttr); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void HTMLStyleElement::dispatchPendingEvent( | 108 void HTMLStyleElement::dispatchPendingEvent( |
| 109 std::unique_ptr<IncrementLoadEventDelayCount>) { | 109 std::unique_ptr<IncrementLoadEventDelayCount> count) { |
| 110 dispatchEvent(Event::create(m_loadedSheet ? EventTypeNames::load | 110 dispatchEvent(Event::create(m_loadedSheet ? EventTypeNames::load |
| 111 : EventTypeNames::error)); | 111 : EventTypeNames::error)); |
| 112 |
| 113 // Checks Document's load event synchronously here for performance. |
| 114 // This is safe because dispatchPendingEvent() is called asynchronously. |
| 115 count->clearAndCheckLoadEvent(); |
| 112 } | 116 } |
| 113 | 117 |
| 114 void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources( | 118 void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources( |
| 115 LoadedSheetErrorStatus errorStatus) { | 119 LoadedSheetErrorStatus errorStatus) { |
| 116 bool isLoadEvent = errorStatus == NoErrorLoadingSubresource; | 120 bool isLoadEvent = errorStatus == NoErrorLoadingSubresource; |
| 117 if (m_firedLoad && isLoadEvent) | 121 if (m_firedLoad && isLoadEvent) |
| 118 return; | 122 return; |
| 119 m_loadedSheet = isLoadEvent; | 123 m_loadedSheet = isLoadEvent; |
| 120 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) | 124 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) |
| 121 ->postTask( | 125 ->postTask( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 137 if (CSSStyleSheet* styleSheet = sheet()) | 141 if (CSSStyleSheet* styleSheet = sheet()) |
| 138 styleSheet->setDisabled(setDisabled); | 142 styleSheet->setDisabled(setDisabled); |
| 139 } | 143 } |
| 140 | 144 |
| 141 DEFINE_TRACE(HTMLStyleElement) { | 145 DEFINE_TRACE(HTMLStyleElement) { |
| 142 StyleElement::trace(visitor); | 146 StyleElement::trace(visitor); |
| 143 HTMLElement::trace(visitor); | 147 HTMLElement::trace(visitor); |
| 144 } | 148 } |
| 145 | 149 |
| 146 } // namespace blink | 150 } // namespace blink |
| OLD | NEW |