Diff
Modified: trunk/LayoutTests/ChangeLog (163542 => 163543)
--- trunk/LayoutTests/ChangeLog 2014-02-06 17:59:05 UTC (rev 163542)
+++ trunk/LayoutTests/ChangeLog 2014-02-06 18:04:41 UTC (rev 163543)
@@ -1,3 +1,22 @@
+2014-02-06 Gurpreet Kaur <[email protected]>
+
+ Menclose with no notation attribute does not display anything.
+ https://bugs.webkit.org/show_bug.cgi?id=127889
+
+ Reviewed by Chris Fleizach.
+
+ * mathml/presentation/menclose-notation-default-longdiv.html: Added.
+ * mathml/presentation/menclose-notation-invalid-empty-expected.html: Added.
+ * mathml/presentation/menclose-notation-invalid-empty.html: Added.
+ * platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.png: Added.
+ * platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.txt: Added.
+ * platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.png: Added.
+ * platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.txt: Added.
+ * platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.png: Added.
+ * platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.txt: Added.
+ Added new test cases to test the functionality of menclose with no
+ notation attribute, invalid and empty notation attribute.
+
2014-02-06 Alexey Proskuryakov <[email protected]>
media/video-load-preload-metadata.html is flaky
Added: trunk/LayoutTests/mathml/presentation/menclose-notation-default-longdiv.html (0 => 163543)
--- trunk/LayoutTests/mathml/presentation/menclose-notation-default-longdiv.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/menclose-notation-default-longdiv.html 2014-02-06 18:04:41 UTC (rev 163543)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose default notation longdiv test</title>
+ </head>
+ <body>
+ <p>
+ <math><mrow><menclose><mspace width="100px" height="50px" mathbackground="red"/></menclose></mrow></math>
+ </p>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/mathml/presentation/menclose-notation-default-longdiv.html
___________________________________________________________________
Added: svn:executable
Added: trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty-expected.html (0 => 163543)
--- trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty-expected.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty-expected.html 2014-02-06 18:04:41 UTC (rev 163543)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>expected test case for menclose with empty and invalid notation attribute</title>
+ </head>
+ <body>
+ <p>
+ <math>
+ <mtable>
+ <mtr><mtd><mspace width="100px" height="50px" mathbackground="red"/></mtd></mtr>
+ <mtr><mtd><mspace width="100px" height="50px" mathbackground="red"/></mtd></mtr>
+ </mtable>
+ </math>
+ </p>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty-expected.html
___________________________________________________________________
Added: svn:executable
Added: trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty.html (0 => 163543)
--- trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty.html (rev 0)
+++ trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty.html 2014-02-06 18:04:41 UTC (rev 163543)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose with empty and invalid notation attribute</title>
+ </head>
+ <body>
+ <p>
+ <math>
+ <mtable>
+ <mtr><mtd><menclose notation=""><mspace width="100px" height="50px" mathbackground="red"/></menclose></mtd></mtr>
+ <mtr><mtd><menclose notation="triangle"><mspace width="100px" height="50px" mathbackground="red"/></menclose></mtd></mtr>
+ </mtable>
+ </math>
+ </p>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/mathml/presentation/menclose-notation-invalid-empty.html
___________________________________________________________________
Added: svn:executable
Added: trunk/LayoutTests/platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.png
___________________________________________________________________
Added: svn:executable
Added: svn:mime-type
Added: trunk/LayoutTests/platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.txt (0 => 163543)
--- trunk/LayoutTests/platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.txt 2014-02-06 18:04:41 UTC (rev 163543)
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x92
+ RenderBlock {HTML} at (0,0) size 800x92
+ RenderBody {BODY} at (8,16) size 784x60
+ RenderBlock {P} at (0,0) size 784x60
+ RenderMathMLMath {math} at (0,0) size 102x56 [padding: 0 1 0 1]
+ RenderMathMLRow {mrow} at (1,0) size 100x56
+ RenderMathMLMenclose {menclose} at (0,0) size 100x56 [padding: 6 0 0 5]
+ RenderMathMLSpace {mspace} at (5,6) size 100x50 [bgcolor=#FF0000]
+ RenderText {#text} at (0,0) size 0x0
Property changes on: trunk/LayoutTests/platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.txt
___________________________________________________________________
Added: svn:executable
Added: trunk/LayoutTests/platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.png
___________________________________________________________________
Added: svn:executable
Added: svn:mime-type
Added: trunk/LayoutTests/platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.txt (0 => 163543)
--- trunk/LayoutTests/platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.txt 2014-02-06 18:04:41 UTC (rev 163543)
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x92
+ RenderBlock {HTML} at (0,0) size 800x92
+ RenderBody {BODY} at (8,16) size 784x60
+ RenderBlock {P} at (0,0) size 784x60
+ RenderMathMLMath {math} at (0,0) size 102x56 [padding: 0 1 0 1]
+ RenderMathMLRow {mrow} at (1,0) size 100x56
+ RenderMathMLMenclose {menclose} at (0,0) size 100x56 [padding: 6 0 0 5]
+ RenderMathMLSpace {mspace} at (5,6) size 100x50 [bgcolor=#FF0000]
+ RenderText {#text} at (0,0) size 0x0
Property changes on: trunk/LayoutTests/platform/gtk/mathml/presentation/menclose-notation-default-longdiv-expected.txt
___________________________________________________________________
Added: svn:executable
Added: trunk/LayoutTests/platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.png
___________________________________________________________________
Added: svn:executable
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.txt (0 => 163543)
--- trunk/LayoutTests/platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.txt 2014-02-06 18:04:41 UTC (rev 163543)
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x92
+ RenderBlock {HTML} at (0,0) size 800x92
+ RenderBody {BODY} at (8,16) size 784x60
+ RenderBlock {P} at (0,0) size 784x60
+ RenderMathMLMath {math} at (0,0) size 102x56 [padding: 0 1 0 1]
+ RenderMathMLRow {mrow} at (1,0) size 100x56
+ RenderMathMLMenclose {menclose} at (0,0) size 100x56 [padding: 6 0 0 5]
+ RenderMathMLSpace {mspace} at (5,6) size 100x50 [bgcolor=#FF0000]
+ RenderText {#text} at (0,0) size 0x0
Property changes on: trunk/LayoutTests/platform/mac/mathml/presentation/menclose-notation-default-longdiv-expected.txt
___________________________________________________________________
Added: svn:executable
Modified: trunk/Source/WebCore/ChangeLog (163542 => 163543)
--- trunk/Source/WebCore/ChangeLog 2014-02-06 17:59:05 UTC (rev 163542)
+++ trunk/Source/WebCore/ChangeLog 2014-02-06 18:04:41 UTC (rev 163543)
@@ -1,3 +1,26 @@
+2014-02-06 Gurpreet Kaur <[email protected]>
+
+ Menclose with no notation attribute does not display anything.
+ https://bugs.webkit.org/show_bug.cgi?id=127889
+
+ Reviewed by Chris Fleizach.
+
+ Menclose with no notation attribute should behave same as menclose with
+ notation attribute with value as longdiv. By default the division
+ symbol should be displayed. For empty and invalid notation attribute
+ nothing should be displayed.
+
+ Tests: mathml/presentation/menclose-notation-default-longdiv.html
+ mathml/presentation/menclose-notation-invalid-empty.html
+
+ * mathml/MathMLMencloseElement.h:
+ * rendering/mathml/RenderMathMLMenclose.cpp:
+ (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
+ (WebCore::RenderMathMLMenclose::paint):
+ Added style for menclose with no notation attribute and handled this
+ condition in paint also where for longdiv we are explicitly drawing
+ the division symbol.
+
2014-02-05 Mark Hahnenberg <[email protected]>
Heap::writeBarrier shouldn't be static
Modified: trunk/Source/WebCore/mathml/MathMLMencloseElement.h (163542 => 163543)
--- trunk/Source/WebCore/mathml/MathMLMencloseElement.h 2014-02-06 17:59:05 UTC (rev 163542)
+++ trunk/Source/WebCore/mathml/MathMLMencloseElement.h 2014-02-06 18:04:41 UTC (rev 163543)
@@ -36,6 +36,8 @@
static PassRefPtr<MathMLMencloseElement> create(const QualifiedName& tagName, Document&);
const Vector<String>& notationValues() const { return m_notationValues; }
bool isRadical() const { return m_isRadicalValue; }
+ String longDivLeftPadding() const;
+ bool isDefaultLongDiv() const { return !hasAttribute(MathMLNames::notationAttr); }
private:
MathMLMencloseElement(const QualifiedName&, Document&);
@@ -43,7 +45,6 @@
virtual bool isPresentationAttribute(const QualifiedName&) const override;
virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
virtual void finishParsingChildren() override;
- String longDivLeftPadding() const;
Vector<String> m_notationValues;
bool m_isRadicalValue;
Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp (163542 => 163543)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp 2014-02-06 17:59:05 UTC (rev 163542)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp 2014-02-06 18:04:41 UTC (rev 163543)
@@ -65,6 +65,7 @@
ASSERT(preferredLogicalWidthsDirty());
RenderMathMLBlock::computePreferredLogicalWidths();
+ const int paddingTop = 6;
MathMLMencloseElement* menclose = toMathMLMencloseElement(element());
const Vector<String>& notationValues = menclose->notationValues();
@@ -76,6 +77,10 @@
}
}
+ if (menclose->isDefaultLongDiv()) {
+ style().setPaddingTop(Length(paddingTop, Fixed));
+ style().setPaddingLeft(Length(menclose->longDivLeftPadding().toInt(), Fixed));
+ }
setPreferredLogicalWidthsDirty(false);
}
@@ -99,8 +104,8 @@
MathMLMencloseElement* menclose = toMathMLMencloseElement(element());
const Vector<String>& notationValues = menclose->notationValues();
size_t notationalValueSize = notationValues.size();
- bool isDefaultLongDiv = !notationalValueSize;
- if (notationalValueSize && checkNotationalValuesValidity(notationValues)) {
+ bool isDefaultLongDiv = menclose->isDefaultLongDiv();
+ if ((notationalValueSize && checkNotationalValuesValidity(notationValues)) || isDefaultLongDiv) {
IntRect rect = absoluteBoundingBoxRect();
int left = rect.x();
int top = rect.y();
@@ -140,6 +145,8 @@
midxPoint = style().paddingLeft().value();
root.addBezierCurveTo(FloatPoint(left, top), FloatPoint(left + midxPoint, top + halfboxHeight), FloatPoint(left, top + boxHeight));
info.context->strokePath(root);
+ if (isDefaultLongDiv)
+ info.context->drawLine(IntPoint(left, top), IntPoint(left + boxWidth + midxPoint, top));
}
}
}