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

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: Created 6 years, 11 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
Index: Source/core/css/CSSDefaultStyleSheets.cpp
diff --git a/Source/core/css/CSSDefaultStyleSheets.cpp b/Source/core/css/CSSDefaultStyleSheets.cpp
index 9375aa4b8e4026fd2d8d31db74cb10e4dfb1721e..c549efc6f34b4e7ea643264ee1e0b25fd41dc257 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"
@@ -53,6 +54,7 @@ StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet;
StyleSheetContents* CSSDefaultStyleSheets::viewportStyleSheet;
StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet;
StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet;
+StyleSheetContents* CSSDefaultStyleSheets::mathmlStyleSheet;
StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet;
StyleSheetContents* CSSDefaultStyleSheets::fullscreenStyleSheet;
@@ -141,6 +143,16 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
changedDefaultStyle = true;
}
+ // FIXME: We should assert that the sheet only styles MathML elements.
+ if (element->namespaceURI() == MathMLNames::mathmlNamespaceURI
+ && !mathmlStyleSheet) {
+ mathmlStyleSheet = parseUASheet(mathmlUserAgentStyleSheet,
+ sizeof(mathmlUserAgentStyleSheet));
+ defaultStyle->addRulesFromSheet(mathmlStyleSheet, screenEval());
+ defaultPrintStyle->addRulesFromSheet(mathmlStyleSheet, printEval());
+ changedDefaultStyle = true;
+ }
+
// FIXME: We should assert that this sheet only contains rules for <video> and <audio>.
if (!mediaControlsStyleSheet && (element->hasTagName(videoTag) || element->hasTagName(audioTag))) {
String mediaRules = String(mediaControlsUserAgentStyleSheet, sizeof(mediaControlsUserAgentStyleSheet)) + RenderTheme::theme().extraMediaControlsStyleSheet();

Powered by Google App Engine
This is Rietveld 408576698