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, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) | 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) |
7 * Copyright (C) 2011 Google Inc. All rights reserved. | 7 * Copyright (C) 2011 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 // happen (a double toggle for no reason essentially). This happens
on | 670 // happen (a double toggle for no reason essentially). This happens
on |
671 // virtualplastic.net, which manages to do about 12 enable/disables
on only 3 | 671 // virtualplastic.net, which manages to do about 12 enable/disables
on only 3 |
672 // sheets. :) | 672 // sheets. :) |
673 if (!m_owner->relAttribute().isAlternate() && m_disabledState == Ena
bledViaScript && oldDisabledState == Disabled) | 673 if (!m_owner->relAttribute().isAlternate() && m_disabledState == Ena
bledViaScript && oldDisabledState == Disabled) |
674 addPendingSheet(Blocking); | 674 addPendingSheet(Blocking); |
675 | 675 |
676 // If the sheet is already loading just bail. | 676 // If the sheet is already loading just bail. |
677 return; | 677 return; |
678 } | 678 } |
679 | 679 |
680 if (m_sheet) | 680 if (m_sheet) { |
681 m_sheet->setDisabled(disabled); | 681 m_sheet->setDisabled(disabled); |
| 682 return; |
| 683 } |
682 | 684 |
683 // Load the sheet, since it's never been loaded before. | 685 if (m_disabledState == EnabledViaScript && m_owner->shouldProcessStyle()
) |
684 if (!m_sheet && m_disabledState == EnabledViaScript) { | 686 process(); |
685 if (m_owner->shouldProcessStyle()) | |
686 process(); | |
687 } else { | |
688 m_owner->document().styleEngine().resolverChanged(FullStyleUpdate); | |
689 } | |
690 } | 687 } |
691 } | 688 } |
692 | 689 |
693 void LinkStyle::setCrossOriginStylesheetStatus(CSSStyleSheet* sheet) | 690 void LinkStyle::setCrossOriginStylesheetStatus(CSSStyleSheet* sheet) |
694 { | 691 { |
695 if (m_fetchFollowingCORS && resource() && !resource()->errorOccurred()) { | 692 if (m_fetchFollowingCORS && resource() && !resource()->errorOccurred()) { |
696 // Record the security origin the CORS access check succeeded at, if cro
ss origin. | 693 // Record the security origin the CORS access check succeeded at, if cro
ss origin. |
697 // Only origins that are script accessible to it may access the styleshe
et's rules. | 694 // Only origins that are script accessible to it may access the styleshe
et's rules. |
698 sheet->setAllowRuleAccessFromOrigin(m_owner->document().securityOrigin()
); | 695 sheet->setAllowRuleAccessFromOrigin(m_owner->document().securityOrigin()
); |
699 } | 696 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 } | 786 } |
790 | 787 |
791 DEFINE_TRACE(LinkStyle) | 788 DEFINE_TRACE(LinkStyle) |
792 { | 789 { |
793 visitor->trace(m_sheet); | 790 visitor->trace(m_sheet); |
794 LinkResource::trace(visitor); | 791 LinkResource::trace(visitor); |
795 ResourceOwner<StyleSheetResource>::trace(visitor); | 792 ResourceOwner<StyleSheetResource>::trace(visitor); |
796 } | 793 } |
797 | 794 |
798 } // namespace blink | 795 } // namespace blink |
OLD | NEW |