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

Unified Diff: Source/core/css/CSSDefaultStyleSheets.cpp

Issue 1150823004: Make ensureDefaultStyleSheetForElement parameter const reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSDefaultStyleSheets.h ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSDefaultStyleSheets.cpp
diff --git a/Source/core/css/CSSDefaultStyleSheets.cpp b/Source/core/css/CSSDefaultStyleSheets.cpp
index 1a7a5653924e54395c4eafd8d9db4cae2c67bfbc..4b4f5aa698f294175ebb0a3f0c5905ade43e89f9 100644
--- a/Source/core/css/CSSDefaultStyleSheets.cpp
+++ b/Source/core/css/CSSDefaultStyleSheets.cpp
@@ -135,10 +135,10 @@ RuleSet* CSSDefaultStyleSheets::defaultMobileViewportStyle()
return m_defaultMobileViewportStyle.get();
}
-void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element, bool& changedDefaultStyle)
+void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(const Element& element, bool& changedDefaultStyle)
{
// FIXME: We should assert that the sheet only styles SVG elements.
- if (element->isSVGElement() && !m_svgStyleSheet) {
+ if (element.isSVGElement() && !m_svgStyleSheet) {
m_svgStyleSheet = parseUASheet(loadResourceAsASCIIString("svg.css"));
m_defaultStyle->addRulesFromSheet(svgStyleSheet(), screenEval());
m_defaultPrintStyle->addRulesFromSheet(svgStyleSheet(), printEval());
@@ -146,7 +146,7 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
}
// FIXME: We should assert that the sheet only styles MathML elements.
- if (element->namespaceURI() == MathMLNames::mathmlNamespaceURI
+ if (element.namespaceURI() == MathMLNames::mathmlNamespaceURI
&& !m_mathmlStyleSheet) {
m_mathmlStyleSheet = parseUASheet(loadResourceAsASCIIString("mathml.css"));
m_defaultStyle->addRulesFromSheet(mathmlStyleSheet(), screenEval());
@@ -155,7 +155,7 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
}
// FIXME: We should assert that this sheet only contains rules for <video> and <audio>.
- if (!m_mediaControlsStyleSheet && (isHTMLVideoElement(*element) || isHTMLAudioElement(*element))) {
+ if (!m_mediaControlsStyleSheet && (isHTMLVideoElement(element) || isHTMLAudioElement(element))) {
String mediaRules = loadResourceAsASCIIString("mediaControls.css") + LayoutTheme::theme().extraMediaControlsStyleSheet();
m_mediaControlsStyleSheet = parseUASheet(mediaRules);
m_defaultStyle->addRulesFromSheet(mediaControlsStyleSheet(), screenEval());
@@ -165,7 +165,7 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
// FIXME: This only works because we Force recalc the entire document so the new sheet
// is loaded for <html> and the correct styles apply to everyone.
- if (!m_fullscreenStyleSheet && Fullscreen::isFullScreen(element->document())) {
+ if (!m_fullscreenStyleSheet && Fullscreen::isFullScreen(element.document())) {
String fullscreenRules = loadResourceAsASCIIString("fullscreen.css") + LayoutTheme::theme().extraFullScreenStyleSheet();
m_fullscreenStyleSheet = parseUASheet(fullscreenRules);
m_defaultStyle->addRulesFromSheet(fullscreenStyleSheet(), screenEval());
« no previous file with comments | « Source/core/css/CSSDefaultStyleSheets.h ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698