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

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

Issue 2641263002: Use Unthrottled instead of DOMManipulation in HTMLLinkElement/HTMLStyleElement (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 dispatchEvent(Event::create(m_loadedSheet ? EventTypeNames::load 112 dispatchEvent(Event::create(m_loadedSheet ? EventTypeNames::load
113 : EventTypeNames::error)); 113 : EventTypeNames::error));
114 } 114 }
115 115
116 void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources( 116 void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources(
117 LoadedSheetErrorStatus errorStatus) { 117 LoadedSheetErrorStatus errorStatus) {
118 bool isLoadEvent = errorStatus == NoErrorLoadingSubresource; 118 bool isLoadEvent = errorStatus == NoErrorLoadingSubresource;
119 if (m_firedLoad && isLoadEvent) 119 if (m_firedLoad && isLoadEvent)
120 return; 120 return;
121 m_loadedSheet = isLoadEvent; 121 m_loadedSheet = isLoadEvent;
122 TaskRunnerHelper::get(TaskType::DOMManipulation, &document()) 122 // TODO(hiroshige): Use DOMManipulation task runner. Unthrottled
123 // is temporarily used for fixing https://crbug.com/649942 only on M-56.
124 TaskRunnerHelper::get(TaskType::Unthrottled, &document())
123 ->postTask( 125 ->postTask(
124 BLINK_FROM_HERE, 126 BLINK_FROM_HERE,
125 WTF::bind(&HTMLStyleElement::dispatchPendingEvent, 127 WTF::bind(&HTMLStyleElement::dispatchPendingEvent,
126 wrapPersistent(this), 128 wrapPersistent(this),
127 passed(IncrementLoadEventDelayCount::create(document())))); 129 passed(IncrementLoadEventDelayCount::create(document()))));
128 m_firedLoad = true; 130 m_firedLoad = true;
129 } 131 }
130 132
131 bool HTMLStyleElement::disabled() const { 133 bool HTMLStyleElement::disabled() const {
132 if (!m_sheet) 134 if (!m_sheet)
133 return false; 135 return false;
134 136
135 return m_sheet->disabled(); 137 return m_sheet->disabled();
136 } 138 }
137 139
138 void HTMLStyleElement::setDisabled(bool setDisabled) { 140 void HTMLStyleElement::setDisabled(bool setDisabled) {
139 if (CSSStyleSheet* styleSheet = sheet()) 141 if (CSSStyleSheet* styleSheet = sheet())
140 styleSheet->setDisabled(setDisabled); 142 styleSheet->setDisabled(setDisabled);
141 } 143 }
142 144
143 DEFINE_TRACE(HTMLStyleElement) { 145 DEFINE_TRACE(HTMLStyleElement) {
144 StyleElement::trace(visitor); 146 StyleElement::trace(visitor);
145 HTMLElement::trace(visitor); 147 HTMLElement::trace(visitor);
146 } 148 }
147 149
148 } // namespace blink 150 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698