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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::canBeActivated(const String& currentPreferrableName) c
onst | 85 bool StyleSheetCandidate::canBeActivated(const String& currentPreferrableName) c
onst |
86 { | 86 { |
87 StyleSheet* sheet = this->sheet(); | 87 StyleSheet* sheet = this->sheet(); |
88 if (!sheet || sheet->disabled() || !sheet->isCSSStyleSheet()) | 88 if (!sheet || sheet->disabled() || !sheet->isCSSStyleSheet()) |
89 return false; | 89 return false; |
90 | 90 |
91 if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree()) | 91 if (sheet->ownerNode() && sheet->ownerNode()->isInShadowTree()) { |
92 return true; | 92 if (isCSSStyle()) |
| 93 return true; |
| 94 if (isHTMLLink() && !isImport()) |
| 95 return !isAlternate(); |
| 96 } |
93 | 97 |
94 const AtomicString& title = this->title(); | 98 const AtomicString& title = this->title(); |
95 if (!isEnabledViaScript() && !title.isEmpty() && title != currentPreferrable
Name) | 99 if (!isEnabledViaScript() && !title.isEmpty() && title != currentPreferrable
Name) |
96 return false; | 100 return false; |
97 if (isAlternate() && title.isEmpty()) | 101 if (isAlternate() && title.isEmpty()) |
98 return false; | 102 return false; |
99 | 103 |
100 return true; | 104 return true; |
101 } | 105 } |
102 | 106 |
(...skipping 30 matching lines...) Expand all Loading... |
133 return toSVGStyleElement(node()).sheet(); | 137 return toSVGStyleElement(node()).sheet(); |
134 case Pi: | 138 case Pi: |
135 return toProcessingInstruction(node()).sheet(); | 139 return toProcessingInstruction(node()).sheet(); |
136 } | 140 } |
137 | 141 |
138 ASSERT_NOT_REACHED(); | 142 ASSERT_NOT_REACHED(); |
139 return 0; | 143 return 0; |
140 } | 144 } |
141 | 145 |
142 } // namespace blink | 146 } // namespace blink |
OLD | NEW |