Changeset 202727 in webkit
- Timestamp:
- Jul 1, 2016 12:29:53 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202726 r202727 1 2016-07-01 Frederic Wang <fwang.igalia.com> 2 3 Eliminate trailing whitespace in MathML code 4 https://bugs.webkit.org/show_bug.cgi?id=159091 5 6 Reviewed by Alex Christensen. 7 8 No new tests, behavior is unchanged. 9 10 * rendering/mathml/RenderMathMLBlock.cpp: 11 (WebCore::RenderMathMLBlock::baselinePosition): 12 (WebCore::RenderMathMLBlock::paint): 13 (WebCore::parseMathMLNamedSpace): 14 * rendering/mathml/RenderMathMLBlock.h: 15 * rendering/mathml/RenderMathMLFenced.cpp: 16 (WebCore::RenderMathMLFenced::updateFromElement): 17 (WebCore::RenderMathMLFenced::addChild): 18 * rendering/mathml/RenderMathMLFenced.h: 19 * rendering/mathml/RenderMathMLFraction.cpp: 20 (WebCore::RenderMathMLFraction::styleDidChange): 21 (WebCore::RenderMathMLFraction::paint): 22 * rendering/mathml/RenderMathMLFraction.h: 23 * rendering/mathml/RenderMathMLMath.h: 24 * rendering/mathml/RenderMathMLMenclose.h: 25 * rendering/mathml/RenderMathMLOperator.cpp: 26 * rendering/mathml/RenderMathMLOperator.h: 27 * rendering/mathml/RenderMathMLRoot.cpp: 28 (WebCore::RenderMathMLRoot::paint): 29 * rendering/mathml/RenderMathMLScripts.cpp: 30 * rendering/mathml/RenderMathMLSpace.cpp: 31 * rendering/mathml/RenderMathMLSpace.h: 32 * rendering/mathml/RenderMathMLToken.h: 33 * rendering/mathml/RenderMathMLUnderOver.cpp: 34 * rendering/mathml/RenderMathMLUnderOver.h: 35 1 36 2016-07-01 Frederic Wang <fwang@igalia.com> 2 37 -
trunk/Source/WebCore/mathml/MathMLElement.cpp
r202441 r202727 47 47 48 48 namespace WebCore { 49 49 50 50 using namespace MathMLNames; 51 51 52 52 MathMLElement::MathMLElement(const QualifiedName& tagName, Document& document) 53 53 : StyledElement(tagName, document, CreateMathMLElement) 54 54 { 55 55 } 56 56 57 57 Ref<MathMLElement> MathMLElement::create(const QualifiedName& tagName, Document& document) 58 58 { -
trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp
r202488 r202727 42 42 43 43 namespace WebCore { 44 44 45 45 using namespace MathMLNames; 46 46 -
trunk/Source/WebCore/mathml/MathMLInlineContainerElement.h
r200041 r202727 32 32 33 33 namespace WebCore { 34 34 35 35 class MathMLInlineContainerElement : public MathMLElement { 36 36 public: … … 46 46 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; 47 47 }; 48 48 49 49 } 50 50 -
trunk/Source/WebCore/mathml/MathMLMathElement.h
r200041 r202727 42 42 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; 43 43 }; 44 44 45 45 } 46 46 -
trunk/Source/WebCore/mathml/MathMLMencloseElement.cpp
r200041 r202727 49 49 50 50 RenderPtr<RenderElement> MathMLMencloseElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) 51 { 51 { 52 52 return createRenderer<RenderMathMLMenclose>(*this, WTFMove(style)); 53 53 } -
trunk/Source/WebCore/mathml/MathMLTextElement.cpp
r202572 r202727 37 37 38 38 namespace WebCore { 39 39 40 40 using namespace MathMLNames; 41 41 -
trunk/Source/WebCore/mathml/MathMLTextElement.h
r200041 r202727 32 32 33 33 namespace WebCore { 34 34 35 35 class MathMLTextElement final : public MathMLElement { 36 36 public: … … 49 49 void parseAttribute(const QualifiedName&, const AtomicString&) override; 50 50 }; 51 51 52 52 } 53 53 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
r202420 r202727 41 41 42 42 namespace WebCore { 43 43 44 44 using namespace MathMLNames; 45 45 46 46 RenderMathMLBlock::RenderMathMLBlock(Element& container, RenderStyle&& style) 47 47 : RenderFlexibleBox(container, WTFMove(style)) … … 82 82 if (linePositionMode == PositionOfInteriorLineBoxes) 83 83 return 0; 84 84 85 85 // FIXME: This may be unnecessary after flex baselines are implemented (https://bugs.webkit.org/show_bug.cgi?id=96188). 86 86 return firstLineBaseline().valueOrCompute([&] { … … 105 105 { 106 106 RenderFlexibleBox::paint(info, paintOffset); 107 107 108 108 if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground) 109 109 return; … … 112 112 113 113 GraphicsContextStateSaver stateSaver(info.context()); 114 114 115 115 info.context().setStrokeThickness(1.0f); 116 116 info.context().setStrokeStyle(SolidStroke); 117 117 info.context().setStrokeColor(Color(0, 0, 255)); 118 118 119 119 info.context().drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y())); 120 120 info.context().drawLine(IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y()), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + pixelSnappedOffsetHeight())); 121 121 info.context().drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + pixelSnappedOffsetHeight()), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + pixelSnappedOffsetHeight())); 122 122 info.context().drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + pixelSnappedOffsetHeight())); 123 123 124 124 int topStart = paddingTop(); 125 125 126 126 info.context().setStrokeColor(Color(0, 255, 0)); 127 127 128 128 info.context().drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + topStart), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + topStart)); 129 129 130 130 int baseline = roundToInt(baselinePosition(AlphabeticBaseline, true, HorizontalLine)); 131 131 132 132 info.context().setStrokeColor(Color(255, 0, 0)); 133 133 134 134 info.context().drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + baseline), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + baseline)); 135 135 } … … 147 147 // 148 148 // There should be no space between the number and the unit of a length." 149 // 149 // 150 150 // "A trailing '%' represents a percent of the default value. The default 151 151 // value, or how it is obtained, is listed in the table of attributes for each … … 154 154 // 155 155 // "The possible units in MathML are: 156 // 156 // 157 157 // Unit Description 158 158 // em an em (font-relative unit traditionally used for horizontal lengths) … … 300 300 length = -6; 301 301 else if (string == "negativeveryverythickmathspace") 302 length = -7; 302 length = -7; 303 303 } 304 304 if (length) { … … 317 317 } 318 318 319 } 319 } 320 320 321 321 #endif -
trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
r202420 r202727 37 37 38 38 namespace WebCore { 39 39 40 40 class RenderMathMLOperator; 41 41 … … 46 46 47 47 bool isChildAllowed(const RenderObject&, const RenderStyle&) const override; 48 48 49 49 // MathML defines an "embellished operator" as roughly an <mo> that may have subscripts, 50 50 // superscripts, underscripts, overscripts, or a denominator (as in d/dx, where "d" is some … … 55 55 // https://bugs.webkit.org/show_bug.cgi?id=78617. 56 56 virtual RenderMathMLOperator* unembellishedOperator() { return 0; } 57 57 58 58 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override; 59 59 60 60 #if ENABLE(DEBUG_MATH_LAYOUT) 61 61 virtual void paint(PaintInfo&, const LayoutPoint&); 62 62 #endif 63 63 64 64 LayoutUnit mathAxisHeight() const; 65 65 LayoutUnit mirrorIfNeeded(LayoutUnit horizontalOffset, LayoutUnit boxWidth = 0) const; 66 66 LayoutUnit mirrorIfNeeded(LayoutUnit horizontalOffset, const RenderBox& child) const { return mirrorIfNeeded(horizontalOffset, child.logicalWidth()); } 67 67 68 68 protected: 69 69 static LayoutUnit ascentForChild(const RenderBox& child) … … 84 84 { 85 85 } 86 86 87 87 Optional<int> firstLineBaseline() const override; 88 88 89 89 private: 90 90 bool isRenderMathMLTable() const override { return true; } -
trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
r200041 r202727 38 38 39 39 namespace WebCore { 40 40 41 41 using namespace MathMLNames; 42 42 43 43 static const char* gOpeningBraceChar = "("; 44 44 static const char* gClosingBraceChar = ")"; … … 53 53 { 54 54 const auto& fenced = element(); 55 55 56 56 // The open operator defaults to a left parenthesis. 57 57 AtomicString open = fenced.fastGetAttribute(MathMLNames::openAttr); … … 74 74 m_separators = StringImpl::create(","); 75 75 } 76 76 77 77 if (isEmpty()) 78 78 makeFences(); … … 106 106 if (isEmpty()) 107 107 updateFromElement(); 108 108 109 109 // FIXME: Adding or removing a child should possibly cause all later separators to shift places if they're different, as later child positions change by +1 or -1. This should also handle surrogate pairs. See https://bugs.webkit.org/show_bug.cgi?id=125938. 110 110 111 111 RenderPtr<RenderMathMLOperator> separatorRenderer; 112 112 if (m_separators.get()) { … … 121 121 } 122 122 // |count| is now the number of element children that will be before our new separator, i.e. it's the 1-based index of the separator. 123 123 124 124 if (count > 0) { 125 125 UChar separator; 126 126 127 127 // Use the last separator if we've run out of specified separators. 128 128 if (count > m_separators.get()->length()) … … 130 130 else 131 131 separator = (*m_separators.get())[count - 1]; 132 132 133 133 StringBuilder builder; 134 134 builder.append(separator); … … 136 136 } 137 137 } 138 138 139 139 if (beforeChild) { 140 140 // Adding |x| before an existing |y| e.g. in element (y) - first insert our new child |x|, then its separator, to get (x, y). … … 150 150 } 151 151 152 } 152 } 153 153 154 154 #endif -
trunk/Source/WebCore/rendering/mathml/RenderMathMLFenced.h
r200041 r202727 34 34 35 35 namespace WebCore { 36 36 37 37 class RenderMathMLFenced final : public RenderMathMLRow { 38 38 public: 39 39 RenderMathMLFenced(MathMLInlineContainerElement&, RenderStyle&&); 40 40 MathMLInlineContainerElement& element() { return static_cast<MathMLInlineContainerElement&>(nodeForNonAnonymous()); } 41 41 42 42 private: 43 43 bool isRenderMathMLFenced() const override { return true; } … … 52 52 String m_close; 53 53 RefPtr<StringImpl> m_separators; 54 54 55 55 RenderMathMLOperator* m_closeFenceRenderer; 56 56 }; 57 57 58 58 } 59 59 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
r202441 r202727 37 37 38 38 namespace WebCore { 39 39 40 40 using namespace MathMLNames; 41 41 … … 124 124 { 125 125 RenderMathMLBlock::styleDidChange(diff, oldStyle); 126 126 127 127 updateFromElement(); 128 128 } … … 210 210 211 211 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location() + LayoutPoint(0, numerator().logicalHeight() + gNumeratorGap * style().fontSize() + m_lineThickness / 2)); 212 212 213 213 GraphicsContextStateSaver stateSaver(info.context()); 214 214 215 215 info.context().setStrokeThickness(m_lineThickness); 216 216 info.context().setStrokeStyle(SolidStroke); -
trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
r200041 r202727 58 58 RenderMathMLOperator* unembellishedOperator() final; 59 59 void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final; 60 60 61 61 bool isValid() const; 62 62 RenderBox& numerator() const; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLMath.h
r202497 r202727 32 32 33 33 namespace WebCore { 34 34 35 35 class RenderMathMLMath final : public RenderMathMLRow { 36 36 public: … … 41 41 const char* renderName() const override { return "RenderMathMLMath"; } 42 42 }; 43 43 44 44 } 45 45 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.h
r200041 r202727 33 33 34 34 namespace WebCore { 35 35 36 36 class RenderMathMLMenclose final: public RenderMathMLRow { 37 37 public: … … 53 53 LayoutRect m_contentRect; 54 54 }; 55 55 56 56 } 57 57 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
r202420 r202727 44 44 45 45 namespace WebCore { 46 46 47 47 using namespace MathMLNames; 48 48 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
r202497 r202727 48 48 LayoutUnit stretchSize() const { return m_isVertical ? m_stretchHeightAboveBaseline + m_stretchDepthBelowBaseline : m_stretchWidth; } 49 49 void resetStretchSize(); 50 50 51 51 bool hasOperatorFlag(MathMLOperatorDictionary::Flag flag) const { return m_operatorFlags & flag; } 52 52 // FIXME: The displaystyle property is not implemented (https://bugs.webkit.org/show_bug.cgi?id=118737). -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
r202441 r202727 250 250 { 251 251 RenderMathMLRow::paint(info, paintOffset); 252 252 253 253 if (isEmpty() || info.context().paintingDisabled() || style().visibility() != VISIBLE || !isValid()) 254 254 return; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
r202441 r202727 36 36 37 37 namespace WebCore { 38 38 39 39 using namespace MathMLNames; 40 40 … … 435 435 } 436 436 437 } 437 } 438 438 439 439 #endif // ENABLE(MATHML) -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
r200041 r202727 34 34 35 35 namespace WebCore { 36 36 37 37 using namespace MathMLNames; 38 38 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
r202569 r202727 33 33 34 34 namespace WebCore { 35 35 36 36 class RenderMathMLSpace final : public RenderMathMLBlock { 37 37 public: -
trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.h
r202569 r202727 35 35 36 36 namespace WebCore { 37 37 38 38 class RenderMathMLToken : public RenderMathMLBlock { 39 39 public: -
trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
r202441 r202727 39 39 40 40 using namespace MathMLNames; 41 41 42 42 RenderMathMLUnderOver::RenderMathMLUnderOver(Element& element, RenderStyle&& style) 43 43 : RenderMathMLBlock(element, WTFMove(style)) -
trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h
r200041 r202727 33 33 34 34 namespace WebCore { 35 35 36 36 class RenderMathMLUnderOver final : public RenderMathMLBlock { 37 37 public: 38 38 RenderMathMLUnderOver(Element&, RenderStyle&&); 39 39 40 40 RenderMathMLOperator* unembellishedOperator() override; 41 41 … … 60 60 UnderOverType m_scriptType; 61 61 }; 62 62 63 63 } 64 64
Note: See TracChangeset
for help on using the changeset viewer.