OLD | NEW |
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 Loading... |
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 |
OLD | NEW |