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