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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 return isHTMLLink() && !toHTMLLinkElement(node()).isDisabled() && toHTMLLink
Element(node()).styleSheetIsLoading(); | 82 return isHTMLLink() && !toHTMLLinkElement(node()).isDisabled() && toHTMLLink
Element(node()).styleSheetIsLoading(); |
83 } | 83 } |
84 | 84 |
85 bool StyleSheetCandidate::hasPreferrableName(const String& currentPreferrableNam
e) const | 85 bool StyleSheetCandidate::hasPreferrableName() const |
86 { | 86 { |
87 ASSERT(isEnabledAndLoading() || sheet()); | 87 ASSERT(isEnabledAndLoading() || sheet()); |
88 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate() && curr
entPreferrableName.isEmpty(); | 88 return !isEnabledViaScript() && !title().isEmpty() && !isAlternate(); |
89 } | 89 } |
90 | 90 |
91 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c
onst | 91 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c
onst |
92 { | 92 { |
93 StyleSheet* sheet = this->sheet(); | 93 StyleSheet* sheet = this->sheet(); |
94 if (!sheet || sheet->disabled() || !sheet->isCSSStyleSheet()) | 94 if (!sheet || sheet->disabled() || !sheet->isCSSStyleSheet()) |
95 return false; | 95 return false; |
96 | 96 |
97 if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree()) | 97 if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree()) |
98 return true; | 98 return true; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return toSVGStyleElement(node()).sheet(); | 139 return toSVGStyleElement(node()).sheet(); |
140 case Pi: | 140 case Pi: |
141 return toProcessingInstruction(node()).sheet(); | 141 return toProcessingInstruction(node()).sheet(); |
142 } | 142 } |
143 | 143 |
144 ASSERT_NOT_REACHED(); | 144 ASSERT_NOT_REACHED(); |
145 return 0; | 145 return 0; |
146 } | 146 } |
147 | 147 |
148 } // namespace blink | 148 } // namespace blink |
OLD | NEW |