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

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

Issue 2546393002: Make setNeedsActiveStyleUpdate mark treescope dirty only. (Closed)
Patch Set: Rebased Created 4 years 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/HTMLStyleElement.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/LinkStyle.h" 5 #include "core/html/LinkStyle.h"
6 6
7 #include "core/css/StyleSheetContents.h" 7 #include "core/css/StyleSheetContents.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/SubresourceIntegrity.h" 9 #include "core/frame/SubresourceIntegrity.h"
10 #include "core/frame/csp/ContentSecurityPolicy.h" 10 #include "core/frame/csp/ContentSecurityPolicy.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 m_owner->relAttribute().getIconType()); 380 m_owner->relAttribute().getIconType());
381 } 381 }
382 } 382 }
383 383
384 if (!m_owner->loadLink(type, as, media, m_owner->referrerPolicy(), 384 if (!m_owner->loadLink(type, as, media, m_owner->referrerPolicy(),
385 builder.url())) 385 builder.url()))
386 return; 386 return;
387 387
388 if (loadStylesheetIfNeeded(builder, type) == NotNeeded && m_sheet) { 388 if (loadStylesheetIfNeeded(builder, type) == NotNeeded && m_sheet) {
389 // we no longer contain a stylesheet, e.g. perhaps rel or type was changed 389 // we no longer contain a stylesheet, e.g. perhaps rel or type was changed
390 StyleSheet* removedSheet = m_sheet.get();
391 clearSheet(); 390 clearSheet();
392 document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, 391 document().styleEngine().setNeedsActiveStyleUpdate(m_owner->treeScope());
393 FullStyleUpdate); 392 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
393 // updates are async. https://crbug.com/567021
394 document().styleEngine().resolverChanged(FullStyleUpdate);
394 } 395 }
395 } 396 }
396 397
397 void LinkStyle::setSheetTitle( 398 void LinkStyle::setSheetTitle(
398 const String& title, 399 const String& title,
399 StyleEngine::ActiveSheetsUpdate updateActiveSheets) { 400 StyleEngine::ActiveSheetsUpdate updateActiveSheets) {
400 if (!m_owner->isInDocumentTree() || !m_owner->relAttribute().isStyleSheet()) 401 if (!m_owner->isInDocumentTree() || !m_owner->relAttribute().isStyleSheet())
401 return; 402 return;
402 403
403 if (m_sheet) 404 if (m_sheet)
(...skipping 17 matching lines...) Expand all
421 removePendingSheet(); 422 removePendingSheet();
422 } 423 }
423 424
424 DEFINE_TRACE(LinkStyle) { 425 DEFINE_TRACE(LinkStyle) {
425 visitor->trace(m_sheet); 426 visitor->trace(m_sheet);
426 LinkResource::trace(visitor); 427 LinkResource::trace(visitor);
427 ResourceOwner<StyleSheetResource>::trace(visitor); 428 ResourceOwner<StyleSheetResource>::trace(visitor);
428 } 429 }
429 430
430 } // namespace blink 431 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLStyleElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698