Index: Source/core/css/mathml.css |
diff --git a/Source/core/dom/custom/CustomElementMicrotaskElementStep.cpp b/Source/core/css/mathml.css |
similarity index 66% |
copy from Source/core/dom/custom/CustomElementMicrotaskElementStep.cpp |
copy to Source/core/css/mathml.css |
index 7e76e0ce6e2bbda8cdc46456608bff6c25b12aa6..26f3ff4a063e4a5895e092c947903dafdf76e714 100644 |
--- a/Source/core/dom/custom/CustomElementMicrotaskElementStep.cpp |
+++ b/Source/core/css/mathml.css |
@@ -1,4 +1,6 @@ |
/* |
+ * The default style sheet used to render MathML. |
+ * |
* Copyright (C) 2014 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
@@ -28,30 +30,30 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#include "config.h" |
-#include "core/dom/custom/CustomElementMicrotaskElementStep.h" |
- |
-#include "core/dom/custom/CustomElementCallbackQueue.h" |
+@namespace "http://www.w3.org/1998/Math/MathML"; |
-namespace WebCore { |
- |
-PassOwnPtr<CustomElementMicrotaskElementStep> CustomElementMicrotaskElementStep::create(CustomElementCallbackQueue* queue) |
-{ |
- ASSERT(queue); |
- return adoptPtr(new CustomElementMicrotaskElementStep(queue)); |
+/* By default, we only display the MathML formulas without any formatting other than the one specified by the display attribute. */ |
+math { |
+ display: inline; |
} |
- |
-static const CustomElementCallbackQueue::ElementQueueId kMicrotaskQueueId = 0; |
- |
-CustomElementMicrotaskElementStep::CustomElementMicrotaskElementStep(CustomElementCallbackQueue* queue) |
- : m_queue(queue) |
-{ |
- m_queue->setOwner(kMicrotaskQueueId); |
+math[display="block"] { |
+ display: block; |
+ text-align: center; |
} |
-CustomElementMicrotaskStep::Result CustomElementMicrotaskElementStep::process() |
-{ |
- return m_queue->processInElementQueue(kMicrotaskQueueId) ? DidWork : Result(0); |
+/* We only display the second child of a <semantics> element, which is its first annotation. */ |
+semantics > * { |
esprehn
2014/01/15 20:59:59
This is bad, it ends up in the universal rules so
|
+ display: none; |
+} |
+semantics > *:first-child + annotation, |
+semantics > *:first-child + annotation-xml { |
esprehn
2014/01/15 20:59:59
This is bad, it means we will invalidate a sibling
|
+ display: inline-block; |
} |
-} // namespace WebCore |
+/* If an alttext attribute is specified, we replace the MathML formula with that text. */ |
+math[alttext] * { |
esprehn
2014/01/15 20:59:59
Another universal rule, it's going to add a rule t
|
+ display: none; |
+} |
+math[alttext]::after { |
esprehn
2014/01/15 20:59:59
This is another universal rule :(
|
+ content: attr(alttext); |
+} |