| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 m_pendingSheetType = None; | 638 m_pendingSheetType = None; |
| 639 | 639 |
| 640 if (type == None) | 640 if (type == None) |
| 641 return; | 641 return; |
| 642 if (type == NonBlocking) { | 642 if (type == NonBlocking) { |
| 643 // Tell StyleEngine to re-compute styleSheets of this m_owner's treescop
e. | 643 // Tell StyleEngine to re-compute styleSheets of this m_owner's treescop
e. |
| 644 m_owner->document().styleEngine().modifiedStyleSheetCandidateNode(m_owne
r); | 644 m_owner->document().styleEngine().modifiedStyleSheetCandidateNode(m_owne
r); |
| 645 // Document::removePendingSheet() triggers the style selector recalc for
blocking sheets. | 645 // Document::removePendingSheet() triggers the style selector recalc for
blocking sheets. |
| 646 // FIXME: We don't have enough knowledge at this point to know if we're
adding or removing a sheet | 646 // FIXME: We don't have enough knowledge at this point to know if we're
adding or removing a sheet |
| 647 // so we can't call addedStyleSheet() or removedStyleSheet(). | 647 // so we can't call addedStyleSheet() or removedStyleSheet(). |
| 648 m_owner->document().styleResolverChanged(); | 648 m_owner->document().styleEngine().resolverChanged(FullStyleUpdate); |
| 649 return; | 649 return; |
| 650 } | 650 } |
| 651 | 651 |
| 652 m_owner->document().styleEngine().removePendingSheet(m_owner); | 652 m_owner->document().styleEngine().removePendingSheet(m_owner); |
| 653 } | 653 } |
| 654 | 654 |
| 655 void LinkStyle::setDisabledState(bool disabled) | 655 void LinkStyle::setDisabledState(bool disabled) |
| 656 { | 656 { |
| 657 LinkStyle::DisabledState oldDisabledState = m_disabledState; | 657 LinkStyle::DisabledState oldDisabledState = m_disabledState; |
| 658 m_disabledState = disabled ? Disabled : EnabledViaScript; | 658 m_disabledState = disabled ? Disabled : EnabledViaScript; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 682 | 682 |
| 683 if (m_sheet) | 683 if (m_sheet) |
| 684 m_sheet->setDisabled(disabled); | 684 m_sheet->setDisabled(disabled); |
| 685 | 685 |
| 686 // Load the sheet, since it's never been loaded before. | 686 // Load the sheet, since it's never been loaded before. |
| 687 if (!m_sheet && m_disabledState == EnabledViaScript) { | 687 if (!m_sheet && m_disabledState == EnabledViaScript) { |
| 688 if (m_owner->shouldProcessStyle()) | 688 if (m_owner->shouldProcessStyle()) |
| 689 process(); | 689 process(); |
| 690 } else { | 690 } else { |
| 691 // FIXME: We don't have enough knowledge here to know if we should c
all addedStyleSheet() or removedStyleSheet(). | 691 // FIXME: We don't have enough knowledge here to know if we should c
all addedStyleSheet() or removedStyleSheet(). |
| 692 m_owner->document().styleResolverChanged(); | 692 m_owner->document().styleEngine().resolverChanged(FullStyleUpdate); |
| 693 } | 693 } |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 | 696 |
| 697 void LinkStyle::setCrossOriginStylesheetStatus(CSSStyleSheet* sheet) | 697 void LinkStyle::setCrossOriginStylesheetStatus(CSSStyleSheet* sheet) |
| 698 { | 698 { |
| 699 if (m_fetchFollowingCORS && resource() && !resource()->errorOccurred()) { | 699 if (m_fetchFollowingCORS && resource() && !resource()->errorOccurred()) { |
| 700 // Record the security origin the CORS access check succeeded at, if cro
ss origin. | 700 // Record the security origin the CORS access check succeeded at, if cro
ss origin. |
| 701 // Only origins that are script accessible to it may access the styleshe
et's rules. | 701 // Only origins that are script accessible to it may access the styleshe
et's rules. |
| 702 sheet->setAllowRuleAccessFromOrigin(m_owner->document().securityOrigin()
); | 702 sheet->setAllowRuleAccessFromOrigin(m_owner->document().securityOrigin()
); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 } | 793 } |
| 794 | 794 |
| 795 DEFINE_TRACE(LinkStyle) | 795 DEFINE_TRACE(LinkStyle) |
| 796 { | 796 { |
| 797 visitor->trace(m_sheet); | 797 visitor->trace(m_sheet); |
| 798 LinkResource::trace(visitor); | 798 LinkResource::trace(visitor); |
| 799 ResourceOwner<StyleSheetResource>::trace(visitor); | 799 ResourceOwner<StyleSheetResource>::trace(visitor); |
| 800 } | 800 } |
| 801 | 801 |
| 802 } // namespace blink | 802 } // namespace blink |
| OLD | NEW |