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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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() && curr entPreferrableName.isEmpty(); |
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 | |
97 if (sheet->ownerNode() && sheet->ownerNode()->treeScope().rootNode().isShado wRoot()) | |
dglazkov
2016/02/22 16:44:45
would ownerNode()->isInShadowTree() not work?
rune
2016/02/22 17:38:16
Done.
| |
98 return true; | |
99 | |
96 const AtomicString& title = this->title(); | 100 const AtomicString& title = this->title(); |
97 if (!isEnabledViaScript() && !title.isEmpty() && title != currentPreferrable Name) | 101 if (!isEnabledViaScript() && !title.isEmpty() && title != currentPreferrable Name) |
98 return false; | 102 return false; |
99 if (isAlternate() && title.isEmpty()) | 103 if (isAlternate() && title.isEmpty()) |
100 return false; | 104 return false; |
101 | 105 |
102 return true; | 106 return true; |
103 } | 107 } |
104 | 108 |
105 StyleSheetCandidate::Type StyleSheetCandidate::typeOf(Node& node) | 109 StyleSheetCandidate::Type StyleSheetCandidate::typeOf(Node& node) |
(...skipping 29 matching lines...) Expand all Loading... | |
135 return toSVGStyleElement(node()).sheet(); | 139 return toSVGStyleElement(node()).sheet(); |
136 case Pi: | 140 case Pi: |
137 return toProcessingInstruction(node()).sheet(); | 141 return toProcessingInstruction(node()).sheet(); |
138 } | 142 } |
139 | 143 |
140 ASSERT_NOT_REACHED(); | 144 ASSERT_NOT_REACHED(); |
141 return 0; | 145 return 0; |
142 } | 146 } |
143 | 147 |
144 } // namespace blink | 148 } // namespace blink |
OLD | NEW |