Chromium Code Reviews| 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() || (isHTMLLink() && !isImport() && !isAlternate())) |
| 93 return true; | |
| 94 } | |
|
rune
2016/08/01 09:22:15
I think I would be leaning towards a behavior wher
| |
| 93 | 95 |
| 94 const AtomicString& title = this->title(); | 96 const AtomicString& title = this->title(); |
| 95 if (!isEnabledViaScript() && !title.isEmpty() && title != currentPreferrable Name) | 97 if (!isEnabledViaScript() && !title.isEmpty() && title != currentPreferrable Name) |
| 96 return false; | 98 return false; |
| 97 if (isAlternate() && title.isEmpty()) | 99 if (isAlternate() && title.isEmpty()) |
| 98 return false; | 100 return false; |
| 99 | 101 |
| 100 return true; | 102 return true; |
| 101 } | 103 } |
| 102 | 104 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 133 return toSVGStyleElement(node()).sheet(); | 135 return toSVGStyleElement(node()).sheet(); |
| 134 case Pi: | 136 case Pi: |
| 135 return toProcessingInstruction(node()).sheet(); | 137 return toProcessingInstruction(node()).sheet(); |
| 136 } | 138 } |
| 137 | 139 |
| 138 ASSERT_NOT_REACHED(); | 140 ASSERT_NOT_REACHED(); |
| 139 return 0; | 141 return 0; |
| 140 } | 142 } |
| 141 | 143 |
| 142 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |