Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleSheetCandidate.cpp

Issue 1717303002: Ignore title attribute for style elements in shadow trees. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use isInShadowTree Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()->isInShadowTree())
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698