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

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

Issue 2873133002: Check StyleSheetIsLoading before clearing LinkStyle sheet. (Closed)
Patch Set: Created 3 years, 7 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/LayoutTests/http/tests/css/remove-blocking-with-loading-import-expected.html ('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/LocalFrameClient.h" 9 #include "core/frame/LocalFrameClient.h"
10 #include "core/frame/SubresourceIntegrity.h" 10 #include "core/frame/SubresourceIntegrity.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 if (title.IsEmpty() || !IsUnset() || owner_->IsAlternate()) 396 if (title.IsEmpty() || !IsUnset() || owner_->IsAlternate())
397 return; 397 return;
398 398
399 const KURL& href = owner_->GetNonEmptyURLAttribute(hrefAttr); 399 const KURL& href = owner_->GetNonEmptyURLAttribute(hrefAttr);
400 if (href.IsValid() && !href.IsEmpty()) 400 if (href.IsValid() && !href.IsEmpty())
401 GetDocument().GetStyleEngine().SetPreferredStylesheetSetNameIfNotSet(title); 401 GetDocument().GetStyleEngine().SetPreferredStylesheetSetNameIfNotSet(title);
402 } 402 }
403 403
404 void LinkStyle::OwnerRemoved() { 404 void LinkStyle::OwnerRemoved() {
405 if (StyleSheetIsLoading())
406 RemovePendingSheet();
407
405 if (sheet_) 408 if (sheet_)
406 ClearSheet(); 409 ClearSheet();
407
408 if (StyleSheetIsLoading())
409 RemovePendingSheet();
410 } 410 }
411 411
412 DEFINE_TRACE(LinkStyle) { 412 DEFINE_TRACE(LinkStyle) {
413 visitor->Trace(sheet_); 413 visitor->Trace(sheet_);
414 LinkResource::Trace(visitor); 414 LinkResource::Trace(visitor);
415 ResourceOwner<StyleSheetResource>::Trace(visitor); 415 ResourceOwner<StyleSheetResource>::Trace(visitor);
416 } 416 }
417 417
418 } // namespace blink 418 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/css/remove-blocking-with-loading-import-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698