MathML preferred widths should not depend on layout information
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jan 2013 00:40:45 +0000 (00:40 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jan 2013 00:40:45 +0000 (00:40 +0000)
commit00676c95c1dc1d070c235ee11025db4cc179fd3c
tree79aee98b738b645465566554f666a547bec37bd2
parent1b469565904167ccc4eb34b975e379f0eec081ce
MathML preferred widths should not depend on layout information
https://bugs.webkit.org/show_bug.cgi?id=107353

Reviewed by Levi Weintraub.

Source/WebCore:

* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::attach):
(WebCore::MathMLTextElement::childrenChanged):
* mathml/MathMLTextElement.h:
Need to update the render tree when the text of a <mo> changes.

* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::RenderMathMLBlock):
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::styleDidChange):
Need to update the rendertree to apply operator stretching.

* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::glyphHeightForCharacter):
(WebCore::RenderMathMLOperator::widthForCharacter):
(WebCore::RenderMathMLOperator::computeIntrinsicLogicalWidths):
(WebCore::RenderMathMLOperator::stretchDisabledByMarkup):
(WebCore::RenderMathMLOperator::firstTextCharacter):
(WebCore::RenderMathMLOperator::stretchyCharacterIndex):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::firstLineBoxBaseline):
-Make the preferred widths of operators the max of all possible
characters to be used in the operator and center the operator in that width.
-For stretching where we don't use multiple glyphs, use transforms
instead of font-size. This both looks better and avoids affecting the width.
-Now that preferred widths don't depends on height, we don't need to
override computePreferredLogicalWidths at all in MathML code.

* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::index):
Tighten up the type.

(WebCore::RenderMathMLRoot::layout):
Move the laying out of children to the layout method.

* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::logicalHeightExcludingOperators):
(WebCore::RenderMathMLRow::stretchOperatorsAndLayout):
(WebCore::RenderMathMLRow::layout):
Move the laying out of children and the subsequent setting of stretchHeight
to the layout method.

* rendering/mathml/RenderMathMLRow.h:

LayoutTests:

* mathml/differentiable-manifold.html: Added.
* platform/chromium-linux/mathml/differentiable-manifold-expected.png: Added.
* platform/chromium-linux/mathml/differentiable-manifold-expected.txt: Added.
* platform/chromium-linux/mathml/presentation/fenced-expected.txt:
* platform/chromium-linux/mathml/presentation/fenced-mi-expected.png:
* platform/chromium-linux/mathml/presentation/fenced-mi-expected.txt:
* platform/chromium-linux/mathml/presentation/mo-expected.txt:
* platform/chromium-linux/mathml/presentation/mo-stretch-expected.png:
* platform/chromium-linux/mathml/presentation/mo-stretch-expected.txt:
* platform/chromium-linux/mathml/presentation/over-expected.txt:
* platform/chromium-linux/mathml/presentation/row-alignment-expected.txt:
* platform/chromium-linux/mathml/presentation/row-expected.png:
* platform/chromium-linux/mathml/presentation/row-expected.txt:
* platform/chromium-linux/mathml/presentation/sub-expected.png:
* platform/chromium-linux/mathml/presentation/sub-expected.txt:
* platform/chromium-linux/mathml/presentation/subsup-expected.txt:
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
LayoutTests/ChangeLog
LayoutTests/mathml/differentiable-manifold.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/mathml/differentiable-manifold-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/mathml/differentiable-manifold-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-linux/mathml/presentation/fenced-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/fenced-mi-expected.png
LayoutTests/platform/chromium-linux/mathml/presentation/fenced-mi-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/mo-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/mo-stretch-expected.png
LayoutTests/platform/chromium-linux/mathml/presentation/mo-stretch-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/over-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/row-alignment-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/row-expected.png
LayoutTests/platform/chromium-linux/mathml/presentation/row-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/sub-expected.png
LayoutTests/platform/chromium-linux/mathml/presentation/sub-expected.txt
LayoutTests/platform/chromium-linux/mathml/presentation/subsup-expected.txt
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/mathml/MathMLTextElement.cpp
Source/WebCore/mathml/MathMLTextElement.h
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.h
Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
Source/WebCore/rendering/mathml/RenderMathMLRoot.h
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
Source/WebCore/rendering/mathml/RenderMathMLRow.h