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

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

Issue 138383003: Display MathML fallback content when it is specified and take into account inline/display modes for… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update comments in mathml.css Created 6 years, 9 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/mathml.css » ('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 0e6281677abccb6b009617fb1e010f5bccf0792e..2e138aa15058f099b71f2baa742a97d0bf451841 100644
--- a/Source/core/css/CSSDefaultStyleSheets.cpp
+++ b/Source/core/css/CSSDefaultStyleSheets.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "core/css/CSSDefaultStyleSheets.h"
+#include "MathMLNames.h"
#include "UserAgentStyleSheets.h"
#include "core/css/MediaQueryEvaluator.h"
#include "core/css/RuleSet.h"
@@ -88,6 +89,7 @@ CSSDefaultStyleSheets::CSSDefaultStyleSheets()
, m_viewportStyleSheet(nullptr)
, m_quirksStyleSheet(nullptr)
, m_svgStyleSheet(nullptr)
+ , m_mathmlStyleSheet(nullptr)
, m_mediaControlsStyleSheet(nullptr)
, m_fullscreenStyleSheet(nullptr)
{
@@ -147,6 +149,16 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
changedDefaultStyle = true;
}
+ // FIXME: We should assert that the sheet only styles MathML elements.
+ if (element->namespaceURI() == MathMLNames::mathmlNamespaceURI
+ && !m_mathmlStyleSheet) {
+ m_mathmlStyleSheet = parseUASheet(mathmlUserAgentStyleSheet,
+ sizeof(mathmlUserAgentStyleSheet));
+ m_defaultStyle->addRulesFromSheet(mathmlStyleSheet(), screenEval());
+ m_defaultPrintStyle->addRulesFromSheet(mathmlStyleSheet(), printEval());
+ changedDefaultStyle = true;
+ }
+
// FIXME: We should assert that this sheet only contains rules for <video> and <audio>.
if (!m_mediaControlsStyleSheet && (isHTMLVideoElement(*element) || isHTMLAudioElement(*element))) {
String mediaRules = String(mediaControlsUserAgentStyleSheet, sizeof(mediaControlsUserAgentStyleSheet)) + RenderTheme::theme().extraMediaControlsStyleSheet();
@@ -182,6 +194,7 @@ void CSSDefaultStyleSheets::trace(Visitor* visitor)
visitor->trace(m_viewportStyleSheet);
visitor->trace(m_quirksStyleSheet);
visitor->trace(m_svgStyleSheet);
+ visitor->trace(m_mathmlStyleSheet);
visitor->trace(m_mediaControlsStyleSheet);
visitor->trace(m_fullscreenStyleSheet);
}
« no previous file with comments | « Source/core/css/CSSDefaultStyleSheets.h ('k') | Source/core/css/mathml.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698