Changeset 165464 in webkit
- Timestamp:
- Mar 12, 2014 2:49:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r165461 r165464 1 2014-03-12 Frédéric Wang <fred.wang@free.fr> 2 3 Invisible Operators should not add space. 4 https://bugs.webkit.org/show_bug.cgi?id=115786 5 6 Reviewed by Chris Fleizach. 7 8 Add a reftest based on the examples of the MathML specification to verify that invisible operators do not add space. 9 10 * mathml/presentation/mo-invisible-expected.html: Added. 11 * mathml/presentation/mo-invisible.html: Added. 12 1 13 2014-03-11 Frédéric Wang <fred.wang@free.fr> 2 14 -
trunk/Source/WebCore/ChangeLog
r165461 r165464 1 2014-03-12 Frédéric Wang <fred.wang@free.fr> 2 3 Invisible Operators should not add space. 4 https://bugs.webkit.org/show_bug.cgi?id=115786 5 6 Reviewed by Chris Fleizach. 7 8 This change adds special handling for invisible operator to ensure they really behave as empty box. We now ignore their glyph widths and do not paint them. 9 10 Test: mathml/presentation/mo-invisible.html 11 12 * rendering/mathml/RenderMathMLOperator.cpp: 13 (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): 14 (WebCore::RenderMathMLOperator::paint): 15 * rendering/mathml/RenderMathMLOperator.h: 16 1 17 2014-03-11 Frédéric Wang <fred.wang@free.fr> 2 18 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
r165461 r165464 1303 1303 if (!allowStretching) { 1304 1304 RenderMathMLToken::computePreferredLogicalWidths(); 1305 if (isInvisibleOperator()) { 1306 // In some fonts, glyphs for invisible operators have nonzero width. Consequently, we subtract that width here to avoid wide gaps. 1307 float glyphWidth = advanceForCharacter(m_operator); 1308 ASSERT(glyphWidth <= m_minPreferredLogicalWidth); 1309 m_minPreferredLogicalWidth -= glyphWidth; 1310 m_maxPreferredLogicalWidth -= glyphWidth; 1311 } 1305 1312 return; 1306 1313 } … … 1530 1537 void RenderMathMLOperator::paint(PaintInfo& info, const LayoutPoint& paintOffset) 1531 1538 { 1532 if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != VISIBLE) 1539 // We skip painting for invisible operators too to avoid some "missing character" glyph to appear if appropriate math fonts are not available. 1540 if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != VISIBLE || isInvisibleOperator()) 1533 1541 return; 1534 1542 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
r165461 r165464 88 88 virtual bool isRenderMathMLOperator() const override { return true; } 89 89 bool isFencedOperator() { return isAnonymous(); } 90 // The following operators are invisible: U+2061 FUNCTION APPLICATION, U+2062 INVISIBLE TIMES, U+2063 INVISIBLE SEPARATOR, U+2064 INVISIBLE PLUS. 91 bool isInvisibleOperator() const { return 0x2061 <= m_operator && m_operator <= 0x2064; } 90 92 virtual bool isChildAllowed(const RenderObject&, const RenderStyle&) const override; 91 93 virtual void computePreferredLogicalWidths() override; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
r165461 r165464 60 60 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 61 61 if (child->isRenderMathMLBlock()) { 62 auto renderOperator = toRenderMathMLBlock(child)->unembellishedOperator(); 63 if (renderOperator) 62 if (auto renderOperator = toRenderMathMLBlock(child)->unembellishedOperator()) 64 63 renderOperator->updateOperatorProperties(); 65 64 }
Note: See TracChangeset
for help on using the changeset viewer.