OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return toElement(node()).getAttribute(relAttr).contains("alternate"); | 72 return toElement(node()).getAttribute(relAttr).contains("alternate"); |
73 } | 73 } |
74 | 74 |
75 bool StyleSheetCandidate::isEnabledViaScript() const | 75 bool StyleSheetCandidate::isEnabledViaScript() const |
76 { | 76 { |
77 return isHTMLLink() && toHTMLLinkElement(node()).isEnabledViaScript(); | 77 return isHTMLLink() && toHTMLLinkElement(node()).isEnabledViaScript(); |
78 } | 78 } |
79 | 79 |
80 bool StyleSheetCandidate::isEnabledAndLoading() const | 80 bool StyleSheetCandidate::isEnabledAndLoading() const |
81 { | 81 { |
82 if (isHTMLLink()) | 82 return isHTMLLink() && !toHTMLLinkElement(node()).isDisabled() && toHTMLLink
Element(node()).styleSheetIsLoading(); |
83 return !toHTMLLinkElement(node()).isDisabled() && toHTMLLinkElement(node
()).styleSheetIsLoading(); | |
84 | |
85 StyleSheet* sheet = this->sheet(); | |
86 return sheet && !sheet->disabled() && sheet->isLoading(); | |
87 } | 83 } |
88 | 84 |
89 bool StyleSheetCandidate::hasPreferrableName() const | 85 bool StyleSheetCandidate::hasPreferrableName() const |
90 { | 86 { |
91 ASSERT(isEnabledAndLoading() || sheet()); | 87 ASSERT(isEnabledAndLoading() || sheet()); |
92 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate(); | 88 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate(); |
93 } | 89 } |
94 | 90 |
95 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c
onst | 91 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c
onst |
96 { | 92 { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return toSVGStyleElement(node()).sheet(); | 139 return toSVGStyleElement(node()).sheet(); |
144 case Pi: | 140 case Pi: |
145 return toProcessingInstruction(node()).sheet(); | 141 return toProcessingInstruction(node()).sheet(); |
146 } | 142 } |
147 | 143 |
148 ASSERT_NOT_REACHED(); | 144 ASSERT_NOT_REACHED(); |
149 return 0; | 145 return 0; |
150 } | 146 } |
151 | 147 |
152 } // namespace blink | 148 } // namespace blink |
OLD | NEW |