Changeset 156036 in webkit
- Timestamp:
- Sep 18, 2013 5:39:23 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r156033 r156036 1 2013-09-18 Gurpreet Kaur <k.gurpreet@samsung.com> 2 3 [MathML] Implement the subscriptshift and superscriptshift attributes 4 https://bugs.webkit.org/show_bug.cgi?id=120069 5 6 Reviewed by Darin Adler. 7 8 * mathml/presentation/msub-subscriptshift-expected.txt: Added. 9 * mathml/presentation/msub-subscriptshift.html: Added. 10 * mathml/presentation/msubsup-subscriptshift-expected.txt: Added. 11 * mathml/presentation/msubsup-subscriptshift.html: Added. 12 * mathml/presentation/msubsup-superscriptshift-expected.txt: Added. 13 * mathml/presentation/msubsup-superscriptshift.html: Added. 14 * mathml/presentation/msup-superscriptshift-expected.txt: Added. 15 * mathml/presentation/msup-superscriptshift.html: Added. 16 * mathml/presentation/multiscript-subscriptshift-expected.txt: Added. 17 * mathml/presentation/multiscript-subscriptshift.html: Added. 18 * mathml/presentation/multiscript-superscriptshift-expected.txt: Added. 19 * mathml/presentation/multiscript-superscriptshift.html: Added. 20 Added new tests for verifying that subscriptshift and superscriptshift are 21 being applied properly to the script base. 22 1 23 2013-09-18 Mario Sanchez Prada <mario.prada@samsung.com> 2 24 -
trunk/Source/WebCore/ChangeLog
r156033 r156036 1 2013-09-18 Gurpreet Kaur <k.gurpreet@samsung.com> 2 3 [MathML] Implement the subscriptshift and superscriptshift attributes 4 https://bugs.webkit.org/show_bug.cgi?id=120069 5 6 Reviewed by Darin Adler. 7 8 Added support for subscriptshift and superscriptshift attributes. The 9 subscriptshift attribute is for msup element and superscriptshift for 10 msup. msubsup can have both subscriptshift and superscriptshift. The 11 subscriptshift attribute specifies the minimum amount to shift the 12 baseline of subscript down. The superscriptshift attribute specifies 13 the minimum amount to shift the baseline of superscript up. 14 15 Tests: mathml/presentation/msub-subscriptshift.html 16 mathml/presentation/msubsup-subscriptshift.html 17 mathml/presentation/msubsup-superscriptshift.html 18 mathml/presentation/msup-superscriptshift.html 19 mathml/presentation/multiscript-subscriptshift.html 20 mathml/presentation/multiscript-superscriptshift.html 21 22 * mathml/mathattrs.in: 23 * rendering/mathml/RenderMathMLScripts.cpp: 24 (WebCore::RenderMathMLScripts::layout): 25 For aligning the subscript and superscript padding is added to the base. 26 So subscriptshift and superscriptshift attributes is set as padding bottom 27 and padding top of base respectively. 28 1 29 2013-09-18 Mario Sanchez Prada <mario.prada@samsung.com> 2 30 -
trunk/Source/WebCore/mathml/mathattrs.in
r152235 r156036 28 28 separators 29 29 stretchy 30 subscriptshift 31 superscriptshift 30 32 width -
trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
r155944 r156036 278 278 // baseline), or the subscript above the axis. Also, don't let the superscript's top edge be 279 279 // below the base's top edge, or the subscript's bottom edge above the base's bottom edge. 280 //281 // FIXME: Check any subscriptshift or superscriptshift attributes, and maybe use more sophisticated282 // heuristics from TeX or elsewhere. See https://bugs.webkit.org/show_bug.cgi?id=79274#c5.283 280 284 281 LayoutUnit baseHeight = base->logicalHeight(); … … 295 292 LayoutUnit bottomPadding = 0; 296 293 294 Element* scriptElement = element(); 295 LayoutUnit superscriptShiftValue = 0; 296 LayoutUnit subscriptShiftValue = 0; 297 if (m_kind == Sub || m_kind == SubSup || m_kind == Multiscripts) 298 parseMathMLLength(scriptElement->fastGetAttribute(MathMLNames::subscriptshiftAttr), subscriptShiftValue, style(), false); 299 if (m_kind == Super || m_kind == SubSup || m_kind == Multiscripts) 300 parseMathMLLength(scriptElement->fastGetAttribute(MathMLNames::superscriptshiftAttr), superscriptShiftValue, style(), false); 301 297 302 bool isPostScript = true; 298 303 RenderMathMLBlock* subSupPair = toRenderMathMLBlock(m_baseWrapper->nextSibling()); … … 312 317 if (superscriptBaseline == -1) 313 318 superscriptBaseline = superscriptHeight; 314 LayoutUnit minBaseline = max<LayoutUnit>(fontSize / 3 + 1 + superscriptBaseline, superscriptHeight + axis );319 LayoutUnit minBaseline = max<LayoutUnit>(fontSize / 3 + 1 + superscriptBaseline, superscriptHeight + axis + superscriptShiftValue); 315 320 316 321 topPadding = max<LayoutUnit>(topPadding, minBaseline - baseBaseline); … … 324 329 LayoutUnit baseExtendUnderBaseline = baseHeight - baseBaseline; 325 330 LayoutUnit subscriptUnderItsBaseline = subscriptHeight - subscriptBaseline; 326 LayoutUnit minExtendUnderBaseline = max<LayoutUnit>(fontSize / 5 + 1 + subscriptUnderItsBaseline, subscriptHeight - axis);331 LayoutUnit minExtendUnderBaseline = max<LayoutUnit>(fontSize / 5 + 1 + subscriptUnderItsBaseline, subscriptHeight + subscriptShiftValue - axis); 327 332 328 333 bottomPadding = max<LayoutUnit>(bottomPadding, minExtendUnderBaseline - baseExtendUnderBaseline);
Note: See TracChangeset
for help on using the changeset viewer.